Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ux): item description should fall back to item name #26339

Merged
merged 2 commits into from
Jul 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions erpnext/stock/doctype/item/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ frappe.ui.form.on("Item", {

frm.add_custom_button(__('Duplicate'), function() {
var new_item = frappe.model.copy_doc(frm.doc);
if(new_item.item_name===new_item.item_code) {
// Duplicate item could have different name, causing "copy paste" error.
if (new_item.item_name===new_item.item_code) {
new_item.item_name = null;
}
if(new_item.description===new_item.description) {
if (new_item.item_code===new_item.description || new_item.item_code===new_item.description) {
new_item.description = null;
}
frappe.set_route('Form', 'Item', new_item.name);
Expand Down Expand Up @@ -186,8 +187,6 @@ frappe.ui.form.on("Item", {
item_code: function(frm) {
if(!frm.doc.item_name)
frm.set_value("item_name", frm.doc.item_code);
if(!frm.doc.description)
frm.set_value("description", frm.doc.item_code);
},

is_stock_item: function(frm) {
Expand Down