mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-13 06:31:48 +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.
(cherry picked from commit 9df527bf3f)
This commit is contained in:
@@ -281,7 +281,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) {
|
||||
|
||||
@@ -917,7 +917,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