feat: Added popup to 'Get Items from Open Material Requests' in Purchase Order (#20371)

* feat: Added popup to 'Get Items from Open Material Requests' in Purchase Order

* fix: Query with filters, UX enhancements and cleanup
This commit is contained in:
Marica
2020-02-17 15:58:08 +05:30
committed by GitHub
parent f5b74d2aee
commit db00270895
4 changed files with 75 additions and 38 deletions

View File

@@ -514,9 +514,18 @@ erpnext.utils.update_child_items = function(opts) {
}
erpnext.utils.map_current_doc = function(opts) {
if(opts.get_query_filters) {
opts.get_query = function() {
return {filters: opts.get_query_filters};
let query_args = {};
if (opts.get_query_filters) {
query_args.filters = opts.get_query_filters;
}
if (opts.get_query_method) {
query_args.query = opts.get_query_method;
}
if (query_args.filters || query_args.query) {
opts.get_query = () => {
return query_args;
}
}
var _map = function() {
@@ -582,7 +591,7 @@ erpnext.utils.map_current_doc = function(opts) {
"method": opts.method,
"source_names": opts.source_name,
"target_doc": cur_frm.doc,
'args': opts.args
"args": opts.args
},
callback: function(r) {
if(!r.exc) {