mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 13:39:18 +00:00
fix(ui): hide "Update Items" button based on subcontracting conditions
This commit is contained in:
@@ -157,14 +157,17 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends e
|
|||||||
|
|
||||||
if(!in_list(["Closed", "Delivered"], doc.status)) {
|
if(!in_list(["Closed", "Delivered"], doc.status)) {
|
||||||
if(this.frm.doc.status !== 'Closed' && flt(this.frm.doc.per_received) < 100 && flt(this.frm.doc.per_billed) < 100) {
|
if(this.frm.doc.status !== 'Closed' && flt(this.frm.doc.per_received) < 100 && flt(this.frm.doc.per_billed) < 100) {
|
||||||
this.frm.add_custom_button(__('Update Items'), () => {
|
// Don't add Update Items button if the PO is following the new subcontracting flow.
|
||||||
erpnext.utils.update_child_items({
|
if (!(this.frm.doc.is_subcontracted && !this.frm.doc.is_old_subcontracting_flow)) {
|
||||||
frm: this.frm,
|
this.frm.add_custom_button(__('Update Items'), () => {
|
||||||
child_docname: "items",
|
erpnext.utils.update_child_items({
|
||||||
child_doctype: "Purchase Order Detail",
|
frm: this.frm,
|
||||||
cannot_add_row: false,
|
child_docname: "items",
|
||||||
})
|
child_doctype: "Purchase Order Detail",
|
||||||
});
|
cannot_add_row: false,
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.frm.has_perm("submit")) {
|
if (this.frm.has_perm("submit")) {
|
||||||
if(flt(doc.per_billed, 6) < 100 || flt(doc.per_received, 6) < 100) {
|
if(flt(doc.per_billed, 6) < 100 || flt(doc.per_received, 6) < 100) {
|
||||||
|
|||||||
Reference in New Issue
Block a user