Update rate in exploded_items on click of update cost btton
This commit is contained in:
parent
2cc585f180
commit
57a5c71663
@ -124,11 +124,17 @@ class BOM(Document):
|
||||
if self.docstatus == 2:
|
||||
return
|
||||
|
||||
items_rate = frappe._dict()
|
||||
for d in self.get("items"):
|
||||
rate = self.get_bom_material_detail({'item_code': d.item_code, 'bom_no': d.bom_no,
|
||||
'qty': d.qty})["rate"]
|
||||
if rate:
|
||||
d.rate = rate
|
||||
items_rate.setdefault(d.item_code, d.rate)
|
||||
|
||||
for e in self.get("exploded_items"):
|
||||
if items_rate.get(e.item_code):
|
||||
e.rate = items_rate.get(e.item_code)
|
||||
|
||||
if self.docstatus == 1:
|
||||
self.flags.ignore_validate_update_after_submit = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user