Skip to content

Commit

Permalink
Merge PR #3393 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by sergiocorato
  • Loading branch information
OCA-git-bot committed Feb 28, 2024
2 parents 2dddca5 + 3157243 commit e8264e4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions assets_management/report/asset_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def generate_structure(self):
dep_lines = dep_lines.filtered(lambda dl: dl.date <= self.date)
categories = assets.mapped("category_id")

if not (categories and assets and deps and dep_lines):
if not (categories and assets and deps):
raise ValidationError(
_("There is nothing to print according to current settings!")
)
Expand Down Expand Up @@ -347,8 +347,16 @@ def generate_totals(self):
t: {fname: 0 for fname in fnames}
for t in report_deps.mapped("depreciation_id.type_id")
}
for report_dep in report_deps.filtered("report_depreciation_year_line_ids"):
for report_dep in report_deps:
dep_type = report_dep.depreciation_id.type_id
if not report_dep.report_depreciation_year_line_ids:
totals_by_dep_type[dep_type][
"amount_depreciable_updated"
] += report_dep.dep_amount_depreciable
totals_by_dep_type[dep_type][
"amount_residual"
] += report_dep.dep_amount_depreciable
continue
last_line = report_dep.report_depreciation_year_line_ids[-1]
line_curr = last_line.get_currency()
fy_start = last_line.fiscal_year_id.date_from
Expand Down

0 comments on commit e8264e4

Please sign in to comment.