fix(ux): make PI Item rate field readonly based on Maintain Same Rate
This commit is contained in:
parent
eb5bb9f9a9
commit
cb9114442b
@ -163,6 +163,18 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, __("Get Items From"));
|
}, __("Get Items From"));
|
||||||
|
|
||||||
|
if (!this.frm.doc.is_return) {
|
||||||
|
frappe.db.get_single_value("Buying Settings", "maintain_same_rate").then((value) => {
|
||||||
|
if (value) {
|
||||||
|
this.frm.doc.items.forEach((item) => {
|
||||||
|
this.frm.fields_dict.items.grid.update_docfield_property(
|
||||||
|
"rate", "read_only", (item.purchase_receipt && item.pr_detail)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted);
|
this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user