Skip to content

Commit

Permalink
fix: unecessary keyword args were passed in mapper functions (frappe#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Sep 17, 2021
1 parent d49346a commit e03d9aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions erpnext/public/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,15 @@ erpnext.utils.map_current_doc = function(opts) {
child_columns: opts.child_columns,
action: function(selections, args) {
let values = selections;
if(values.length === 0){
if (values.length === 0) {
frappe.msgprint(__("Please select {0}", [opts.source_doctype]))
return;
}
opts.source_name = values;
opts.args = args;
if (opts.allow_child_item_selection) {
// args contains filtered child docnames
opts.args = args;
}
d.dialog.hide();
_map();
},
Expand Down
5 changes: 3 additions & 2 deletions erpnext/stock/doctype/material_request/material_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ def update_status(name, status):
material_request.update_status(status)

@frappe.whitelist()
def make_purchase_order(source_name, target_doc=None, args={}):

def make_purchase_order(source_name, target_doc=None, args=None):
if args is None:
args = {}
if isinstance(args, string_types):
args = json.loads(args)

Expand Down

0 comments on commit e03d9aa

Please sign in to comment.