Merge branch 'develop' into item_code_showing_as_mandatory_issue_develop
diff --git a/erpnext/public/js/utils/item_quick_entry.js b/erpnext/public/js/utils/item_quick_entry.js
index 2947d5b..27ef107 100644
--- a/erpnext/public/js/utils/item_quick_entry.js
+++ b/erpnext/public/js/utils/item_quick_entry.js
@@ -8,12 +8,19 @@
render_dialog: function() {
this.mandatory = this.get_variant_fields().concat(this.mandatory);
this.mandatory = this.mandatory.concat(this.get_attributes_fields());
+ this.check_naming_series_based_on();
this._super();
this.init_post_render_dialog_operations();
this.preset_fields_for_template();
this.dialog.$wrapper.find('.edit-full').text(__('Edit in full page for more options like assets, serial nos, batches etc.'))
},
+ check_naming_series_based_on: function() {
+ if (frappe.defaults.get_default("item_naming_by") === "Naming Series") {
+ this.mandatory = this.mandatory.filter(d => d.fieldname !== "item_code");
+ }
+ },
+
init_post_render_dialog_operations: function() {
this.dialog.fields_dict.attribute_html.$wrapper.append(frappe.render_template("item_quick_entry"));
this.init_for_create_variant_trigger();