Skip to content

Commit 26bbf9c

Browse files
committed
[MIG] l10n_it_vat_statement_communication: Migration to 18.0
1 parent 49f9387 commit 26bbf9c

File tree

8 files changed

+63
-59
lines changed

8 files changed

+63
-59
lines changed

l10n_it_vat_statement_communication/README.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ ITA - Comunicazione liquidazione IVA
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
20-
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_statement_communication
20+
:target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_statement_communication
2121
:alt: OCA/l10n-italy
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_vat_statement_communication
23+
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_vat_statement_communication
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -67,7 +67,7 @@ Bug Tracker
6767
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
6868
In case of trouble, please check there if your issue has already been reported.
6969
If you spotted it first, help us to smash it by providing a detailed and welcomed
70-
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_vat_statement_communication%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
70+
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_vat_statement_communication%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
7171

7272
Do not contact contributors directly about support or help with technical issues.
7373

@@ -85,6 +85,7 @@ Contributors
8585
- Alessandro Camilli
8686
- Lorenzo Battistini
8787
- Lara Baggio
88+
- `Nextev Srl <https://nextev.it>`__ odoo@nextev.it
8889

8990
Maintainers
9091
-----------
@@ -99,6 +100,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
99100
mission is to support the collaborative development of Odoo features and
100101
promote its widespread use.
101102

102-
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_statement_communication>`_ project on GitHub.
103+
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_statement_communication>`_ project on GitHub.
103104

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

