[MIG] account_tax_balance: Migration to 18.0
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||
# 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(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||
# 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 @@ class AccountTax(models.Model):
|
||||
@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)]
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from dateutil.rrule import MONTHLY
|
||||
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 @@ class TestAccountTaxBalance(HttpCase):
|
||||
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 @@ class TestAccountTaxBalance(HttpCase):
|
||||
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,
|
||||
)
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_tax_tree_balance" model="ir.ui.view">
|
||||
<field name="name">account.tax.tree.balance</field>
|
||||
<field name="name">account.tax.list.balance</field>
|
||||
<field name="model">account.tax</field>
|
||||
<field eval="100" name="priority" />
|
||||
<field name="arch" type="xml">
|
||||
<tree create="false" delete="false">
|
||||
<list create="false" delete="false">
|
||||
<field name="name" />
|
||||
<field name="description" string="Short Name" />
|
||||
<field name="balance_regular" sum="Total" />
|
||||
@@ -53,7 +53,7 @@
|
||||
title="View base lines"
|
||||
icon="fa-search-plus"
|
||||
/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_tax_search_balance" model="ir.ui.view">
|
||||
@@ -85,7 +85,7 @@
|
||||
<record id="action_tax_balances_tree" model="ir.actions.act_window">
|
||||
<field name="name">Taxes Balance</field>
|
||||
<field name="res_model">account.tax</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">list</field>
|
||||
<field name="domain">[('has_moves', '=', True)]</field>
|
||||
<field name="view_id" ref="view_tax_tree_balance" />
|
||||
<field name="search_view_id" ref="view_tax_search_balance" />
|
||||
|
||||
@@ -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):
|
||||
@@ -64,12 +64,14 @@ class WizardOpenTaxBalances(models.TransientModel):
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user