mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 19:45:46 +00:00
First pass at 'order parts' fom
- Select parts in modal form window
This commit is contained in:
@ -339,7 +339,7 @@ class Part(models.Model):
|
||||
"""
|
||||
|
||||
if self.default_supplier:
|
||||
return self.default_suppliers
|
||||
return self.default_supplier
|
||||
|
||||
if self.supplier_count == 1:
|
||||
return self.supplier_parts.first()
|
||||
@ -410,6 +410,13 @@ class Part(models.Model):
|
||||
|
||||
return max(total, 0)
|
||||
|
||||
@property
|
||||
def quantity_to_order(self):
|
||||
""" Return the quantity needing to be ordered for this part. """
|
||||
|
||||
required = -1 * self.net_stock
|
||||
return max(required, 0)
|
||||
|
||||
@property
|
||||
def net_stock(self):
|
||||
""" Return the 'net' stock. It takes into account:
|
||||
|
Reference in New Issue
Block a user