Merge pull request #21003 from Alchez/dev-stock-entry-fg-validation

fix: allow target warehouses to be changed for work order stock entries (develop)
This commit is contained in:
rohitwaghchaure
2020-03-31 15:44:13 +05:30
committed by GitHub

View File

@@ -298,13 +298,8 @@ class StockEntry(StockController):
if validate_for_manufacture:
if d.bom_no:
d.s_warehouse = None
if not d.t_warehouse:
frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx))
elif self.pro_doc and (cstr(d.t_warehouse) != self.pro_doc.fg_warehouse and cstr(d.t_warehouse) != self.pro_doc.scrap_warehouse):
frappe.throw(_("Target warehouse in row {0} must be same as Work Order").format(d.idx))
else:
d.t_warehouse = None
if not d.s_warehouse: