Skip to content

Commit

Permalink
Merge PR #3762 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by TheMule71
  • Loading branch information
OCA-git-bot committed Feb 27, 2024
2 parents ba0e4f7 + f304809 commit f345afc
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")
if len(companies) != 1:
raise UserError(_("You must select documents from the same company!"))
company = companies[0]
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 f345afc

Please sign in to comment.