diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index 11ce46f518a7..67de6a0632b9 100644 --- a/erpnext/manufacturing/doctype/bom/bom.json +++ b/erpnext/manufacturing/doctype/bom/bom.json @@ -238,7 +238,7 @@ "fieldname": "rm_cost_as_per", "fieldtype": "Select", "label": "Rate Of Materials Based On", - "options": "Valuation Rate\nLast Purchase Rate\nPrice List\nManual" + "options": "Valuation Rate\nLast Purchase Rate\nPrice List" }, { "allow_on_submit": 1, @@ -637,7 +637,7 @@ "image_field": "image", "is_submittable": 1, "links": [], - "modified": "2024-03-27 13:06:40.214929", + "modified": "2024-04-02 16:22:47.518411", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index cb56172ca846..40b4c4f74552 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -147,7 +147,7 @@ class BOM(WebsiteGenerator): quality_inspection_template: DF.Link | None quantity: DF.Float raw_material_cost: DF.Currency - rm_cost_as_per: DF.Literal["Valuation Rate", "Last Purchase Rate", "Price List", "Manual"] + rm_cost_as_per: DF.Literal["Valuation Rate", "Last Purchase Rate", "Price List"] route: DF.SmallText | None routing: DF.Link | None scrap_items: DF.Table[BOMScrapItem] @@ -737,6 +737,7 @@ def update_rate_and_time(self, row, update_hour_rate=False): def calculate_rm_cost(self, save=False): """Fetch RM rate as per today's valuation rate and calculate totals""" + total_rm_cost = 0 base_total_rm_cost = 0 @@ -745,7 +746,7 @@ def calculate_rm_cost(self, save=False): continue old_rate = d.rate - if self.rm_cost_as_per != "Manual": + if not self.bom_creator: d.rate = self.get_rm_rate( { "company": self.company, @@ -1017,8 +1018,6 @@ def get_bom_item_rate(args, bom_doc): item_doc = frappe.get_cached_doc("Item", args.get("item_code")) price_list_data = get_price_list_rate(bom_args, item_doc) rate = price_list_data.price_list_rate - elif bom_doc.rm_cost_as_per == "Manual": - return return flt(rate) diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.json b/erpnext/manufacturing/doctype/bom_creator/bom_creator.json index de4d2540071f..1e8237c03f78 100644 --- a/erpnext/manufacturing/doctype/bom_creator/bom_creator.json +++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator.json @@ -66,7 +66,7 @@ "fieldname": "rm_cost_as_per", "fieldtype": "Select", "label": "Rate Of Materials Based On", - "options": "Valuation Rate\nLast Purchase Rate\nPrice List\nManual", + "options": "Valuation Rate\nLast Purchase Rate\nPrice List", "reqd": 1 }, { @@ -288,7 +288,7 @@ "link_fieldname": "bom_creator" } ], - "modified": "2024-03-27 13:06:40.535884", + "modified": "2024-04-02 16:30:59.779190", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Creator", diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py index 160b3bef39b2..0158f7c5b979 100644 --- a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py +++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py @@ -59,7 +59,7 @@ class BOMCreator(Document): qty: DF.Float raw_material_cost: DF.Currency remarks: DF.TextEditor | None - rm_cost_as_per: DF.Literal["Valuation Rate", "Last Purchase Rate", "Price List", "Manual"] + rm_cost_as_per: DF.Literal["Valuation Rate", "Last Purchase Rate", "Price List"] set_rate_based_on_warehouse: DF.Check status: DF.Literal["Draft", "Submitted", "In Progress", "Completed", "Failed", "Cancelled"] uom: DF.Link | None @@ -141,9 +141,6 @@ def add_boms(self): self.submit() def set_rate_for_items(self): - if self.rm_cost_as_per == "Manual": - return - amount = self.get_raw_material_cost() self.raw_material_cost = amount @@ -285,7 +282,6 @@ def create_bom(self, row, production_item_wise_rm): "allow_alternative_item": 1, "bom_creator": self.name, "bom_creator_item": bom_creator_item, - "rm_cost_as_per": "Manual", } )