Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] assets_management: includere nella stampa cespiti non ancora ammortizzati #3393

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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