Skip to content

Commit be1dd5d

Browse files
committed
[MIG] l10n_it_edi_sdi: Migration to 19.0
1 parent bb84e4a commit be1dd5d

4 files changed

Lines changed: 42 additions & 24 deletions

File tree

l10n_it_edi_sdi/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
======================================
26
ITA - Fattura elettronica - Canale SdI
37
======================================
@@ -13,17 +17,17 @@ ITA - Fattura elettronica - Canale SdI
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1822
:alt: License: LGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
20-
:target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_sdi
24+
:target: https://github.com/OCA/l10n-italy/tree/19.0/l10n_it_edi_sdi
2125
:alt: OCA/l10n-italy
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_edi_sdi
27+
:target: https://translation.odoo-community.org/projects/l10n-italy-19-0/l10n-italy-19-0-l10n_it_edi_sdi
2428
:alt: Translate me on Weblate
2529
.. |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=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=19.0
2731
:alt: Try me on Runboat
2832

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

8084
Do not contact contributors directly about support or help with technical issues.
8185

@@ -107,6 +111,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
107111
mission is to support the collaborative development of Odoo features and
108112
promote its widespread use.
109113

110-
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_sdi>`_ project on GitHub.
114+
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/19.0/l10n_it_edi_sdi>`_ project on GitHub.
111115

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

l10n_it_edi_sdi/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "ITA - Fattura elettronica - Canale SdI",
5-
"version": "18.0.1.0.0",
5+
"version": "19.0.1.0.0",
66
"category": "Localization/Italy",
77
"summary": "Logica condivisa per la comunicazione con lo SdI",
88
"author": "Odoo Community Association (OCA)",

l10n_it_edi_sdi/models/mail_thread.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def _l10n_it_edi_sdi_process_incoming_invoices(
8282
continue
8383

8484
# Create empty move and attachment
85-
move = AccountMove.with_company(company).create({})
8685
attachment = (
8786
self.env["ir.attachment"]
8887
.sudo()
@@ -92,19 +91,28 @@ def _l10n_it_edi_sdi_process_incoming_invoices(
9291
"name": filename,
9392
"raw": content,
9493
"type": "binary",
94+
}
95+
)
96+
)
97+
files_data = self.env["account.move"]._to_files_data(attachment)
98+
files_data.extend(self.env["account.move"]._unwrap_attachments(files_data))
99+
100+
moves = AccountMove.with_company(company).create([{}] * len(files_data))
101+
for move, file_data in zip(moves, files_data, strict=False):
102+
attachment = file_data["attachment"]
103+
attachment.write(
104+
{
95105
"res_model": "account.move",
96106
"res_id": move.id,
97107
"res_field": "l10n_it_edi_attachment_file",
98108
}
99109
)
100-
)
101-
move.with_context(
102-
account_predictive_bills_disable_prediction=True,
103-
no_new_invoice=True,
104-
).message_post(attachment_ids=attachment.ids)
110+
move.l10n_it_edi_attachment_name = file_data.get("name", "")
111+
move.message_post(attachment_ids=attachment.ids)
105112

106113
# Parse the XML and populate the move fields
107-
move._extend_with_attachments(move.l10n_it_edi_attachment_id, new=True)
114+
for move, file_data in zip(moves, files_data, strict=False):
115+
move._extend_with_attachments([file_data], new=True)
108116

109117
_logger.info(
110118
"Processed incoming FatturaPA with Message-Id: %s",

l10n_it_edi_sdi/static/description/index.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>ITA - Fattura elettronica - Canale SdI</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="ita-fattura-elettronica-canale-sdi">
364-
<h1 class="title">ITA - Fattura elettronica - Canale SdI</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="ita-fattura-elettronica-canale-sdi">
370+
<h1>ITA - Fattura elettronica - Canale SdI</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:6efdb74869d165eb01d3af48634ff367395ca040adef1cf9c1ce9974fc03f1dd
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_sdi"><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_edi_sdi"><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>
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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/19.0/l10n_it_edi_sdi"><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-19-0/l10n-italy-19-0-l10n_it_edi_sdi"><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=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p><strong>Italiano</strong></p>
374379
<p>Questo modulo fornisce la logica condivisa per la comunicazione con il
375380
Sistema di Interscambio (SdI), indipendente dal canale di trasporto
@@ -412,17 +417,17 @@ <h1 class="title">ITA - Fattura elettronica - Canale SdI</h1>
412417
</ul>
413418
</div>
414419
<div class="section" id="bug-tracker">
415-
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
420+
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
416421
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
417422
In case of trouble, please check there if your issue has already been reported.
418423
If you spotted it first, help us to smash it by providing a detailed and welcomed
419-
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_edi_sdi%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
424+
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_edi_sdi%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
420425
<p>Do not contact contributors directly about support or help with technical issues.</p>
421426
</div>
422427
<div class="section" id="credits">
423-
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
428+
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
424429
<div class="section" id="contributors">
425-
<h2><a class="toc-backref" href="#toc-entry-3">Contributors</a></h2>
430+
<h3><a class="toc-backref" href="#toc-entry-3">Contributors</a></h3>
426431
<ul class="simple">
427432
<li>Sergio Corato &lt;<a class="reference external" href="mailto:info&#64;efatto.it">info&#64;efatto.it</a>&gt;</li>
428433
<li>Lorenzo Battistini &lt;<a class="reference external" href="https://github.com/eLBati">https://github.com/eLBati</a>&gt;</li>
@@ -435,18 +440,19 @@ <h2><a class="toc-backref" href="#toc-entry-3">Contributors</a></h2>
435440
</ul>
436441
</div>
437442
<div class="section" id="maintainers">
438-
<h2><a class="toc-backref" href="#toc-entry-4">Maintainers</a></h2>
443+
<h3><a class="toc-backref" href="#toc-entry-4">Maintainers</a></h3>
439444
<p>This module is maintained by the OCA.</p>
440445
<a class="reference external image-reference" href="https://odoo-community.org">
441446
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
442447
</a>
443448
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
444449
mission is to support the collaborative development of Odoo features and
445450
promote its widespread use.</p>
446-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_sdi">OCA/l10n-italy</a> project on GitHub.</p>
451+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/19.0/l10n_it_edi_sdi">OCA/l10n-italy</a> project on GitHub.</p>
447452
<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>
448453
</div>
449454
</div>
450455
</div>
456+
</div>
451457
</body>
452458
</html>

0 commit comments

Comments
 (0)