l10n_it_vat_statement_communication/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"name": "ITA - Comunicazione liquidazione IVA",
66
"summary": "Comunicazione liquidazione IVA ed esportazione file xml"
77
"conforme alle specifiche dell'Agenzia delle Entrate",
8-
"version": "16.0.1.0.1",
8+
"version": "18.0.1.0.0",
99
"category": "Account",
1010
"author": "Openforce di Camilli Alessandro, Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/l10n-italy",
1212
"license": "AGPL-3",
1313
"depends": [
1414
"account_vat_period_end_statement",
1515
"l10n_it_appointment_code",
16-
"l10n_it_fiscalcode",
16+
"l10n_it_edi",
1717
],
1818
"data": [
1919
"security/ir.model.access.csv",

l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from lxml import etree
22

3-
from odoo import _, api, fields, models
3+
from odoo import api, fields, models
44
from odoo.exceptions import ValidationError
55

66
NS_IV = "urn:www.agenziaentrate.gov.it:specificheTecniche:sco:ivp"
@@ -29,7 +29,7 @@ def _check_identificativo(self):
2929
dichiarazioni = self.search(domain)
3030
if len(dichiarazioni) > 1:
3131
raise ValidationError(
32-
_("Communication with identifier {} already exists").format(
32+
self.env._("Communication with identifier {} already exists").format(
3333
self.identificativo
3434
)
3535
)
@@ -41,9 +41,9 @@ def _compute_name(self):
4141
if not name:
4242
period_type = ""
4343
if quadro.period_type == "month":
44-
period_type = _("month")
44+
period_type = self.env._("month")
4545
else:
46-
period_type = _("quarter")
46+
period_type = self.env._("quarter")
4747
name += f"{str(dich.year)} {period_type}"
4848
if quadro.period_type == "month":
4949
name += f", {str(quadro.month)}"
@@ -113,7 +113,7 @@ def onchange_company_id(self):
113113
self.taxpayer_vat = self.company_id.partner_id.vat[2:]
114114
else:
115115
self.taxpayer_vat = ""
116-
self.taxpayer_fiscalcode = self.company_id.partner_id.fiscalcode
116+
self.taxpayer_fiscalcode = self.company_id.partner_id.l10n_it_codice_fiscale
117117

118118
def get_export_xml(self):
119119
self._validate()
@@ -155,15 +155,15 @@ def _validate(self):
155155
self.ensure_one()
156156
# Anno obbligatorio
157157
if not self.year:
158-
raise ValidationError(_("Year required"))
158+
raise ValidationError(self.env._("Year required"))
159159

160160
# Codice Fiscale
161161
if not self.taxpayer_fiscalcode or len(self.taxpayer_fiscalcode) not in [
162162
11,
163163
16,
164164
]:
165165
raise ValidationError(
166-
_(
166+
self.env._(
167167
"Taxpayer Fiscalcode is required. It's accepted codes \
168168
with lenght 11 or 16 chars"
169169
)
@@ -177,7 +177,7 @@ def _validate(self):
177177
and not self.declarant_fiscalcode
178178
):
179179
raise ValidationError(
180-
_(
180+
self.env._(
181181
"Declarant Fiscalcode is required. You can enable the \
182182
section with different declarant option"
183183
)
@@ -190,22 +190,25 @@ def _validate(self):
190190
if self.liquidazione_del_gruppo:
191191
if self.controller_vat:
192192
raise ValidationError(
193-
_("For group's statement, controller's TIN must be empty")
193+
self.env._("For group's statement, controller's TIN must be empty")
194194
)
195195
if len(self.taxpayer_fiscalcode) == 16:
196196
raise ValidationError(
197-
_("Group's statement not valid, as fiscal code is 16 " "characters")
197+
self.env._(
198+
"Group's statement not valid, as fiscal code is 16 "
199+
"characters"
200+
)
198201
)
199202
# CodiceCaricaDichiarante
200203
if self.declarant_fiscalcode:
201204
if not self.codice_carica_id:
202-
raise ValidationError(_("Specify role code of declarant"))
205+
raise ValidationError(self.env._("Specify role code of declarant"))
203206
# CodiceFiscaleSocieta:
204207
# Obbligatori per codice carica 9
205208
if self.codice_carica_id and self.codice_carica_id.code == "9":
206209
if not self.declarant_fiscalcode_company:
207210
raise ValidationError(
208-
_(
211+
self.env._(
209212
"With this role code, you need to specify fiscal code "
210213
"of declarant company"
211214
)
@@ -214,22 +217,22 @@ def _validate(self):
214217
if self.delegate_fiscalcode:
215218
if not self.delegate_commitment:
216219
raise ValidationError(
217-
_(
220+
self.env._(
218221
"With intermediary fiscal code, you need to specify "
219222
"commitment code"
220223
)
221224
)
222225
if not self.date_commitment:
223226
raise ValidationError(
224-
_(
227+
self.env._(
225228
"With intermediary fiscal code, you need to specify "
226229
"commitment date"
227230
)
228231
)
229232
# ImpegnoPresentazione::
230233
if self.delegate_fiscalcode and not self.delegate_sign:
231234
raise ValidationError(
232-
_(
235+
self.env._(
233236
"With delegate in commitment section, you need to check "
234237
"'delegate sign'"
235238
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
- Alessandro Camilli
22
- Lorenzo Battistini
33
- Lara Baggio
4+
- [Nextev Srl](https://nextev.it) <odoo@nextev.it>

l10n_it_vat_statement_communication/static/description/index.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
/*
1010
:Author: David Goodger (goodger@python.org)
11-
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
11+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15-
Despite the name, some widely supported CSS2 features are used.
1615
1716
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1817
customize this style sheet.
@@ -275,7 +274,7 @@
275274
margin-left: 2em ;
276275
margin-right: 2em }
277276

278-
pre.code .ln { color: gray; } /* line numbers */
277+
pre.code .ln { color: grey; } /* line numbers */
279278
pre.code, code { background-color: #eeeeee }
280279
pre.code .comment, code .comment { color: #5C6576 }
281280
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +300,7 @@
301300
span.pre {
302301
white-space: pre }
303302

304-
span.problematic, pre.problematic {
303+
span.problematic {
305304
color: red }
306305

307306
span.section-subtitle {
@@ -369,7 +368,7 @@ <h1 class="title">ITA - Comunicazione liquidazione IVA</h1>
369368
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370369
!! source digest: sha256:ad2f827fa79eed0a540b62fbaeebe78c1f0d035c64ef6cdeb4b667162512aa9e
371370
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<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/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_statement_communication"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_vat_statement_communication"><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-italy&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371+
<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/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_statement_communication"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_vat_statement_communication"><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-italy&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373372
<p>Comunicazione liquidazione IVA ed export file XML, conforme alle
374373
specifiche dell’’Agenzia delle Entrate.</p>
375374
<p>I dati possono essere caricati da liquidazioni IVA effettuate in odoo
@@ -413,7 +412,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
413412
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
414413
In case of trouble, please check there if your issue has already been reported.
415414
If you spotted it first, help us to smash it by providing a detailed and welcomed
416-
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_vat_statement_communication%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
415+
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_vat_statement_communication%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
417416
<p>Do not contact contributors directly about support or help with technical issues.</p>
418417
</div>
419418
<div class="section" id="credits">
@@ -430,18 +429,17 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
430429
<li>Alessandro Camilli</li>
431430
<li>Lorenzo Battistini</li>
432431
<li>Lara Baggio</li>
432+
<li><a class="reference external" href="https://nextev.it">Nextev Srl</a> <a class="reference external" href="mailto:odoo&#64;nextev.it">odoo&#64;nextev.it</a></li>
433433
</ul>
434434
</div>
435435
<div class="section" id="maintainers">
436436
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
437437
<p>This module is maintained by the OCA.</p>
438-
<a class="reference external image-reference" href="https://odoo-community.org">
439-
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
440-
</a>
438+
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
441439
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
442440
mission is to support the collaborative development of Odoo features and
443441
promote its widespread use.</p>
444-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_statement_communication">OCA/l10n-italy</a> project on GitHub.</p>
442+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_statement_communication">OCA/l10n-italy</a> project on GitHub.</p>
445443
<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>
446444
</div>
447445
</div>

l10n_it_vat_statement_communication/tests/test_vat_statement_communication.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,15 @@ def test_onchange_company(self):
334334
old_company = comunicazione_liquidazione.company_id
335335

336336
old_company.partner_id.write(
337-
{"vat": "IT12345670017", "fiscalcode": "FNCPLC19D01I168X"}
337+
{"vat": "IT12345670017", "l10n_it_codice_fiscale": "FNCPLC19D01I168X"}
338338
)
339339

340340
company = self.env["res.company"].create(
341-
{"name": "foo", "vat": "IT12345670017", "fiscalcode": "FNCPLC19D01I168X"}
341+
{
342+
"name": "foo",
343+
"vat": "IT12345670017",
344+
"l10n_it_codice_fiscale": "FNCPLC19D01I168X",
345+
}
342346
)
343347

344348
with Form(comunicazione_liquidazione) as invoice_form:
@@ -349,7 +353,7 @@ def test_onchange_company(self):
349353
)
350354
self.assertEqual(
351355
comunicazione_liquidazione.taxpayer_fiscalcode,
352-
company.partner_id.fiscalcode,
356+
company.partner_id.l10n_it_codice_fiscale,
353357
)
354358

355359
with Form(comunicazione_liquidazione) as invoice_form:
@@ -360,7 +364,7 @@ def test_onchange_company(self):
360364
)
361365
self.assertEqual(
362366
comunicazione_liquidazione.taxpayer_fiscalcode,
363-
old_company.partner_id.fiscalcode,
367+
old_company.partner_id.l10n_it_codice_fiscale,
364368
)
365369

366370
def _check_file_report(self, comunicazione_liquidazione):

0 commit comments

Comments
 (0)