fix: raw material should not have target warehouse in manufacture entry (backport #54849) (#54861)

fix: raw material should not have target warehouse in manufacture entry (#54849)

(cherry picked from commit b5527cf328)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
mergify[bot]
2026-05-12 09:46:45 +00:00
committed by GitHub
parent 67ad437dd3
commit 3dbadfadd5

View File

@@ -243,7 +243,6 @@ class StockEntry(StockController, SubcontractingInwardController):
self.set_transfer_qty()
self.validate_uom_is_integer("uom", "qty")
self.validate_uom_is_integer("stock_uom", "transfer_qty")
self.validate_warehouse()
self.validate_warehouse_of_sabb()
self.validate_work_order()
self.validate_source_stock_entry()
@@ -259,6 +258,7 @@ class StockEntry(StockController, SubcontractingInwardController):
else:
self.validate_job_card_fg_item()
self.validate_warehouse()
self.validate_with_material_request()
self.validate_batch()
self.validate_inspection()
@@ -853,15 +853,14 @@ class StockEntry(StockController, SubcontractingInwardController):
frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx))
if self.purpose == "Manufacture":
if has_bom:
if d.is_finished_item or d.type or d.is_legacy_scrap_item:
d.s_warehouse = None
if not d.t_warehouse:
frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx))
else:
d.t_warehouse = None
if not d.s_warehouse:
frappe.throw(_("Source warehouse is mandatory for row {0}").format(d.idx))
if d.is_finished_item or d.type or d.is_legacy_scrap_item:
d.s_warehouse = None
if not d.t_warehouse:
frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx))
else:
d.t_warehouse = None
if not d.s_warehouse:
frappe.throw(_("Source warehouse is mandatory for row {0}").format(d.idx))
if self.purpose == "Disassemble":
if has_bom: