[MIG] account_chart_update_l10n_eu_oss_oca: Migration to 16.0
This commit is contained in:
parent
0721adbb3a
commit
92d40f66a2
@ -14,13 +14,13 @@ Account Chart update OSS OCA
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github
|
||||||
:target: https://github.com/OCA/account-financial-tools/tree/15.0/account_chart_update_l10n_eu_oss_oca
|
:target: https://github.com/OCA/account-financial-tools/tree/16.0/account_chart_update_l10n_eu_oss_oca
|
||||||
:alt: OCA/account-financial-tools
|
:alt: OCA/account-financial-tools
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||||
:target: https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_chart_update_l10n_eu_oss_oca
|
:target: https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_chart_update_l10n_eu_oss_oca
|
||||||
:alt: Translate me on Weblate
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||||
:target: https://runbot.odoo-community.org/runbot/92/15.0
|
:target: https://runbot.odoo-community.org/runbot/92/16.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
@ -39,7 +39,7 @@ Bug Tracker
|
|||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_.
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_.
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_chart_update_l10n_eu_oss_oca%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
`feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_chart_update_l10n_eu_oss_oca%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||||
|
|
||||||
Do not contact contributors directly about support or help with technical issues.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
@ -55,6 +55,9 @@ Contributors
|
|||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||||
|
* `Factor Libre <https://factorlibre.com>`_:
|
||||||
|
|
||||||
|
* Luis J. Salvatierra
|
||||||
|
|
||||||
Maintainers
|
Maintainers
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
@ -77,6 +80,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|||||||
|
|
||||||
|maintainer-LoisRForgeFlow|
|
|maintainer-LoisRForgeFlow|
|
||||||
|
|
||||||
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/15.0/account_chart_update_l10n_eu_oss_oca>`_ project on GitHub.
|
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_chart_update_l10n_eu_oss_oca>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Account Chart update OSS OCA",
|
"name": "Account Chart update OSS OCA",
|
||||||
"version": "15.0.1.0.0",
|
"version": "16.0.1.0.0",
|
||||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||||
"maintainers": ["LoisRForgeFlow"],
|
"maintainers": ["LoisRForgeFlow"],
|
||||||
"website": "https://github.com/OCA/account-financial-tools",
|
"website": "https://github.com/OCA/account-financial-tools",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 15.0\n"
|
"Project-Id-Version: Odoo Server 16.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -1 +1,4 @@
|
|||||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||||
|
* `Factor Libre <https://factorlibre.com>`_:
|
||||||
|
|
||||||
|
* Luis J. Salvatierra
|
||||||
|
1
account_chart_update_l10n_eu_oss_oca/tests/__init__.py
Normal file
1
account_chart_update_l10n_eu_oss_oca/tests/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from . import test_account_chart_update_l10n_eu_oss_oca
|
@ -0,0 +1,135 @@
|
|||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
from odoo.tests import tagged
|
||||||
|
|
||||||
|
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
|
||||||
|
|
||||||
|
|
||||||
|
@tagged("post_install", "-at_install")
|
||||||
|
class TestOSSCoA(AccountTestInvoicingCommon):
|
||||||
|
def _create_xml_id(self, record):
|
||||||
|
return self.env["ir.model.data"].create(
|
||||||
|
{
|
||||||
|
"module": "account_chart_update",
|
||||||
|
"name": "{}-{}".format(record._table, record.id),
|
||||||
|
"model": record._name,
|
||||||
|
"res_id": record.id,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def _create_tax_tmpl(self, name, chart_template):
|
||||||
|
record = self.env["account.tax.template"].create(
|
||||||
|
{
|
||||||
|
"name": name,
|
||||||
|
"amount": 0,
|
||||||
|
"chart_template_id": chart_template.id,
|
||||||
|
"tax_group_id": self.env.ref("account.tax_group_taxes").id,
|
||||||
|
"refund_repartition_line_ids": [
|
||||||
|
(0, 0, {"repartition_type": "base", "factor_percent": 100.0}),
|
||||||
|
(0, 0, {"repartition_type": "tax", "factor_percent": 100.0}),
|
||||||
|
(0, 0, {"repartition_type": "tax", "factor_percent": 100.0}),
|
||||||
|
],
|
||||||
|
"invoice_repartition_line_ids": [
|
||||||
|
(0, 0, {"repartition_type": "base", "factor_percent": 100.0}),
|
||||||
|
(0, 0, {"repartition_type": "tax", "factor_percent": 100.0}),
|
||||||
|
(0, 0, {"repartition_type": "tax", "factor_percent": 100.0}),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
self._create_xml_id(record)
|
||||||
|
return record
|
||||||
|
|
||||||
|
# pylint: disable=W8106
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(
|
||||||
|
cls, chart_template_ref="l10n_generic_coa.configurable_chart_template"
|
||||||
|
):
|
||||||
|
super().setUpClass(chart_template_ref=chart_template_ref)
|
||||||
|
cls.chart_template = cls.env.ref(chart_template_ref)
|
||||||
|
cls.env = cls.env(
|
||||||
|
context=dict(
|
||||||
|
cls.env.context,
|
||||||
|
mail_create_nolog=True,
|
||||||
|
mail_create_nosubscribe=True,
|
||||||
|
mail_notrack=True,
|
||||||
|
no_reset_password=True,
|
||||||
|
tracking_disable=True,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
cls.company = cls.env["res.company"].create(
|
||||||
|
{
|
||||||
|
"name": "Test account_chart_update company",
|
||||||
|
"currency_id": cls.chart_template.currency_id.id,
|
||||||
|
"country_id": cls.env.ref("base.es").id,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
cls.env.user.write(
|
||||||
|
{
|
||||||
|
"company_ids": [
|
||||||
|
(6, 0, cls.env.user.company_ids.ids),
|
||||||
|
(4, cls.company.id),
|
||||||
|
],
|
||||||
|
"company_id": cls.company.id,
|
||||||
|
"groups_id": [
|
||||||
|
(6, 0, cls.env.user.groups_id.ids),
|
||||||
|
(4, cls.env.ref("account.group_account_user").id),
|
||||||
|
(4, cls.env.ref("account.group_account_invoice").id),
|
||||||
|
(4, cls.env.ref("base.group_multi_company").id),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
cls.oss_wizard = cls.env["l10n.eu.oss.wizard"]
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
# Create demo tax
|
||||||
|
self._create_tax_tmpl("Not OSS Demo tax", self.chart_template)
|
||||||
|
self.tax = self.env["account.tax"].create(
|
||||||
|
{
|
||||||
|
"name": "Not OSS Demo tax",
|
||||||
|
"amount": 10,
|
||||||
|
"amount_type": "percent",
|
||||||
|
"type_tax_use": "sale",
|
||||||
|
"country_id": self.env.ref("base.es").id,
|
||||||
|
"company_id": self.company.id,
|
||||||
|
"tax_group_id": self.env.ref("account.tax_group_taxes").id,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
self.wizard_obj = self.env["wizard.update.charts.accounts"]
|
||||||
|
self.wizard_vals = {
|
||||||
|
"company_id": self.company.id,
|
||||||
|
"chart_template_id": self.chart_template.id,
|
||||||
|
"code_digits": 6,
|
||||||
|
"lang": "en_US",
|
||||||
|
}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _oss_wizard_create(cls, extra_vals):
|
||||||
|
vals = cls.oss_wizard.default_get(list(cls.oss_wizard.fields_get()))
|
||||||
|
vals.update(extra_vals)
|
||||||
|
oss_wizard_id = cls.oss_wizard.create(vals)
|
||||||
|
return oss_wizard_id
|
||||||
|
|
||||||
|
def test_matching(self):
|
||||||
|
# Generate EU OSS taxes
|
||||||
|
oss_wizard_vals = {
|
||||||
|
"company_id": self.company.id,
|
||||||
|
"general_tax": self.tax.id,
|
||||||
|
}
|
||||||
|
oss_wizard = self._oss_wizard_create(oss_wizard_vals)
|
||||||
|
oss_wizard.generate_eu_oss_taxes()
|
||||||
|
|
||||||
|
wizard_vals = self.wizard_vals
|
||||||
|
wizard_vals.update(update_tax=True)
|
||||||
|
wizard = self.wizard_obj.create(wizard_vals)
|
||||||
|
wizard.action_find_records()
|
||||||
|
taxes_to_delete = wizard.tax_ids.filtered(lambda x: x.type == "deleted").mapped(
|
||||||
|
"update_tax_id"
|
||||||
|
)
|
||||||
|
oss_taxes = self.env["account.tax"].search(
|
||||||
|
[
|
||||||
|
("oss_country_id", "!=", False),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
self.assertTrue(oss_taxes, "No OSS taxes found in the system")
|
||||||
|
for tax in oss_taxes:
|
||||||
|
self.assertNotIn(tax, taxes_to_delete)
|
Loading…
Reference in New Issue
Block a user