Skip to content

Commit

Permalink
Merge pull request #39123 from frappe/mergify/bp/version-14/pr-39116
Browse files Browse the repository at this point in the history
fix: typerror on multi select dialog (backport #39116)
  • Loading branch information
ruthra-kumar authored Jan 3, 2024
2 parents b6a3627 + 43cc7e4 commit 6ca29a9
Showing 1 changed file with 13 additions and 6 deletions.
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

0 comments on commit 6ca29a9

Please sign in to comment.