mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
fix(ux): make PI Item rate field readonly based on Maintain Same Rate
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user