Skip to content

Commit

Permalink
[14.0][FIX] account_vat_period_end_statement multicompany non stampa …
Browse files Browse the repository at this point in the history
…le imposte
  • Loading branch information
sergiocorato committed Feb 27, 2024
1 parent 3c95af5 commit 4f7eed1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions account_vat_period_end_statement/report/vat_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import time

from odoo import api, models
from odoo.exceptions import UserError
from odoo.tools.misc import formatLang
from odoo.tools.translate import _

Expand All @@ -19,11 +20,15 @@ class VatPeriodEndStatementReport(models.AbstractModel):
@api.model
def _get_report_values(self, docids, data=None):
docs = self.env["account.vat.period.end.statement"].browse(docids)
companies = docs.mapped("company_id")

Check warning on line 23 in account_vat_period_end_statement/report/vat_statement.py

View check run for this annotation

Codecov / codecov/patch

account_vat_period_end_statement/report/vat_statement.py#L23

Added line #L23 was not covered by tests
if len(companies) != 1:
raise UserError(_("You must select documents from the same company!"))
company = companies[0]

Check warning on line 26 in account_vat_period_end_statement/report/vat_statement.py

View check run for this annotation

Codecov / codecov/patch

account_vat_period_end_statement/report/vat_statement.py#L25-L26

Added lines #L25 - L26 were not covered by tests
vals = {
"docs": docs,
"time": time,
"tax_amounts": self._get_taxes_amounts,
"account_vat_amounts": self._get_account_vat_amounts,
"tax_amounts": self.with_company(company)._get_taxes_amounts,
"account_vat_amounts": self.with_company(company)._get_account_vat_amounts,
"formatLang": formatLang,
"env": self.env,
}
Expand Down

0 comments on commit 4f7eed1

Please sign in to comment.