chore: add Reserve Stock
check field in Sales Order
This commit is contained in:
parent
1b7fb6d7e7
commit
0700063379
@ -46,6 +46,18 @@ frappe.ui.form.on("Sales Order", {
|
|||||||
|
|
||||||
frm.set_df_property('packed_items', 'cannot_add_rows', true);
|
frm.set_df_property('packed_items', 'cannot_add_rows', true);
|
||||||
frm.set_df_property('packed_items', 'cannot_delete_rows', true);
|
frm.set_df_property('packed_items', 'cannot_delete_rows', true);
|
||||||
|
|
||||||
|
frappe.db.get_single_value("Stock Settings", "enable_stock_reservation").then((value) => {
|
||||||
|
if (value) {
|
||||||
|
frappe.db.get_single_value("Stock Settings", "reserve_stock_on_sales_order_submission").then((value) => {
|
||||||
|
if (value) {
|
||||||
|
frm.set_value("reserve_stock", 1);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
frm.set_df_property("reserve_stock", "read_only", 1);
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if(frm.doc.docstatus === 1 && frm.doc.status !== 'Closed'
|
if(frm.doc.docstatus === 1 && frm.doc.status !== 'Closed'
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
"scan_barcode",
|
"scan_barcode",
|
||||||
"column_break_28",
|
"column_break_28",
|
||||||
"set_warehouse",
|
"set_warehouse",
|
||||||
|
"reserve_stock",
|
||||||
"items_section",
|
"items_section",
|
||||||
"items",
|
"items",
|
||||||
"section_break_31",
|
"section_break_31",
|
||||||
@ -1637,13 +1638,20 @@
|
|||||||
"fieldname": "named_place",
|
"fieldname": "named_place",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Named Place"
|
"label": "Named Place"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "reserve_stock",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Reserve Stock",
|
||||||
|
"no_copy": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 105,
|
"idx": 105,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-12-12 18:34:00.681780",
|
"modified": "2023-03-20 23:51:04.036757",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order",
|
"name": "Sales Order",
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"item_code",
|
"item_code",
|
||||||
"customer_item_code",
|
"customer_item_code",
|
||||||
"ensure_delivery_based_on_produced_serial_no",
|
"ensure_delivery_based_on_produced_serial_no",
|
||||||
|
"reserve_stock",
|
||||||
"col_break1",
|
"col_break1",
|
||||||
"delivery_date",
|
"delivery_date",
|
||||||
"item_name",
|
"item_name",
|
||||||
@ -859,12 +860,19 @@
|
|||||||
"fieldname": "material_request_item",
|
"fieldname": "material_request_item",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Material Request Item"
|
"label": "Material Request Item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"depends_on": "eval: parent.reserve_stock",
|
||||||
|
"fieldname": "reserve_stock",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Reserve Stock"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-12-25 02:51:10.247569",
|
"modified": "2023-03-20 23:43:15.099790",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order Item",
|
"name": "Sales Order Item",
|
||||||
|
Loading…
Reference in New Issue
Block a user