fix: local var referenced before assignment (backport #41780) (#41782)

fix: local var referenced before assignment (#41780)

(cherry picked from commit 4ff3e6caaa)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
mergify[bot]
2024-06-04 22:25:20 +05:30
committed by GitHub
parent a67fa6863e
commit 3777cae860

View File

@@ -902,12 +902,12 @@ def get_mapped_subcontracting_order(source_name, target_doc=None):
)
target_doc.populate_items_table()
source_doc = frappe.get_doc("Purchase Order", source_name)
if target_doc.set_warehouse:
for item in target_doc.items:
item.warehouse = target_doc.set_warehouse
else:
source_doc = frappe.get_doc("Purchase Order", source_name)
if source_doc.set_warehouse:
for item in target_doc.items:
item.warehouse = source_doc.set_warehouse