|
|
@ -382,8 +382,10 @@ class WorkOrder(Document): |
|
|
|
|
|
|
|
prod_plan = frappe.get_doc('Production Plan', self.production_plan) |
|
|
|
pp_ref = prod_plan.prod_plan_ref |
|
|
|
pp_item = frappe.get_doc('Production Plan Item', self.production_plan_item) |
|
|
|
item_ref = pp_item.item_reference |
|
|
|
for p in pp_ref: |
|
|
|
if p.item_ref == self.production_plan_item: |
|
|
|
if p.item_ref == item_ref: |
|
|
|
work_order_qty = int(p.qty) if not cancel else 0 |
|
|
|
frappe.db.set_value('Sales Order Item', |
|
|
|
p.sales_order_item, 'work_order_qty', flt(work_order_qty/total_bundle_qty, 2)) |
|
|
|