fix: reset location only if there is value in row item location field

(cherry picked from commit 2bb79197aa)
This commit is contained in:
Khushi Rawat
2025-02-19 15:04:26 +05:30
committed by Mergify
parent 6183b38089
commit a509568110
2 changed files with 0 additions and 9 deletions

View File

@@ -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);

View File

@@ -232,14 +232,6 @@ class Asset(AccountsController):
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"