[minor][fix] pass template item name to make_variant_item_code

This commit is contained in:
Saurabh 2017-06-20 20:13:54 +05:30
parent cd5dd890aa
commit 8d269beb45

View File

@ -37,7 +37,8 @@ class Item(WebsiteGenerator):
if frappe.db.get_default("item_naming_by")=="Naming Series":
if self.variant_of:
if not self.item_code:
self.item_code = make_variant_item_code(self.variant_of, self)
template_item_name = frappe.db.get_value("Item", self.variant_of, "item_name")
self.item_code = make_variant_item_code(self.variant_of, template_item_name, self)
else:
from frappe.model.naming import make_autoname
self.item_code = make_autoname(self.naming_series+'.#####')