Skip to content

Commit c530fe1

Browse files
committed
[MIG] l10n_es_atc: Migration to 19.0
1 parent 65c6914 commit c530fe1

6 files changed

Lines changed: 44 additions & 29 deletions

File tree

l10n_es_atc/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ ATC Menú
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
24-
:target: https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_atc
24+
:target: https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_atc
2525
:alt: OCA/l10n-spain
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_atc
27+
:target: https://translation.odoo-community.org/projects/l10n-spain-19-0/l10n-spain-19-0-l10n_es_atc
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -55,7 +55,7 @@ Bug Tracker
5555
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
5656
In case of trouble, please check there if your issue has already been reported.
5757
If you spotted it first, help us to smash it by providing a detailed and welcomed
58-
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_atc%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
58+
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_atc%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5959

6060
Do not contact contributors directly about support or help with technical issues.
6161

@@ -92,6 +92,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
9292
mission is to support the collaborative development of Odoo features and
9393
promote its widespread use.
9494

95-
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_atc>`_ project on GitHub.
95+
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_atc>`_ project on GitHub.
9696

9797
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

l10n_es_atc/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "ATC Menú",
55
"summary": "Modulo 'glue' de la AEAT para el menú de la ATC",
6-
"version": "18.0.1.1.2",
6+
"version": "19.0.1.0.0",
77
"author": "Binhex System Solutions,Odoo Community Association (OCA)",
88
"license": "AGPL-3",
99
"website": "https://github.com/OCA/l10n-spain",

l10n_es_atc/models/l10n_es_atc_report.py

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import requests
1515

16-
from odoo import _, api, fields, models
16+
from odoo import api, fields, models
1717
from odoo.exceptions import UserError
1818
from odoo.tools import ustr
1919
from odoo.tools.float_utils import float_is_zero, float_round
@@ -95,10 +95,12 @@ def _atc_get_messages(self):
9595
messages = []
9696
partner_company = self.company_id.partner_id
9797
if not partner_company.street:
98-
messages.append(_("- The company %s has no street") % partner_company.name)
98+
messages.append(
99+
self.env._("- The company %s has no street", partner_company.name)
100+
)
99101
if not partner_company.zip:
100102
messages.append(
101-
_("- The company %s has no zip code") % partner_company.name
103+
self.env._("- The company %s has no zip code", partner_company.name)
102104
)
103105
return messages
104106

@@ -109,14 +111,16 @@ def _atc_validate_fields(self):
109111
messages = self._atc_get_messages()
110112
if messages:
111113
raise UserError(
112-
_("Please fix the following errors:\n%s") % "\n".join(messages)
114+
self.env._("Please fix the following errors:\n%s", "\n".join(messages))
113115
)
114116

115117
def _atc_get_country_state_code(self, country_state):
116118
codigo_provincia = SPANISH_STATES.get(country_state.code)
117119
if not codigo_provincia:
118120
raise UserError(
119-
_("The state code is not mapped for state: %s", country_state.code)
121+
self.env._(
122+
"The state code is not mapped for state: %s", country_state.code
123+
)
120124
)
121125
return codigo_provincia
122126

