-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Patch to remove cancelled asset capitalization from asset
(cherry picked from commit 1951f71)
- Loading branch information
1 parent
bba738f
commit a755540
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
erpnext/patches/v15_0/remove_cancelled_asset_capitalization_from_asset.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import frappe | ||
|
||
|
||
def execute(): | ||
cancelled_asset_capitalizations = frappe.get_all( | ||
"Asset Capitalization", | ||
filters={"docstatus": 2}, | ||
fields=["name", "target_asset"], | ||
) | ||
for asset_capitalization in cancelled_asset_capitalizations: | ||
frappe.db.set_value("Asset", asset_capitalization.target_asset, "capitalized_in", None) |