patch: set default asset quantity as 1

This commit is contained in:
Saqib Ansari 2022-01-19 18:27:19 +05:30
parent a5643d500e
commit d36092d448
2 changed files with 10 additions and 1 deletions

View File

@ -326,4 +326,5 @@ erpnext.patches.v13_0.agriculture_deprecation_warning
erpnext.patches.v14_0.delete_agriculture_doctypes
erpnext.patches.v13_0.update_exchange_rate_settings
erpnext.patches.v14_0.rearrange_company_fields
erpnext.patches.v14_0.update_leave_notification_template
erpnext.patches.v14_0.update_leave_notification_template
erpnext.patches.v13_0.update_asset_quantity_field

View File

@ -0,0 +1,8 @@
import frappe
def execute():
if frappe.db.count('Asset'):
frappe.reload_doc("assets", "doctype", "Asset")
asset = frappe.qb.DocType('Asset')
frappe.qb.update(asset).set(asset.asset_quantity, 1).run()