Merge pull request #32877 from s-aga-r/fix/ux/scr/supplied-items/consumed-qty
fix: make `consumed_qty` read-only in SCR Supplied Items
This commit is contained in:
commit
b5d64bc7c5
@ -100,9 +100,7 @@ def get_default_holiday_list():
|
||||
|
||||
def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime):
|
||||
if from_datetime and to_datetime:
|
||||
if not cint(
|
||||
frappe.db.get_value("Manufacturing Settings", None, "allow_production_on_holidays")
|
||||
):
|
||||
if not frappe.db.get_single_value("Manufacturing Settings", "allow_production_on_holidays"):
|
||||
check_workstation_for_holiday(workstation, from_datetime, to_datetime)
|
||||
|
||||
if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")):
|
||||
|
||||
@ -57,6 +57,18 @@ frappe.ui.form.on('Subcontracting Receipt', {
|
||||
filters: { 'company': frm.doc.company }
|
||||
};
|
||||
});
|
||||
|
||||
frappe.db.get_single_value('Buying Settings', 'backflush_raw_materials_of_subcontract_based_on').then(val => {
|
||||
if (val == 'Material Transferred for Subcontract') {
|
||||
frm.fields_dict['supplied_items'].grid.grid_rows.forEach((grid_row) => {
|
||||
grid_row.docfields.forEach((df) => {
|
||||
if (df.fieldname == 'consumed_qty') {
|
||||
df.read_only = 0;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
refresh: (frm) => {
|
||||
|
||||
@ -86,6 +86,7 @@
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Consumed Qty",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
@ -193,7 +194,7 @@
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2022-09-02 22:28:53.392381",
|
||||
"modified": "2022-11-07 17:17:21.670761",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Subcontracting",
|
||||
"name": "Subcontracting Receipt Supplied Item",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user