fix: reset location only if there is value in row item location field
(cherry picked from commit 2bb79197aa)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user