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: typerror on multi select dialog (backport #39116) #39123

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions erpnext/public/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,16 +759,20 @@ erpnext.utils.map_current_doc = function(opts) {
}

if (opts.source_doctype) {
let data_fields = [];
if(opts.source_doctype == "Purchase Receipt") {
data_fields.push({
fieldname: 'merge_taxes',
fieldtype: 'Check',
label: __('Merge taxes from multiple documents'),
});
}
const d = new frappe.ui.form.MultiSelectDialog({
doctype: opts.source_doctype,
target: opts.target,
date_field: opts.date_field || undefined,
setters: opts.setters,
data_fields: [{
fieldname: 'merge_taxes',
fieldtype: 'Check',
label: __('Merge taxes from multiple documents'),
}],
data_fields: data_fields,
get_query: opts.get_query,
add_filters_group: 1,
allow_child_item_selection: opts.allow_child_item_selection,
Expand All @@ -782,7 +786,10 @@ erpnext.utils.map_current_doc = function(opts) {
return;
}
opts.source_name = values;
opts.args = args;
if (opts.allow_child_item_selection || opts.source_doctype == "Purchase Receipt") {
// args contains filtered child docnames
opts.args = args;
}
d.dialog.hide();
_map();
},
Expand Down
Loading