mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 07:01:56 +00:00
fix: keep Target Warehouse optional for work orders tracking semi finished goods
The WIP warehouse change also removed the Target Warehouse exemption for semi FG orders, but those may validly carry the target on each operation instead. Restore the exemption in the form and the submit check; the WIP warehouse requirement stays.
This commit is contained in:
@@ -290,7 +290,8 @@ frappe.ui.form.on("Work Order", {
|
||||
},
|
||||
|
||||
set_fg_warehouse_mandatory(frm) {
|
||||
frm.toggle_reqd("fg_warehouse", frm.doc.skip_transfer !== 1);
|
||||
let mandatory = frm.doc.skip_transfer === 1 || frm.doc.track_semi_finished_goods === 1 ? false : true;
|
||||
frm.toggle_reqd("fg_warehouse", mandatory);
|
||||
},
|
||||
|
||||
add_custom_button_to_return_components: function (frm) {
|
||||
|
||||
@@ -603,7 +603,7 @@ class WorkOrder(Document):
|
||||
def validate_warehouse(self):
|
||||
if not self.wip_warehouse and not self.skip_transfer:
|
||||
frappe.throw(_("Work-in-Progress Warehouse is required before Submit"))
|
||||
if not self.fg_warehouse:
|
||||
if not self.fg_warehouse and not self.track_semi_finished_goods:
|
||||
frappe.throw(_("Target Warehouse is required before Submit"))
|
||||
|
||||
def before_submit(self):
|
||||
|
||||
Reference in New Issue
Block a user