Prices of the variant item does not appear in the BOM

Even though I have made the “Price list” of “Template Item”, when I add another variant item to BOM, its rate doesn’t show up.
Should I make price list for variant items to be showed up its rate automatically?

Hi,
Yes.if you showed up rate automatically then should make Item price for “Variant” item
For “Variant” item you create “Item Price”
In BOM, select “Rate Of Materials Based On”=Price List
Price List= Standard Buying Or Selling

‘Materials’ table grid:-
Select that Variant item ,Its rate will automatically fetch from Defined “Item Price”.

1 Like

Thank you reply.

These settings are already done.
Active item displays the price, but Valiant item is not displayed.
Template item is already set the price.

The Valiant item price has been displayed in the purchase order.

I tried to read the source code of the BOM.
I think variant item is not getting the rate from the template price list.

If it is correct my thinking, please let me know how to fix.

Hi,
Item Price get created for both Item i.e Template Item and Its Variant Item

For Purchasing ,you select "Standard Buying
For Selling , you select "Standard Selling

you can create two Item price for same Variant item
One for Buying and One for Selling
if you made Item Price by keeping “Standard Buying”
then its effect goes into Purchase Order,Purchase Invoice

if you made Item Price by keeping “Standard Selling”
then its effect goes into Sales Order,Sales Invoice

Thank you very much for your prompt reply and great advice.

I am to understand that you have explained to me.

Scenarios that I can not understand is as follows.

  1. Create a template items in the “Standard Buying”, then made item price.
  2. Create a variant items derived from this template item.
    item price is not make in this variant item.
  3. Select the variant item in the purchase order.
    At this time, purchase order is retrieve and display the price from the template item.
    This behavior is great.
  4. Add then the same variant items in BOM.
    This time Division price will not be displayed. Of course, “Rate Of Materials Based On” is the “Price List”.

BOM should also get the price from the template item.

Is this not a bug?

Hi,

I solved this problem by adding the following temporary code.
I do not want to make modifications to the original source code.
If possible I want you to formally fix this problem.

bom.py

indent preformatted text by 4 spaces

def get_rm_rate(self, arg):
	"""	Get raw material rate as per selected method, if bom exists takes bom cost """
	rate = 0
	if arg['bom_no']:
		rate = self.get_bom_unitcost(arg['bom_no'])
	elif arg and (arg['is_purchase_item'] == 1 or arg['is_sub_contracted_item'] == 1):
		if self.rm_cost_as_per == 'Valuation Rate':
			rate = self.get_valuation_rate(arg)
		elif self.rm_cost_as_per == 'Last Purchase Rate':
			rate = arg['last_purchase_rate']
		elif self.rm_cost_as_per == "Price List":
			if not self.buying_price_list:
				frappe.throw(_("Please select Price List"))
			rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list,
				"item_code": arg["item_code"]}, "price_list_rate") or 0
	""" ***** Added Code ***** """
			if not rate:
				variant_of = frappe.db.get_value("Item", arg["item_code"], "variant_of")
				rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list,
					"item_code": variant_of}, "price_list_rate") or 0
	""" ***** End ***** """
	return rate

Thank you for taking the time to answer my questions.