mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/master'
This commit is contained in:
		| @@ -132,7 +132,7 @@ class POLineItemSerializer(InvenTreeModelSerializer): | ||||
|  | ||||
|     purchase_price_string = serializers.CharField(source='purchase_price', read_only=True) | ||||
|  | ||||
|     destination = LocationBriefSerializer(source='get_destination', read_only=True) | ||||
|     destination_detail = LocationBriefSerializer(source='get_destination', read_only=True) | ||||
|  | ||||
|     purchase_price_currency = serializers.ChoiceField( | ||||
|         choices=currency_code_mappings(), | ||||
| @@ -156,6 +156,7 @@ class POLineItemSerializer(InvenTreeModelSerializer): | ||||
|             'purchase_price_currency', | ||||
|             'purchase_price_string', | ||||
|             'destination', | ||||
|             'destination_detail', | ||||
|         ] | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -170,6 +170,7 @@ $("#edit-order").click(function() { | ||||
|             supplier: { | ||||
|             }, | ||||
|             {% endif %} | ||||
|             supplier_reference: {}, | ||||
|             description: {}, | ||||
|             target_date: { | ||||
|                 icon: 'fa-calendar-alt', | ||||
|   | ||||
| @@ -401,8 +401,15 @@ $("#po-table").inventreeTable({ | ||||
|             } | ||||
|         }, | ||||
|         { | ||||
|             field: 'destination.pathstring', | ||||
|             field: 'destination', | ||||
|             title: '{% trans "Destination" %}', | ||||
|             formatter: function(value, row) { | ||||
|                 if (value) { | ||||
|                     return renderLink(row.destination_detail.pathstring, `/stock/location/${value}/`); | ||||
|                 } else { | ||||
|                     return '-'; | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         { | ||||
|             field: 'notes', | ||||
|   | ||||
| @@ -163,6 +163,7 @@ $("#edit-order").click(function() { | ||||
|             customer: { | ||||
|             }, | ||||
|             {% endif %} | ||||
|             customer_reference: {}, | ||||
|             description: {}, | ||||
|             target_date: { | ||||
|                 icon: 'fa-calendar-alt', | ||||
|   | ||||
| @@ -118,9 +118,17 @@ class CategoryList(generics.ListCreateAPIView): | ||||
|  | ||||
|     ordering_fields = [ | ||||
|         'name', | ||||
|         'level', | ||||
|         'tree_id', | ||||
|         'lft', | ||||
|     ] | ||||
|  | ||||
|     ordering = 'name' | ||||
|     # Use hierarchical ordering by default | ||||
|     ordering = [ | ||||
|         'tree_id', | ||||
|         'lft', | ||||
|         'name' | ||||
|     ] | ||||
|  | ||||
|     search_fields = [ | ||||
|         'name', | ||||
|   | ||||
| @@ -32,6 +32,8 @@ class CategorySerializer(InvenTreeModelSerializer): | ||||
|  | ||||
|     parts = serializers.IntegerField(source='item_count', read_only=True) | ||||
|  | ||||
|     level = serializers.IntegerField(read_only=True) | ||||
|  | ||||
|     class Meta: | ||||
|         model = PartCategory | ||||
|         fields = [ | ||||
| @@ -40,10 +42,11 @@ class CategorySerializer(InvenTreeModelSerializer): | ||||
|             'description', | ||||
|             'default_location', | ||||
|             'default_keywords', | ||||
|             'pathstring', | ||||
|             'url', | ||||
|             'level', | ||||
|             'parent', | ||||
|             'parts', | ||||
|             'pathstring', | ||||
|             'url', | ||||
|         ] | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -363,6 +363,15 @@ class StockLocationList(generics.ListCreateAPIView): | ||||
|     ordering_fields = [ | ||||
|         'name', | ||||
|         'items', | ||||
|         'level', | ||||
|         'tree_id', | ||||
|         'lft', | ||||
|     ] | ||||
|  | ||||
|     ordering = [ | ||||
|         'tree_id', | ||||
|         'lft', | ||||
|         'name', | ||||
|     ] | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -260,12 +260,15 @@ class LocationSerializer(InvenTreeModelSerializer): | ||||
|  | ||||
|     items = serializers.IntegerField(source='item_count', read_only=True) | ||||
|  | ||||
|     level = serializers.IntegerField(read_only=True) | ||||
|  | ||||
|     class Meta: | ||||
|         model = StockLocation | ||||
|         fields = [ | ||||
|             'pk', | ||||
|             'url', | ||||
|             'name', | ||||
|             'level', | ||||
|             'description', | ||||
|             'parent', | ||||
|             'pathstring', | ||||
|   | ||||
| @@ -765,6 +765,9 @@ function attachSecondaryModal(modal, options) { | ||||
| function attachSecondaries(modal, secondaries) { | ||||
|     /* Attach a provided list of secondary modals */ | ||||
|  | ||||
|     // 2021-07-18 - Secondary modals will be disabled for now, until they are re-implemented in the "API forms" architecture | ||||
|     return; | ||||
|  | ||||
|     for (var i = 0; i < secondaries.length; i++) { | ||||
|         attachSecondaryModal(modal, secondaries[i]); | ||||
|     } | ||||
|   | ||||
| @@ -67,7 +67,9 @@ function renderStockItem(name, data, parameters, options) { | ||||
| // Renderer for "StockLocation" model | ||||
| function renderStockLocation(name, data, parameters, options) { | ||||
|  | ||||
|     var html = `<span>${data.name}</span>`; | ||||
|     var level = '- '.repeat(data.level); | ||||
|  | ||||
|     var html = `<span>${level}${data.pathstring}</span>`; | ||||
|  | ||||
|     if (data.description) { | ||||
|         html += ` - <i>${data.description}</i>`; | ||||
| @@ -75,10 +77,6 @@ function renderStockLocation(name, data, parameters, options) { | ||||
|  | ||||
|     html += `<span class='float-right'>{% trans "Location ID" %}: ${data.pk}</span>`; | ||||
|  | ||||
|     if (data.pathstring) { | ||||
|         html += `<p><small>${data.pathstring}</small></p>`; | ||||
|     } | ||||
|  | ||||
|     return html; | ||||
| } | ||||
|  | ||||
| @@ -154,7 +152,9 @@ function renderOwner(name, data, parameters, options) { | ||||
| // Renderer for "PartCategory" model | ||||
| function renderPartCategory(name, data, parameters, options) { | ||||
|  | ||||
|     var html = `<span><b>${data.name}</b></span>`; | ||||
|     var level = '- '.repeat(data.level); | ||||
|  | ||||
|     var html = `<span>${level}${data.pathstring}</span>`; | ||||
|  | ||||
|     if (data.description) { | ||||
|         html += ` - <i>${data.description}</i>`; | ||||
| @@ -162,10 +162,6 @@ function renderPartCategory(name, data, parameters, options) { | ||||
|  | ||||
|     html += `<span class='float-right'>{% trans "Category ID" %}: ${data.pk}</span>`; | ||||
|  | ||||
|     if (data.pathstring) { | ||||
|         html += `<p><small>${data.pathstring}</small></p>`; | ||||
|     } | ||||
|  | ||||
|     return html; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -14,6 +14,7 @@ function createSalesOrder(options={}) { | ||||
|             customer: { | ||||
|                 value: options.customer, | ||||
|             }, | ||||
|             customer_reference: {}, | ||||
|             description: {}, | ||||
|             target_date: { | ||||
|                 icon: 'fa-calendar-alt', | ||||
| @@ -44,6 +45,7 @@ function createPurchaseOrder(options={}) { | ||||
|             supplier: { | ||||
|                 value: options.supplier, | ||||
|             }, | ||||
|             supplier_reference: {}, | ||||
|             description: {}, | ||||
|             target_date: { | ||||
|                 icon: 'fa-calendar-alt', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user