diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index df90ad9f54..9ead5879ec 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -44,7 +44,7 @@ class Item(WebsiteGenerator): 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+'.#####') + self.item_code = make_autoname(self.naming_series+'.#####', doc=self) elif not self.item_code: msgprint(_("Item Code is mandatory because Item is not automatically numbered"), raise_exception=1)