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] l10n_it_financial_statements_report P&L balance for period #4443

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions l10n_it_financial_statements_report/report/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import trial_balance
from . import financial_statements_report
from . import financial_statements_report_xlsx
24 changes: 24 additions & 0 deletions l10n_it_financial_statements_report/report/trial_balance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from odoo import api, models


class TrialBalanceReport(models.AbstractModel):
_inherit = "report.account_financial_report.trial_balance"

@api.model
def _compute_account_amount(
self, total_amount, tb_initial_acc, tb_period_acc, foreign_currency
):
total_amount = super()._compute_account_amount(
total_amount, tb_initial_acc, tb_period_acc, foreign_currency
)
for tb in tb_initial_acc:
acc_id = tb["account_id"]

Check warning on line 15 in l10n_it_financial_statements_report/report/trial_balance.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_financial_statements_report/report/trial_balance.py#L15

Added line #L15 was not covered by tests
if tb["account_internal_group"] in ["expense", "income"]:
total_amount[acc_id]["initial_balance"] = 0.0
total_amount[acc_id]["ending_balance"] = total_amount[acc_id]["balance"]

Check warning on line 18 in l10n_it_financial_statements_report/report/trial_balance.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_financial_statements_report/report/trial_balance.py#L17-L18

Added lines #L17 - L18 were not covered by tests
if foreign_currency:
total_amount[acc_id]["initial_currency_balance"] = 0.0
total_amount[acc_id]["ending_currency_balance"] += round(

Check warning on line 21 in l10n_it_financial_statements_report/report/trial_balance.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_financial_statements_report/report/trial_balance.py#L20-L21

Added lines #L20 - L21 were not covered by tests
total_amount[acc_id]["amount_currency"], 2
)
return total_amount
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pdfminer.six # needed by attachment_indexation module
odoo14-addon-account_financial_report@git+https://github.com/OCA/account-financial-reporting@refs/pull/1251/head#subdirectory=setup/account_financial_report
Loading