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: Item qty gets reset to default on adding items using Add Multiple button #12244

Merged
merged 2 commits into from Feb 4, 2021
Merged
Changes from 1 commit
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
10 changes: 7 additions & 3 deletions frappe/public/js/frappe/form/link_selector.js
Expand Up @@ -152,9 +152,13 @@ frappe.ui.form.LinkSelector = Class.extend({
d = me.target.add_new_row();
},
() => frappe.timeout(0.1),
() => frappe.model.set_value(d.doctype, d.name, me.fieldname, value),
() => frappe.timeout(0.5),
() => frappe.model.set_value(d.doctype, d.name, me.qty_fieldname, data.qty),
() => {
var args = {};
args[me.fieldname] = value;
args[me.qty_fieldname] = data.qty;

frappe.model.set_value(d.doctype, d.name, args);
Anuja-pawar marked this conversation as resolved.
Show resolved Hide resolved
},
() => frappe.show_alert(__("Added {0} ({1})", [value, data.qty]))
]);
}
Expand Down