fix: show material to supplier button (backport #41686) (#41688)

fix: show material to supplier button (#41686)

(cherry picked from commit be9f960705)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-05-30 16:13:53 +05:30
committed by GitHub
parent 0a0970e0e7
commit 1a24914aed
2 changed files with 11 additions and 3 deletions

View File

@@ -235,9 +235,11 @@ erpnext.buying.SubcontractingOrderController = class SubcontractingOrderControll
}
has_unsupplied_items() {
return this.frm.doc["supplied_items"].some(
(item) => item.required_qty > item.supplied_qty - item.returned_qty
);
let over_transfer_allowance = this.frm.doc.__onload.over_transfer_allowance;
return this.frm.doc["supplied_items"].some((item) => {
let required_qty = item.required_qty + (item.required_qty * over_transfer_allowance) / 100;
return required_qty > item.supplied_qty - item.returned_qty;
});
}
make_subcontracting_receipt() {

View File

@@ -99,6 +99,12 @@ class SubcontractingOrder(SubcontractingController):
}
]
def onload(self):
self.set_onload(
"over_transfer_allowance",
frappe.db.get_single_value("Buying Settings", "over_transfer_allowance"),
)
def before_validate(self):
super().before_validate()