Merge pull request #31777 from ruthra-kumar/intercompany_po_bug

fix: intercompany SO created from Purchase Order throws exception
This commit is contained in:
Deepesh Garg 2022-08-08 16:06:09 +05:30 committed by GitHub
commit b85dbdc3c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2103,13 +2103,13 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target_detail_field = "sales_invoice_item" if doctype == "Sales Invoice" else "sales_order_item"
source_document_warehouse_field = "target_warehouse"
target_document_warehouse_field = "from_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
else:
source_doc = frappe.get_doc(doctype, source_name)
target_doctype = "Sales Invoice" if doctype == "Purchase Invoice" else "Sales Order"
source_document_warehouse_field = "from_warehouse"
target_document_warehouse_field = "target_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
received_items = {}
validate_inter_company_transaction(source_doc, doctype)
details = get_inter_company_details(source_doc, doctype)