2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-09 21:30:54 +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

@@ -14,7 +14,7 @@
<h4>{% trans "Supplier Parts" %}</h4>
{% include "spacer.html" %}
<div class='btn-group' role='group'>
{% if roles.purchase_order.add %}
{% if roles.purchase_order.add and not part.virtual %}
<button class="btn btn-success" id='supplier-part-create' title='{% trans "Create new supplier part" %}'>
<span class='fas fa-plus-circle'></span> {% trans "New Supplier Part" %}
</button>
@@ -61,7 +61,7 @@
<h4>{% trans "Manufacturer Parts" %}</h4>
{% include "spacer.html" %}
<div class='btn-group' role='group'>
{% if roles.purchase_order.add %}
{% if roles.purchase_order.add and not part.virtual %}
<button type="button" class="btn btn-success" id='manufacturer-part-create' title='{% trans "Create new manufacturer part" %}'>
<span class='fas fa-plus-circle'></span> {% trans "New Manufacturer Part" %}
</button>