Co-authored-by: Omar Younis <oimyounis@gmail.com>
This commit is contained in:
parent
fe7b0719cd
commit
ba094e76d1
1 changed files with 14 additions and 0 deletions
|
|
@ -46,6 +46,20 @@ $.extend(frappe, {
|
|||
hide_message: function() {
|
||||
$('.message-overlay').remove();
|
||||
},
|
||||
xcall: function(method, params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
frappe.call({
|
||||
method: method,
|
||||
args: params,
|
||||
callback: (r) => {
|
||||
resolve(r.message);
|
||||
},
|
||||
error: (r) => {
|
||||
reject(r.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
call: function(opts) {
|
||||
// opts = {"method": "PYTHON MODULE STRING", "args": {}, "callback": function(r) {}}
|
||||
if (typeof arguments[0]==='string') {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue