Skip to content

Commit

Permalink
chore: patch correction
Browse files Browse the repository at this point in the history
  • Loading branch information
khushi8112 committed Sep 2, 2024
1 parent f369b58 commit 418f7e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,5 @@ erpnext.patches.v15_0.do_not_use_batchwise_valuation
erpnext.patches.v15_0.drop_index_posting_datetime_from_sle
erpnext.patches.v15_0.add_disassembly_order_stock_entry_type #1
erpnext.patches.v15_0.set_standard_stock_entry_type
erpnext.patches.v15_0.set_difference_amount_in_asset_value_adjustment
erpnext.patches.v15_0.link_purchase_item_to_asset_doc
7 changes: 4 additions & 3 deletions erpnext/patches/v15_0/link_purchase_item_to_asset_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ def get_linked_item(doctype, parent, item_code, amount, quantity):
if quantity > 1:
if item.amount + landed_cost == amount and item.qty == quantity:
return item.name
elif item.qty == quantity:
return item.name
else:
if item.rate + landed_cost == amount:
if item.rate + (landed_cost / item.qty) == amount:
return item.name

# If no exact match, return None
return None
return items[0].name if items else None

0 comments on commit 418f7e9

Please sign in to comment.