Make pricing rule from Supplier and Customer Doc (#15533)

* Make pricing rule from Supplier and Customer Doc

* Make sure the "+" button also works the same way as the "Make" button
This commit is contained in:
Saif
2018-09-30 21:46:31 +05:00
committed by Rushabh Mehta
parent 6ecb2556b7
commit 90cf2ddc01
7 changed files with 52 additions and 0 deletions

View File

@@ -173,6 +173,20 @@ $.extend(erpnext.utils, {
})
},
make_pricing_rule: function(doctype, docname) {
frappe.call({
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.make_pricing_rule",
args: {
doctype: doctype,
docname: docname
},
callback: function(r) {
var doclist = frappe.model.sync(r.message);
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
})
},
/**
* Checks if the first row of a given child table is empty
* @param child_table - Child table Doctype