Skip to content

Commit

Permalink
fix: typerror on multi select dialog
Browse files Browse the repository at this point in the history
(cherry picked from commit 7da9ffa)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Jan 3, 2024
1 parent 3eac0e9 commit 5ee6cc4
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 @@ -865,16 +865,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 @@ -888,7 +892,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 5ee6cc4

Please sign in to comment.