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
commit bc415331a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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: