Merge pull request #21401 from rohitwaghchaure/fixed-taget-warehouse-mandatory-issue
fix: make target warehouse field mandatory while saving the work order
This commit is contained in:
commit
55102f455f
@ -346,6 +346,7 @@ class ProductionPlan(Document):
|
|||||||
if not wo.fg_warehouse:
|
if not wo.fg_warehouse:
|
||||||
wo.fg_warehouse = warehouse.get('fg_warehouse')
|
wo.fg_warehouse = warehouse.get('fg_warehouse')
|
||||||
try:
|
try:
|
||||||
|
wo.flags.ignore_mandatory = True
|
||||||
wo.insert()
|
wo.insert()
|
||||||
return wo.name
|
return wo.name
|
||||||
except OverProductionError:
|
except OverProductionError:
|
||||||
|
@ -313,7 +313,7 @@ frappe.ui.form.on("Work Order", {
|
|||||||
"Work in Progress": "progress-bar-warning",
|
"Work in Progress": "progress-bar-warning",
|
||||||
"Completed": "progress-bar-success"
|
"Completed": "progress-bar-success"
|
||||||
};
|
};
|
||||||
|
|
||||||
let bars = [];
|
let bars = [];
|
||||||
let message = '';
|
let message = '';
|
||||||
let title = '';
|
let title = '';
|
||||||
@ -404,7 +404,6 @@ frappe.ui.form.on("Work Order", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
before_submit: function(frm) {
|
before_submit: function(frm) {
|
||||||
frm.toggle_reqd(["fg_warehouse", "wip_warehouse"], true);
|
|
||||||
frm.fields_dict.required_items.grid.toggle_reqd("source_warehouse", true);
|
frm.fields_dict.required_items.grid.toggle_reqd("source_warehouse", true);
|
||||||
frm.toggle_reqd("transfer_material_against",
|
frm.toggle_reqd("transfer_material_against",
|
||||||
frm.doc.operations && frm.doc.operations.length > 0);
|
frm.doc.operations && frm.doc.operations.length > 0);
|
||||||
|
@ -231,6 +231,7 @@
|
|||||||
"fieldname": "wip_warehouse",
|
"fieldname": "wip_warehouse",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Work-in-Progress Warehouse",
|
"label": "Work-in-Progress Warehouse",
|
||||||
|
"mandatory_depends_on": "eval:!doc.skip_transfer || doc.from_wip_warehouse",
|
||||||
"options": "Warehouse"
|
"options": "Warehouse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -238,7 +239,8 @@
|
|||||||
"fieldname": "fg_warehouse",
|
"fieldname": "fg_warehouse",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Target Warehouse",
|
"label": "Target Warehouse",
|
||||||
"options": "Warehouse"
|
"options": "Warehouse",
|
||||||
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_12",
|
"fieldname": "column_break_12",
|
||||||
@ -481,7 +483,7 @@
|
|||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-01-31 12:46:23.636033",
|
"modified": "2020-04-24 19:32:43.323054",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Work Order",
|
"name": "Work Order",
|
||||||
|
Loading…
Reference in New Issue
Block a user