Skip to content

Commit

Permalink
fix: use filter_by_finance_book instead of only_depreciable_assets in…
Browse files Browse the repository at this point in the history
… fixed asset register (#35031)

fix: use filter_by_finance_book instead of only_depreciable_assets
  • Loading branch information
anandbaburajan authored Apr 25, 2023
1 parent ca388ed commit e08d636
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ frappe.query_reports["Fixed Asset Register"] = {
label: __("Finance Book"),
fieldtype: "Link",
options: "Finance Book",
depends_on: "eval: doc.only_depreciable_assets == 1",
depends_on: "eval: doc.filter_by_finance_book == 1",
},
{
fieldname:"only_depreciable_assets",
label: __("Only depreciable assets"),
fieldname:"filter_by_finance_book",
label: __("Filter by Finance Book"),
fieldtype: "Check"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def get_conditions(filters):
filters.year_end_date = getdate(fiscal_year.year_end_date)

conditions[date_field] = ["between", [filters.year_start_date, filters.year_end_date]]
if filters.get("only_depreciable_assets"):
conditions["calculate_depreciation"] = filters.get("only_depreciable_assets")
if filters.get("only_existing_assets"):
conditions["is_existing_asset"] = filters.get("only_existing_assets")
if filters.get("asset_category"):
Expand Down Expand Up @@ -106,7 +104,7 @@ def get_data(filters):

assets_linked_to_fb = None

if filters.only_depreciable_assets:
if filters.filter_by_finance_book:
assets_linked_to_fb = frappe.db.get_all(
doctype="Asset Finance Book",
filters={"finance_book": filters.finance_book or ("is", "not set")},
Expand Down

0 comments on commit e08d636

Please sign in to comment.