From e9683fad47a61861ce542c92632a9d28afe0744d Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 16 Sep 2021 15:52:43 +0530 Subject: [PATCH] fix(ProdPlan): Get SubAssy Items does not work (bp #27537) * fix(ProdPlan): Get SubAssy Items does not work This button wasn't working unless the document was saved already. * fix: make form dirty when subassy item are fetched (cherry picked from commit 78fe92542cb3ee781ba8103f3a5f1e982f29ce10) Co-authored-by: Ankush Menat --- .../manufacturing/doctype/production_plan/production_plan.js | 2 ++ .../manufacturing/doctype/production_plan/production_plan.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 4343e8a24eb..6f81c17adb1 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -242,6 +242,8 @@ frappe.ui.form.on('Production Plan', { }, get_sub_assembly_items: function(frm) { + frm.dirty(); + frappe.call({ method: "get_sub_assembly_items", freeze: true, diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index a28fc7abf0e..18284e0199e 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -561,8 +561,6 @@ class ProductionPlan(Document): get_sub_assembly_items(row.bom_no, bom_data, row.planned_qty) self.set_sub_assembly_items_based_on_level(row, bom_data, manufacturing_type) - self.save() - def set_sub_assembly_items_based_on_level(self, row, bom_data, manufacturing_type=None): bom_data = sorted(bom_data, key = lambda i: i.bom_level)