Merge branch 'develop' into fix-22-23-05686
This commit is contained in:
commit
185a8910d2
@ -323,5 +323,6 @@ erpnext.patches.v14_0.update_entry_type_for_journal_entry
|
||||
erpnext.patches.v14_0.change_autoname_for_tax_withheld_vouchers
|
||||
erpnext.patches.v14_0.set_pick_list_status
|
||||
erpnext.patches.v15_0.update_asset_value_for_manual_depr_entries
|
||||
erpnext.patches.v15_0.update_gpa_and_ndb_for_assdeprsch
|
||||
# below migration patches should always run last
|
||||
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
|
||||
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
|
20
erpnext/patches/v15_0/update_gpa_and_ndb_for_assdeprsch.py
Normal file
20
erpnext/patches/v15_0/update_gpa_and_ndb_for_assdeprsch.py
Normal file
@ -0,0 +1,20 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
# not using frappe.qb because https://github.com/frappe/frappe/issues/20292
|
||||
frappe.db.sql(
|
||||
"""UPDATE `tabAsset Depreciation Schedule`
|
||||
JOIN `tabAsset`
|
||||
ON `tabAsset Depreciation Schedule`.`asset`=`tabAsset`.`name`
|
||||
SET
|
||||
`tabAsset Depreciation Schedule`.`gross_purchase_amount`=`tabAsset`.`gross_purchase_amount`,
|
||||
`tabAsset Depreciation Schedule`.`number_of_depreciations_booked`=`tabAsset`.`number_of_depreciations_booked`
|
||||
WHERE
|
||||
(
|
||||
`tabAsset Depreciation Schedule`.`gross_purchase_amount`<>`tabAsset`.`gross_purchase_amount`
|
||||
OR
|
||||
`tabAsset Depreciation Schedule`.`number_of_depreciations_booked`<>`tabAsset`.`number_of_depreciations_booked`
|
||||
)
|
||||
AND `tabAsset Depreciation Schedule`.`docstatus`<2"""
|
||||
)
|
Loading…
Reference in New Issue
Block a user