Skip to content

Commit

Permalink
fix: TypeError in PR for non-stock item (backport #37819) (#37842)
Browse files Browse the repository at this point in the history
* fix: `TypeError` in PR for non-stock item

(cherry picked from commit 028b3e2)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
  • Loading branch information
mergify[bot] and s-aga-r authored Nov 3, 2023
1 parent b1982a6 commit 847dd9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,10 @@ def make_item_gl_entries(self, gl_entries, warehouse_account=None):
item=d,
)

elif (
d.warehouse not in warehouse_with_no_account
or d.rejected_warehouse not in warehouse_with_no_account
elif (d.warehouse and d.warehouse not in warehouse_with_no_account) or (
d.rejected_warehouse and d.rejected_warehouse not in warehouse_with_no_account
):
warehouse_with_no_account.append(d.warehouse)
warehouse_with_no_account.append(d.warehouse or d.rejected_warehouse)
elif (
d.item_code not in stock_items
and not d.is_fixed_asset
Expand Down

0 comments on commit 847dd9e

Please sign in to comment.