File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
erpnext/manufacturing/doctype/bom Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -488,7 +488,9 @@ def get_rm_rate(self, arg):
488488 if not frappe .db .get_value ("Item" , arg ["item_code" ], "is_customer_provided_item" ) and not arg .get (
489489 "sourced_by_supplier"
490490 ):
491- if arg .get ("bom_no" ) and self .set_rate_of_sub_assembly_item_based_on_bom :
491+ if arg .get ("bom_no" ) and (
492+ self .set_rate_of_sub_assembly_item_based_on_bom or arg .get ("is_phantom_item" )
493+ ):
492494 rate = flt (self .get_bom_unitcost (arg ["bom_no" ])) * (arg .get ("conversion_factor" ) or 1 )
493495 else :
494496 rate = get_bom_item_rate (arg , self )
@@ -889,7 +891,7 @@ def calculate_rm_cost(self, save=False):
889891
890892 for d in self .get ("items" ):
891893 old_rate = d .rate
892- if not self .bom_creator and d .is_stock_item :
894+ if not self .bom_creator and ( d .is_stock_item or d . is_phantom_item ) :
893895 d .rate = self .get_rm_rate (
894896 {
895897 "company" : self .company ,
@@ -900,6 +902,7 @@ def calculate_rm_cost(self, save=False):
900902 "stock_uom" : d .stock_uom ,
901903 "conversion_factor" : d .conversion_factor ,
902904 "sourced_by_supplier" : d .sourced_by_supplier ,
905+ "is_phantom_item" : d .is_phantom_item ,
903906 }
904907 )
905908
You can’t perform that action at this time.
0 commit comments