* fix: source warehouse not set in required items of WO (#44426)
fix: source warehouse not set in required items of WO on data import
(cherry picked from commit 4050ea07eb)
# Conflicts:
# erpnext/manufacturing/doctype/work_order/work_order.py
* chore: fix conflicts
---------
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -89,10 +89,18 @@ class WorkOrder(Document):
|
|||||||
self.status = self.get_status()
|
self.status = self.get_status()
|
||||||
self.validate_workstation_type()
|
self.validate_workstation_type()
|
||||||
|
|
||||||
|
if self.source_warehouse:
|
||||||
|
self.set_warehouses()
|
||||||
|
|
||||||
validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"])
|
validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"])
|
||||||
|
|
||||||
self.set_required_items(reset_only_qty=len(self.get("required_items")))
|
self.set_required_items(reset_only_qty=len(self.get("required_items")))
|
||||||
|
|
||||||
|
def set_warehouses(self):
|
||||||
|
for row in self.required_items:
|
||||||
|
if not row.source_warehouse:
|
||||||
|
row.source_warehouse = self.source_warehouse
|
||||||
|
|
||||||
def validate_workstation_type(self):
|
def validate_workstation_type(self):
|
||||||
for row in self.operations:
|
for row in self.operations:
|
||||||
if not row.workstation and not row.workstation_type:
|
if not row.workstation and not row.workstation_type:
|
||||||
|
|||||||
Reference in New Issue
Block a user