diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 460f1c3debc..057c78a81f1 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -65,7 +65,7 @@ frappe.ui.form.on("Item", { frm.page.set_inner_btn_group_as_primary(__("Make")); } if (frm.doc.variant_of) { - frm.set_intro(__("This Item is a Variant of {0} (Template). Attributes will be copied over from the template unless 'No Copy' is set", + frm.set_intro(__("This Item is a Variant of {0} (Template).", [frm.doc.variant_of]), true); } @@ -97,8 +97,6 @@ frappe.ui.form.on("Item", { } frappe.set_route('Form', 'Item', new_item.name); }); - - frm.trigger('make_variant_fields_read_only'); }, validate: function(frm){ @@ -109,16 +107,6 @@ frappe.ui.form.on("Item", { refresh_field("image_view"); }, - make_variant_fields_read_only: function(frm) { - if(frm.doc.variant_of) { - frm.meta.fields.forEach(function(df) { - if (!df.no_copy) { - frm.toggle_enable(df.fieldname, false); - } - }); - } - }, - is_fixed_asset: function(frm) { if (frm.doc.is_fixed_asset) { frm.set_value("is_stock_item", 0); diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ef85dd9a680..3b8f6e4ac78 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -86,7 +86,6 @@ class Item(WebsiteGenerator): self.validate_has_variants() self.validate_attributes() self.validate_variant_attributes() - self.copy_variant_attributes() self.validate_website_image() self.make_thumbnail() self.validate_fixed_asset() @@ -673,12 +672,6 @@ class Item(WebsiteGenerator): validate_item_variant_attributes(self, args) - def copy_variant_attributes(self): - '''Copy attributes from template (if they have been changed before saving)''' - if self.variant_of: - template = frappe.get_doc('Item', self.variant_of) - copy_attributes_to_variant(template, self) - def get_timeline_data(doctype, name): '''returns timeline data based on stock ledger entry''' out = {}