mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
fix: update scrap table item details; typo
This commit is contained in:
@@ -148,6 +148,7 @@ class BOM(WebsiteGenerator):
|
|||||||
self.set_plc_conversion_rate()
|
self.set_plc_conversion_rate()
|
||||||
self.validate_uom_is_interger()
|
self.validate_uom_is_interger()
|
||||||
self.set_bom_material_details()
|
self.set_bom_material_details()
|
||||||
|
self.set_bom_scrap_items_detail()
|
||||||
self.validate_materials()
|
self.validate_materials()
|
||||||
self.set_routing_operations()
|
self.set_routing_operations()
|
||||||
self.validate_operations()
|
self.validate_operations()
|
||||||
@@ -200,7 +201,7 @@ class BOM(WebsiteGenerator):
|
|||||||
|
|
||||||
def set_bom_material_details(self):
|
def set_bom_material_details(self):
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
self.validate_bom_currecny(item)
|
self.validate_bom_currency(item)
|
||||||
|
|
||||||
ret = self.get_bom_material_detail({
|
ret = self.get_bom_material_detail({
|
||||||
"company": self.company,
|
"company": self.company,
|
||||||
@@ -219,6 +220,19 @@ class BOM(WebsiteGenerator):
|
|||||||
if not item.get(r):
|
if not item.get(r):
|
||||||
item.set(r, ret[r])
|
item.set(r, ret[r])
|
||||||
|
|
||||||
|
def set_bom_scrap_items_detail(self):
|
||||||
|
for item in self.get("scrap_items"):
|
||||||
|
args = {
|
||||||
|
"item_code": item.item_code,
|
||||||
|
"company": self.company,
|
||||||
|
"scrap_items": True,
|
||||||
|
"bom_no": '',
|
||||||
|
}
|
||||||
|
ret = self.get_bom_material_detail(args)
|
||||||
|
for key, value in ret.items():
|
||||||
|
if not item.get(key):
|
||||||
|
item.set(key, value)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_bom_material_detail(self, args=None):
|
def get_bom_material_detail(self, args=None):
|
||||||
""" Get raw material details like uom, desc and rate"""
|
""" Get raw material details like uom, desc and rate"""
|
||||||
@@ -255,7 +269,7 @@ class BOM(WebsiteGenerator):
|
|||||||
|
|
||||||
return ret_item
|
return ret_item
|
||||||
|
|
||||||
def validate_bom_currecny(self, item):
|
def validate_bom_currency(self, item):
|
||||||
if item.get('bom_no') and frappe.db.get_value('BOM', item.get('bom_no'), 'currency') != self.currency:
|
if item.get('bom_no') and frappe.db.get_value('BOM', item.get('bom_no'), 'currency') != self.currency:
|
||||||
frappe.throw(_("Row {0}: Currency of the BOM #{1} should be equal to the selected currency {2}")
|
frappe.throw(_("Row {0}: Currency of the BOM #{1} should be equal to the selected currency {2}")
|
||||||
.format(item.idx, item.bom_no, self.currency))
|
.format(item.idx, item.bom_no, self.currency))
|
||||||
|
|||||||
Reference in New Issue
Block a user