2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

Virtual part fix (#3265)

* Add 'virtual': False requirement to sales order items

* Adds "virtual" filter for part table

* Adds extra validation to the SalesOrderLineItem model

* Prevent creation of stock items for virtual parts

- Add validation check to clean() method of StockItem model
- Improve validation message for StockItemSerializer class

* Hide "new stock item" button for virtual parts

* Hide more buttons for 'virtual' parts
This commit is contained in:
Oliver
2022-06-28 13:39:27 +10:00
committed by GitHub
parent b63ba4b636
commit 8f92fddd2d
7 changed files with 110 additions and 30 deletions

View File

@ -429,19 +429,27 @@ function getAvailableTableFilters(tableKey) {
title: '{% trans "Include subcategories" %}',
description: '{% trans "Include parts in subcategories" %}',
},
has_ipn: {
type: 'bool',
title: '{% trans "Has IPN" %}',
description: '{% trans "Part has internal part number" %}',
},
active: {
type: 'bool',
title: '{% trans "Active" %}',
description: '{% trans "Show active parts" %}',
},
is_template: {
assembly: {
type: 'bool',
title: '{% trans "Template" %}',
title: '{% trans "Assembly" %}',
},
unallocated_stock: {
type: 'bool',
title: '{% trans "Available stock" %}',
},
component: {
type: 'bool',
title: '{% trans "Component" %}',
},
has_ipn: {
type: 'bool',
title: '{% trans "Has IPN" %}',
description: '{% trans "Part has internal part number" %}',
},
has_stock: {
type: 'bool',
@ -451,34 +459,30 @@ function getAvailableTableFilters(tableKey) {
type: 'bool',
title: '{% trans "Low stock" %}',
},
unallocated_stock: {
purchaseable: {
type: 'bool',
title: '{% trans "Available stock" %}',
},
assembly: {
type: 'bool',
title: '{% trans "Assembly" %}',
},
component: {
type: 'bool',
title: '{% trans "Component" %}',
},
starred: {
type: 'bool',
title: '{% trans "Subscribed" %}',
title: '{% trans "Purchasable" %}',
},
salable: {
type: 'bool',
title: '{% trans "Salable" %}',
},
starred: {
type: 'bool',
title: '{% trans "Subscribed" %}',
},
is_template: {
type: 'bool',
title: '{% trans "Template" %}',
},
trackable: {
type: 'bool',
title: '{% trans "Trackable" %}',
},
purchaseable: {
virtual: {
type: 'bool',
title: '{% trans "Purchasable" %}',
},
title: '{% trans "Virtual" %}',
}
};
}