mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-11-04 07:15:46 +00:00 
			
		
		
		
	Stock transfer extra (#420)
* Add API version check * Support "packaging" and "status" fields when performing a stock-transfer action * Update release notes
This commit is contained in:
		@@ -1,3 +1,8 @@
 | 
				
			|||||||
 | 
					### 0.12.8 - September 2023
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Added extra options for transferring stock items
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### 0.12.7 - August 2023
 | 
					### 0.12.7 - August 2023
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -323,6 +323,9 @@ class InvenTreeAPI {
 | 
				
			|||||||
  // Project codes require v109 or newer
 | 
					  // Project codes require v109 or newer
 | 
				
			||||||
  bool get supportsProjectCodes => isConnected() && apiVersion >= 109;
 | 
					  bool get supportsProjectCodes => isConnected() && apiVersion >= 109;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Does the server support extra fields on stock adjustment actions?
 | 
				
			||||||
 | 
					  bool get supportsStockAdjustExtraFields => isConnected() && apiVersion >= 133;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Are plugins enabled on the server?
 | 
					  // Are plugins enabled on the server?
 | 
				
			||||||
  bool _pluginsEnabled = false;
 | 
					  bool _pluginsEnabled = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -451,6 +451,16 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
 | 
				
			|||||||
      "location": {
 | 
					      "location": {
 | 
				
			||||||
        "value": widget.item.locationId,
 | 
					        "value": widget.item.locationId,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					      "status": {
 | 
				
			||||||
 | 
					        "parent": "items",
 | 
				
			||||||
 | 
					        "nested": true,
 | 
				
			||||||
 | 
					        "value": widget.item.status,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      "packaging": {
 | 
				
			||||||
 | 
					        "parent": "items",
 | 
				
			||||||
 | 
					        "nested": true,
 | 
				
			||||||
 | 
					        "value": widget.item.packaging,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
      "notes": {},
 | 
					      "notes": {},
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -459,6 +469,12 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
 | 
				
			|||||||
      fields["quantity"]["hidden"] = true;
 | 
					      fields["quantity"]["hidden"] = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Old API does not support these fields
 | 
				
			||||||
 | 
					    if (!api.supportsStockAdjustExtraFields) {
 | 
				
			||||||
 | 
					      fields.remove("packaging");
 | 
				
			||||||
 | 
					      fields.remove("status");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    launchApiForm(
 | 
					    launchApiForm(
 | 
				
			||||||
        context,
 | 
					        context,
 | 
				
			||||||
        L10().transferStock,
 | 
					        L10().transferStock,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user