Skip to content

Commit

Permalink
fix: reset location only if there is value in row item location field
Browse files Browse the repository at this point in the history
(cherry picked from commit 2bb7919)
  • Loading branch information
khushi8112 authored and mergify[bot] committed Feb 19, 2025
1 parent 6183b38 commit a509568
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion erpnext/assets/doctype/asset/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ frappe.ui.form.on("Asset", {
frm.set_value("purchase_amount", data.gross_purchase_amount);
frm.set_value("asset_quantity", data.asset_quantity);
frm.set_value("cost_center", data.cost_center);
frm.set_value("location", data.asset_location);

if (doctype === "Purchase Receipt") {
frm.set_value("purchase_receipt_item", data.purchase_receipt_item);
Expand Down
8 changes: 0 additions & 8 deletions erpnext/assets/doctype/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,6 @@ def get_linked_item(self, purchase_doc_type, purchase_doc):
if item.base_net_rate == self.gross_purchase_amount and item.qty == self.asset_quantity:
return item.name

# If no matching item found, raise validation error
frappe.throw(
_(
"No matching item found in {0} with item code {1}. "
"Please verify the purchase details and ensure the correct amount and quantity is recorded."
).format(purchase_doc_type, self.item_code)
)

def validate_asset_and_reference(self):
if self.purchase_invoice or self.purchase_receipt:
reference_doc = "Purchase Invoice" if self.purchase_invoice else "Purchase Receipt"
Expand Down

0 comments on commit a509568

Please sign in to comment.