Skip to content

Commit

Permalink
fix(ProdPlan): Get SubAssy Items does not work (frappe#27537)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ankush authored Sep 16, 2021
1 parent 866763c commit 78fe925
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,6 @@ def get_sub_assembly_items(self, manufacturing_type=None):
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)

Expand Down

0 comments on commit 78fe925

Please sign in to comment.