diff --git a/account_tax_balance/__manifest__.py b/account_tax_balance/__manifest__.py index 164110e064e..934dcb494d7 100644 --- a/account_tax_balance/__manifest__.py +++ b/account_tax_balance/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Tax Balance", "summary": "Compute tax balances based on date range", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "development_status": "Mature", "category": "Invoices & Payments", "website": "https://github.com/OCA/account-financial-reporting", diff --git a/account_tax_balance/models/account_move.py b/account_tax_balance/models/account_move.py index 82bf0fb5c21..26758f81818 100644 --- a/account_tax_balance/models/account_move.py +++ b/account_tax_balance/models/account_move.py @@ -1,7 +1,7 @@ # Copyright 2016 Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models class AccountMove(models.Model): @@ -10,12 +10,12 @@ class AccountMove(models.Model): @api.model def _selection_financial_type(self): return [ - ("other", _("Other")), - ("liquidity", _("Liquidity")), - ("receivable", _("Receivable")), - ("receivable_refund", _("Receivable refund")), - ("payable", _("Payable")), - ("payable_refund", _("Payable refund")), + ("other", self.env._("Other")), + ("liquidity", self.env._("Liquidity")), + ("receivable", self.env._("Receivable")), + ("receivable_refund", self.env._("Receivable refund")), + ("payable", self.env._("Payable")), + ("payable_refund", self.env._("Payable refund")), ] financial_type = fields.Selection( diff --git a/account_tax_balance/models/account_tax.py b/account_tax_balance/models/account_tax.py index 6eadace4d4a..3cf7b4f932e 100644 --- a/account_tax_balance/models/account_tax.py +++ b/account_tax_balance/models/account_tax.py @@ -2,7 +2,7 @@ # Copyright 2016 Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models class AccountTax(models.Model): @@ -77,7 +77,7 @@ def _is_unsupported_search_operator(self, operator): @api.model def _search_has_moves(self, operator, value): if self._is_unsupported_search_operator(operator) or not value: - raise ValueError(_("Unsupported search operator")) + raise ValueError(self.env._("Unsupported search operator")) ids_with_moves = self._account_tax_ids_with_moves() return [("id", "in", ids_with_moves)] diff --git a/account_tax_balance/tests/test_account_tax_balance.py b/account_tax_balance/tests/test_account_tax_balance.py index 7943015ba9a..a2e2b245c0a 100644 --- a/account_tax_balance/tests/test_account_tax_balance.py +++ b/account_tax_balance/tests/test_account_tax_balance.py @@ -10,7 +10,7 @@ import odoo from odoo import fields from odoo.fields import Date -from odoo.tests.common import Form, HttpCase +from odoo.tests import Form, HttpCase from odoo.addons.account.tests.common import AccountTestInvoicingCommon @@ -40,8 +40,8 @@ def setUpClass(cls): cls.current_month = datetime.now().month range_generator = cls.range_generator.create( { - "date_start": "%s-01-01" % cls.current_year, - "name_prefix": "%s-" % cls.current_year, + "date_start": f"{cls.current_year}-01-01", + "name_prefix": f"{cls.current_year}-", "type_id": cls.range_type.id, "duration_count": 1, "unit_of_time": str(MONTHLY), @@ -188,7 +188,7 @@ def test_tax_balance(self): liquidity_account_id = self.env["account.account"].search( [ ("account_type", "in", ["asset_cash", "liability_credit_card"]), - ("company_id", "=", self.company.id), + ("company_ids", "in", self.company.id), ], limit=1, ) diff --git a/account_tax_balance/views/account_move_view.xml b/account_tax_balance/views/account_move_view.xml index ab15ffd8f2f..a791774abcd 100644 --- a/account_tax_balance/views/account_move_view.xml +++ b/account_tax_balance/views/account_move_view.xml @@ -2,7 +2,7 @@ - + Add move type column account.move diff --git a/account_tax_balance/views/account_tax_view.xml b/account_tax_balance/views/account_tax_view.xml index 53780eee7a5..b69be015328 100644 --- a/account_tax_balance/views/account_tax_view.xml +++ b/account_tax_balance/views/account_tax_view.xml @@ -3,12 +3,12 @@ Copyright 2016 Antonio Espinosa License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - - account.tax.tree.balance + + account.tax.list.balance account.tax - + @@ -53,7 +53,7 @@ title="View base lines" icon="fa-search-plus" /> - + @@ -82,12 +82,12 @@ - + Taxes Balance account.tax - tree + list [('has_moves', '=', True)] - + diff --git a/account_tax_balance/wizard/open_tax_balances.py b/account_tax_balance/wizard/open_tax_balances.py index a878959a50d..8baeb981223 100644 --- a/account_tax_balance/wizard/open_tax_balances.py +++ b/account_tax_balance/wizard/open_tax_balances.py @@ -1,7 +1,7 @@ # Copyright 2016 Lorenzo Battistini - Agile Business Group # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models class WizardOpenTaxBalances(models.TransientModel): @@ -40,7 +40,7 @@ def _compute_date_range(self): def open_taxes(self): self.ensure_one() - action = self.env.ref("account_tax_balance.action_tax_balances_tree") + action = self.env.ref("account_tax_balance.action_tax_balances_list") act_vals = action.sudo().read()[0] # override action name doesn't work in v12 or v10 # we need to build a dynamic action on main keys @@ -64,12 +64,14 @@ def open_taxes(self): date_format = lang and lang.date_format or "%m/%d/%Y" infos = { "name": vals["name"], - "target": _(self.target_move), + "target": self.env._(self.target_move), "from": self.from_date.strftime(date_format), "to": self.to_date.strftime(date_format), } # name of action which is displayed in breacrumb - vals["name"] = _("%(name)s: %(target)s from %(from)s to %(to)s") % infos + vals["name"] = ( + self.env._("%(name)s: %(target)s from %(from)s to %(to)s") % infos + ) multi_cpny_grp = self.env.ref("base.group_multi_company") if multi_cpny_grp in self.env.user.groups_id: company_names = self.company_ids.mapped("name")