fix(Asset Repair): Add mandatory_depends_on condition for Purchase Invoice
This commit is contained in:
parent
17fa121779
commit
aff9709525
@ -241,6 +241,7 @@
|
|||||||
"fieldname": "purchase_invoice",
|
"fieldname": "purchase_invoice",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Purchase Invoice",
|
"label": "Purchase Invoice",
|
||||||
|
"mandatory_depends_on": "eval: doc.repair_status == 'Completed' && doc.repair_cost > 0",
|
||||||
"options": "Purchase Invoice"
|
"options": "Purchase Invoice"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -254,7 +255,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-06-16 08:02:34.782990",
|
"modified": "2021-06-16 08:16:07.581813",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset Repair",
|
"name": "Asset Repair",
|
||||||
|
@ -45,7 +45,6 @@ class AssetRepair(Document):
|
|||||||
self.check_for_stock_items_and_warehouse()
|
self.check_for_stock_items_and_warehouse()
|
||||||
self.decrease_stock_quantity()
|
self.decrease_stock_quantity()
|
||||||
if self.capitalize_repair_cost:
|
if self.capitalize_repair_cost:
|
||||||
self.check_for_purchase_invoice()
|
|
||||||
self.make_gl_entries()
|
self.make_gl_entries()
|
||||||
if frappe.db.get_value('Asset', self.asset, 'calculate_depreciation'):
|
if frappe.db.get_value('Asset', self.asset, 'calculate_depreciation'):
|
||||||
self.modify_depreciation_schedule()
|
self.modify_depreciation_schedule()
|
||||||
@ -90,10 +89,6 @@ class AssetRepair(Document):
|
|||||||
stock_entry.insert()
|
stock_entry.insert()
|
||||||
stock_entry.submit()
|
stock_entry.submit()
|
||||||
|
|
||||||
def check_for_purchase_invoice(self):
|
|
||||||
if not self.purchase_invoice:
|
|
||||||
frappe.throw(_("Please link Purchase Invoice."))
|
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.make_gl_entries(cancel=True)
|
self.make_gl_entries(cancel=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user