Skip to content

Commit

Permalink
Merge pull request frappe#31795 from frappe/mergify/bp/version-13-hot…
Browse files Browse the repository at this point in the history
…fix/pr-31777

fix: intercompany SO created from Purchase Order throws exception (backport frappe#31777)
  • Loading branch information
deepeshgarg007 authored Aug 8, 2022
2 parents 3673dea + a17acfd commit 6f442d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2173,13 +2173,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)
Expand Down

0 comments on commit 6f442d1

Please sign in to comment.