chore: Commonify autofilling warehouses in child tables

This commit is contained in:
marination
2020-04-23 00:18:21 +05:30
parent eaa956b994
commit 8a30cb2565
6 changed files with 29 additions and 56 deletions

View File

@@ -253,6 +253,13 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
}
},
rejected_warehouse: function(doc, cdt) {
// trigger autofill_warehouse only if parent rejected_warehouse field is triggered
if (["Purchase Invoice", "Purchase Receipt"].includes(cdt)) {
this.autofill_warehouse(doc.items, "rejected_warehouse", doc.rejected_warehouse);
}
},
category: function(doc, cdt, cdn) {
// should be the category field of tax table
if(cdt != doc.doctype) {