Skip to content

Commit

Permalink
[14.0][FIX] assets_management: includere nella stampa cespiti non anc…
Browse files Browse the repository at this point in the history
…ora ammortizzati
  • Loading branch information
sergiocorato authored and OCA-git-bot committed Sep 21, 2023
1 parent 76a8e12 commit 3157243
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 @@ -164,7 +164,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 @@ -346,8 +346,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][

Check warning on line 352 in assets_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

assets_management/report/asset_journal.py#L352

Added line #L352 was not covered by tests
"amount_depreciable_updated"
] += report_dep.dep_amount_depreciable
totals_by_dep_type[dep_type][

Check warning on line 355 in assets_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

assets_management/report/asset_journal.py#L355

Added line #L355 was not covered by tests
"amount_residual"
] += report_dep.dep_amount_depreciable
continue

Check warning on line 358 in assets_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

assets_management/report/asset_journal.py#L358

Added line #L358 was not covered by tests
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 3157243

Please sign in to comment.