@@ -145,14 +149,19 @@ def _atc_run_cmd(self, report_name, filename, jar_filename, main_class):
145149
)
146150
if result.returncode != 0:
147151
raise UserError(
148-
f"Error al generar el modelo:\n"
149-
f"Código de salida: {result.returncode}\n"
150-
f"STDOUT:\n{result.stdout}\n"
151-
f"STDERR:\n{result.stderr}"
152+
self.env._(
153+
"Error al generar el modelo:\n"
154+
"Código de salida: %(returncode)s\n"
155+
"STDOUT:\n%(stdout)s\n"
156+
"STDERR:\n%(stderr)s",
157+
returncode=result.returncode,
158+
stdout=result.stdout,
159+
stderr=result.stderr,
160+
)
152161
)
153162
except Exception as e:
154163
raise UserError(
155-
_(f"Excepción durante la ejecución del comando:\n{ustr(e)}")
164+
self.env._("Excepción durante la ejecución del comando:\n%s", ustr(e))
156165
) from e
157166
# check if there are errors
158167
if os.path.exists(dir_paths["errores_path"]):
@@ -161,7 +170,7 @@ def _atc_run_cmd(self, report_name, filename, jar_filename, main_class):
161170
errores = f.read()
162171
if errores:
163172
raise UserError(
164-
_(
173+
self.env._(
165174
"No se pudo generar el archivo. Errores encontrados:\n %s",
166175
errores,
167176
)
@@ -233,7 +242,7 @@ def _get_or_download_atc_jar(self, jar_filename, timeout=60):
233242
url = ATC_JAR_URL.get(self._aeat_number)
234243
if not url:
235244
raise UserError(
236-
_(
245+
self.env._(
237246
"Please configure the JAR URL for %s "
238247
"by inheriting the variable `ATC_JAR_URL`.",
239248
self._aeat_number,
@@ -275,7 +284,7 @@ def _get_or_download_atc_jar(self, jar_filename, timeout=60):
275284
response.raise_for_status()
276285
except Exception as error:
277286
raise UserError(
278-
_(
287+
self.env._(
279288
"Error downloading the jar file from: %(url)s\n%(error)s",
280289
url=url,
281290
error=ustr(error),
@@ -284,7 +293,9 @@ def _get_or_download_atc_jar(self, jar_filename, timeout=60):
284293
content = response.content
285294
if not content:
286295
raise UserError(
287-
_("The HTTP response from %(url)s is empty (no content)", url=url)
296+
self.env._(
297+
"The HTTP response from %(url)s is empty (no content)", url=url
298+
)
288299
)
289300
jar_content = None
290301
with contextlib.suppress(zipfile.BadZipFile):
@@ -295,7 +306,7 @@ def _get_or_download_atc_jar(self, jar_filename, timeout=60):
295306
break
296307
if not jar_content:
297308
raise UserError(
298-
_(
309+
self.env._(
299310
"The jar file: %(jar_filename)s "
300311
"is not present in the zip file downloaded from: %(url)s",
301312
jar_filename=jar_filename,
@@ -325,7 +336,7 @@ def _atc_get_report_data(self, dir_paths, file_name):
325336
file_path
326337
):
327338
raise UserError(
328-
_(
339+
self.env._(
329340
"Declaracion no generada. Revisa si el XML es válido y "
330341
"los parámetros correctos."
331342
)
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
33
<odoo noupdate="1">
4+
<record model="res.groups.privilege" id="res_groups_privilege_atc">
5+
<field name="name">ATC Permissions</field>
6+
<field name="category_id" ref="base.module_category_hidden" />
7+
</record>
48
<record model="res.groups" id="group_account_atc">
59
<field name="name">ATC manager</field>
6-
<field name="category_id" ref="base.module_category_hidden" />
10+
<field name="privilege_id" ref="res_groups_privilege_atc" />
711
<field
8-
name="users"
9-
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
12+
name="user_ids"
13+
eval="[Command.link(ref('base.user_root')), Command.link(ref('base.user_admin'))]"
1014
/>
1115
</record>
1216
</odoo>

l10n_es_atc/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>ATC Menú</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:725c0aacae0db967c3cb2ac8248f7bf04e346db8ea27cf6905792a6e74142e07
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_atc"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_atc"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_atc"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-19-0/l10n-spain-19-0-l10n_es_atc"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>Módulo base para modelos de la Agencia Tributaria Canaria.</p>
379379
<p><strong>Table of contents</strong></p>
380380
<div class="contents local topic" id="contents">
@@ -406,7 +406,7 @@ <h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
406406
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-spain/issues">GitHub Issues</a>.
407407
In case of trouble, please check there if your issue has already been reported.
408408
If you spotted it first, help us to smash it by providing a detailed and welcomed
409-
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_atc%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
409+
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_atc%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
410410
<p>Do not contact contributors directly about support or help with technical issues.</p>
411411
</div>
412412
<div class="section" id="credits">
@@ -440,7 +440,7 @@ <h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
440440
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
441441
mission is to support the collaborative development of Odoo features and
442442
promote its widespread use.</p>
443-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_atc">OCA/l10n-spain</a> project on GitHub.</p>
443+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_atc">OCA/l10n-spain</a> project on GitHub.</p>
444444
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
445445
</div>
446446
</div>

l10n_es_atc/views/atc_menuitem.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<field name="name">ATC</field>
66
<field name="parent_id" ref="l10n_es_aeat.menu_root_aeat" />
77
<field name="sequence" eval="20" />
8-
<field name="groups_id" eval="[(4, ref('group_account_atc'))]" />
8+
<field name="group_ids" eval="[Command.link(ref('group_account_atc'))]" />
99
</record>
1010
<menuitem
1111
id="menu_l10n_es_atc_config"

0 commit comments

Comments
 (0)