Merge pull request #38450 from s-aga-r/FIX-38151
fix(ux): make valuation field read only when it can't be modified
This commit is contained in:
commit
832734ff4c
@ -288,6 +288,7 @@
|
|||||||
"oldfieldname": "import_rate",
|
"oldfieldname": "import_rate",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "currency",
|
"options": "currency",
|
||||||
|
"read_only_depends_on": "eval: (!parent.is_return && doc.purchase_receipt && doc.pr_detail)",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -918,7 +919,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-11-14 18:33:48.547297",
|
"modified": "2023-11-30 16:26:05.629780",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice Item",
|
"name": "Purchase Invoice Item",
|
||||||
|
@ -359,6 +359,7 @@
|
|||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "currency",
|
"options": "currency",
|
||||||
"print_width": "100px",
|
"print_width": "100px",
|
||||||
|
"read_only_depends_on": "eval: (!parent.is_return && doc.purchase_order && doc.purchase_order_item)",
|
||||||
"width": "100px"
|
"width": "100px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1103,7 +1104,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-11-28 13:37:29.245204",
|
"modified": "2023-11-30 16:12:02.364608",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt Item",
|
"name": "Purchase Receipt Item",
|
||||||
|
@ -258,7 +258,7 @@ frappe.ui.form.on('Stock Entry', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frm.doc.docstatus===0) {
|
if (frm.doc.docstatus === 0) {
|
||||||
frm.add_custom_button(__('Purchase Invoice'), function() {
|
frm.add_custom_button(__('Purchase Invoice'), function() {
|
||||||
erpnext.utils.map_current_doc({
|
erpnext.utils.map_current_doc({
|
||||||
method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_stock_entry",
|
method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_stock_entry",
|
||||||
@ -311,7 +311,8 @@ frappe.ui.form.on('Stock Entry', {
|
|||||||
})
|
})
|
||||||
}, __("Get Items From"));
|
}, __("Get Items From"));
|
||||||
}
|
}
|
||||||
if (frm.doc.docstatus===0 && frm.doc.purpose == "Material Issue") {
|
|
||||||
|
if (frm.doc.docstatus === 0 && frm.doc.purpose == "Material Issue") {
|
||||||
frm.add_custom_button(__('Expired Batches'), function() {
|
frm.add_custom_button(__('Expired Batches'), function() {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.stock.doctype.stock_entry.stock_entry.get_expired_batch_items",
|
method: "erpnext.stock.doctype.stock_entry.stock_entry.get_expired_batch_items",
|
||||||
@ -397,6 +398,10 @@ frappe.ui.form.on('Stock Entry', {
|
|||||||
frm.remove_custom_button('Bill of Materials', "Get Items From");
|
frm.remove_custom_button('Bill of Materials', "Get Items From");
|
||||||
frm.events.show_bom_custom_button(frm);
|
frm.events.show_bom_custom_button(frm);
|
||||||
frm.trigger('add_to_transit');
|
frm.trigger('add_to_transit');
|
||||||
|
|
||||||
|
frm.fields_dict.items.grid.update_docfield_property(
|
||||||
|
'basic_rate', 'read_only', frm.doc.purpose == "Material Receipt" ? 0 : 1
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
purpose: function(frm) {
|
purpose: function(frm) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user