diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index 50838736816..4ce8342af6e 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": "2023-12-26 19:34:08.159312", + "modified": "2024-04-02 16:22:47.518411", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", @@ -676,4 +676,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 8c4574ed90a..d544272e437 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -150,7 +150,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] @@ -742,6 +742,7 @@ class BOM(WebsiteGenerator): 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 @@ -750,7 +751,7 @@ class BOM(WebsiteGenerator): 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, @@ -1022,8 +1023,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 fb4c6c5c95a..9d2384e31a0 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": "2023-08-07 15:45:06.176313", + "modified": "2024-04-02 16:30:59.779190", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Creator", @@ -327,4 +327,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py index 3c4c863f1ce..d2f0c29fe63 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 @@ -143,9 +143,6 @@ class BOMCreator(Document): 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 @@ -286,7 +283,6 @@ class BOMCreator(Document): "allow_alternative_item": 1, "bom_creator": self.name, "bom_creator_item": bom_creator_item, - "rm_cost_as_per": "Manual", } )