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 78fe92542c)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
Frappe PR Bot
2021-09-16 15:52:43 +05:30
committed by GitHub
parent 5a34520f3f
commit e9683fad47
2 changed files with 2 additions and 2 deletions

View File

@@ -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,

View File

@@ -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)