mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 16:45:02 +00:00
fix: ordered_qty for production-plan-item
This commit is contained in:
@@ -449,7 +449,13 @@ class WorkOrder(Document):
|
||||
|
||||
def update_ordered_qty(self):
|
||||
if self.production_plan and self.production_plan_item:
|
||||
qty = self.qty if self.docstatus == 1 else 0
|
||||
qty = frappe.get_value("Production Plan Item", self.production_plan_item, "ordered_qty")
|
||||
|
||||
if self.docstatus == 1:
|
||||
qty += self.qty
|
||||
elif self.docstatus == 2:
|
||||
qty -= self.qty
|
||||
|
||||
frappe.db.set_value('Production Plan Item',
|
||||
self.production_plan_item, 'ordered_qty', qty)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user