-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] l10n_it_account: Migration to 18.0
- Loading branch information
Showing
22 changed files
with
77 additions
and
2,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,13 @@ ITA - Contabilità base | |
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github | ||
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_account | ||
:target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account | ||
:alt: OCA/l10n-italy | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_account | ||
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_account | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0 | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
@@ -57,7 +57,7 @@ Bug Tracker | |
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_account%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_account%0Aversion:%2018.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. | ||
|
||
|
@@ -73,23 +73,23 @@ Authors | |
Contributors | ||
------------ | ||
|
||
- Davide Corio | ||
- Lorenzo Battistini <[email protected]> | ||
- Alex Comba <[email protected]> | ||
- Sergio Zanchetta <https://github.com/primes2h> | ||
- Gianmarco Conte - Dinamiche Aziendali Sr | ||
<[email protected]> | ||
- Marco Colombo - Phi S.r.l. <[email protected]> | ||
- `TAKOBI <https://takobi.online>`__: | ||
- Davide Corio | ||
- Lorenzo Battistini <[email protected]> | ||
- Alex Comba <[email protected]> | ||
- Sergio Zanchetta <https://github.com/primes2h> | ||
- Gianmarco Conte - Dinamiche Aziendali Sr | ||
<[email protected]> | ||
- Marco Colombo - Phi S.r.l. <[email protected]> | ||
- `TAKOBI <https://takobi.online>`__: | ||
|
||
- Simone Rubino <[email protected]> | ||
- Simone Rubino <[email protected]> | ||
|
||
Other credits | ||
------------- | ||
|
||
The development of this module has been financially supported by: | ||
|
||
- Odoo Italia Network | ||
- Odoo Italia Network | ||
|
||
Maintainers | ||
----------- | ||
|
@@ -104,6 +104,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose | |
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_account>`_ project on GitHub. | ||
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,49 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models | ||
from . import wizards | ||
from . import tools | ||
from odoo import api, SUPERUSER_ID | ||
from openupgradelib import openupgrade | ||
from psycopg2 import sql | ||
|
||
OLD_MODULE_NAME = "l10n_it_account_tax_kind" | ||
MODEL = "account.tax" | ||
OLD_MODEL = "account.tax.kind" | ||
RENAMED_FIELDS = [ | ||
( | ||
"law_reference", | ||
"l10n_it_law_reference", | ||
), | ||
] | ||
|
||
def _l10n_it_account_post_init(cr, registry): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
env["account.account"].set_account_types_negative_sign() | ||
|
||
lang = env["res.lang"] | ||
if lang._lang_get("it_IT"): | ||
lang.update_menu_finance_it_translation() | ||
def _l10n_it_account_post_init(env): | ||
if openupgrade.is_module_installed(env.cr, OLD_MODULE_NAME): | ||
openupgrade.logged_query( | ||
env.cr, | ||
sql.SQL(f""" | ||
UPDATE | ||
{MODEL.replace(".", "_")} | ||
SET | ||
l10n_it_exempt_reason = kind_id.code | ||
FROM | ||
{OLD_MODEL.replace(".", "_")} AS kind | ||
WHERE | ||
{MODEL.replace(".", "_")}.kind_id = kind.id | ||
AND {MODEL.replace(".", "_")}.kind_id IS NOT NULL | ||
"""), | ||
) | ||
|
||
field_spec = [] | ||
for renamed_field in RENAMED_FIELDS: | ||
old_field, new_field = renamed_field | ||
field_spec.append( | ||
( | ||
MODEL, | ||
MODEL.replace(".", "_"), | ||
old_field, | ||
new_field, | ||
) | ||
) | ||
openupgrade.rename_fields( | ||
env, | ||
field_spec, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
l10n_it_account/migrations/16.0.1.0.0/post-migrate_balance_sign.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import account_account | ||
from . import account_group | ||
from . import account_tax | ||
from . import res_lang |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.