mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
Merge pull request #40125 from nabinhait/document-modified-error
fix: Reload document on cancel to avoid document modified error
This commit is contained in:
@@ -57,6 +57,7 @@ class Asset(AccountsController):
|
|||||||
self.validate_in_use_date()
|
self.validate_in_use_date()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
self.make_asset_movement()
|
self.make_asset_movement()
|
||||||
|
self.reload()
|
||||||
if not self.booked_fixed_asset and self.validate_make_gl_entry():
|
if not self.booked_fixed_asset and self.validate_make_gl_entry():
|
||||||
self.make_gl_entries()
|
self.make_gl_entries()
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ class Asset(AccountsController):
|
|||||||
self.validate_cancellation()
|
self.validate_cancellation()
|
||||||
self.cancel_movement_entries()
|
self.cancel_movement_entries()
|
||||||
self.cancel_capitalization()
|
self.cancel_capitalization()
|
||||||
|
self.reload()
|
||||||
self.delete_depreciation_entries()
|
self.delete_depreciation_entries()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
|
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
|
||||||
@@ -1009,7 +1011,9 @@ class Asset(AccountsController):
|
|||||||
fixed_asset_account, cwip_account = self.get_fixed_asset_account(), self.get_cwip_account()
|
fixed_asset_account, cwip_account = self.get_fixed_asset_account(), self.get_cwip_account()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
purchase_document and self.purchase_receipt_amount and self.available_for_use_date <= nowdate()
|
purchase_document
|
||||||
|
and self.purchase_receipt_amount
|
||||||
|
and getdate(self.available_for_use_date) <= getdate()
|
||||||
):
|
):
|
||||||
|
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
|
|||||||
Reference in New Issue
Block a user