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] account_vat_period_end_statement multicompany non stampa le imposte #3762

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
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 @@
@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,
sergiocorato marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down
Loading