Skip to content

Commit c98dbde

Browse files
committed
[FIX] l10n_it_edi_doi_extension: removed check on DOI tax to accept also other taxes
This PR is created to accept other taxes than DOI(for example inarcassa) removed also on odoo core odoo/odoo@b88caf8
1 parent 921ada6 commit c98dbde

File tree

5 files changed

+101
-78
lines changed

5 files changed

+101
-78
lines changed

l10n_it_edi_doi_extension/README.rst

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
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-
51
=====================================
62
Declaration of Intent for Italy (OCA)
73
=====================================
@@ -17,7 +13,7 @@ Declaration of Intent for Italy (OCA)
1713
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1814
:target: https://odoo-community.org/page/development-status
1915
:alt: Beta
20-
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
2117
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2218
:alt: License: AGPL-3
2319
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
@@ -40,11 +36,11 @@ vendor bills and purchase orders.
4036

4137
Key features:
4238

43-
- Support for multiple Declarations of Intent per invoice
44-
- Dedicated tab in invoice form for managing DOI associations
45-
- Automatic validation of DOI amounts and available thresholds
46-
- Smart warnings when invoice amounts don't match DOI coverage
47-
- Backward compatibility with single-declaration workflow
39+
- Support for multiple Declarations of Intent per invoice
40+
- Dedicated tab in invoice form for managing DOI associations
41+
- Automatic validation of DOI amounts and available thresholds
42+
- Smart warnings when invoice amounts don't match DOI coverage
43+
- Backward compatibility with single-declaration workflow
4844

4945
**Italiano**
5046

@@ -54,11 +50,11 @@ ingresso e gli ordini di acquisto.
5450

5551
Caratteristiche principali:
5652

57-
- Supporto per dichiarazioni di intento multiple per fattura
58-
- Tab dedicato nel form fattura per gestire le associazioni DOI
59-
- Validazione automatica degli importi e soglie disponibili
60-
- Avvisi intelligenti quando gli importi non corrispondono
61-
- Retrocompatibilità con il flusso a dichiarazione singola
53+
- Supporto per dichiarazioni di intento multiple per fattura
54+
- Tab dedicato nel form fattura per gestire le associazioni DOI
55+
- Validazione automatica degli importi e soglie disponibili
56+
- Avvisi intelligenti quando gli importi non corrispondono
57+
- Retrocompatibilità con il flusso a dichiarazione singola
6258

6359
**Table of contents**
6460

@@ -76,8 +72,8 @@ for the Declaration of Intent for incoming vendor bills.
7672
In the contacts, you can create a Declaration of Intent by choosing
7773
between two types:
7874

79-
- "Issued from company": for declarations issued by the company.
80-
- "Received from customer": for declarations received from suppliers.
75+
- "Issued from company": for declarations issued by the company.
76+
- "Received from customer": for declarations received from suppliers.
8177

8278
**Multiple Declarations of Intent:**
8379

@@ -89,10 +85,10 @@ Declarations of Intent:
8985
3. For each declaration, specify the amount to be covered
9086
4. The module will automatically:
9187

92-
- Validate that amounts don't exceed available thresholds
93-
- Show a warning if total DOI amounts don't match invoice amount
94-
- Update the invoiced amounts on each declaration
95-
- Generate protocol numbers in the XML export
88+
- Validate that amounts don't exceed available thresholds
89+
- Show a warning if total DOI amounts don't match invoice amount
90+
- Update the invoiced amounts on each declaration
91+
- Generate protocol numbers in the XML export
9692

9793
You can also use the traditional single-declaration field for backward
9894
compatibility, or mix both approaches for different invoices.
@@ -104,8 +100,9 @@ dedicata alla Dichiarazione di Intento per le fatture in ingresso. Nei
104100
contatti è possibile creare una Dichiarazione di Intento scegliendo tra
105101
due tipologie:
106102

107-
- "Issued from company": per le dichiarazioni emesse dall'azienda.
108-
- "Received from customer": per le dichiarazioni ricevute dai fornitori.
103+
- "Issued from company": per le dichiarazioni emesse dall'azienda.
104+
- "Received from customer": per le dichiarazioni ricevute dai
105+
fornitori.
109106

110107
**Dichiarazioni di Intento Multiple:**
111108

@@ -117,11 +114,11 @@ possibile associare più Dichiarazioni di Intento:
117114
3. Per ogni dichiarazione, specifica l'importo da coprire
118115
4. Il modulo automaticamente:
119116

120-
- Valida che gli importi non superino le soglie disponibili
121-
- Mostra un avviso se il totale DOI non corrisponde all'importo
122-
fattura
123-
- Aggiorna gli importi fatturati su ogni dichiarazione
124-
- Genera i numeri di protocollo nell'esportazione XML
117+
- Valida che gli importi non superino le soglie disponibili
118+
- Mostra un avviso se il totale DOI non corrisponde all'importo
119+
fattura
120+
- Aggiorna gli importi fatturati su ogni dichiarazione
121+
- Genera i numeri di protocollo nell'esportazione XML
125122

126123
È possibile continuare ad usare il campo tradizionale a dichiarazione
127124
singola per retrocompatibilità, o combinare entrambi gli approcci per
@@ -148,7 +145,10 @@ Authors
148145
Contributors
149146
------------
150147

151-
- Nextev Srl<odoo@nextev.it>
148+
- Nextev S.r.l<odoo@nextev.it>
149+
- `Stesi Consulting <https://www.stesi.consulting>`__:
150+
151+
- Michele Di Croce <dicroce.m@stesi.consulting>
152152

153153
Maintainers
154154
-----------

l10n_it_edi_doi_extension/models/account_move.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ def _compute_l10n_it_edi_doi_amount(self):
109109
other_move_ids = self - purchase_move_ids
110110
super(AccountMove, other_move_ids)._compute_l10n_it_edi_doi_amount()
111111
for move in purchase_move_ids:
112-
tax = move.company_id.l10n_it_edi_doi_bill_tax_id
113-
if not tax or not move.l10n_it_edi_doi_id:
112+
l10n_it_edi_doi_bill_tax_ids = move.company_id.l10n_it_edi_doi_bill_tax_id
113+
if not l10n_it_edi_doi_bill_tax_ids or not move.l10n_it_edi_doi_id:
114114
move.l10n_it_edi_doi_amount = 0
115115
continue
116116
declaration_lines = move.invoice_line_ids.filtered(
117-
# The declaration tax cannot be used with other taxes on a single line
118-
# (checked in `_post`)
119-
lambda line, tax=tax: line.tax_ids.ids == tax.ids
117+
lambda line,
118+
l10n_it_edi_doi_bill_tax_ids=l10n_it_edi_doi_bill_tax_ids: all(
119+
tax in line.tax_ids for tax in l10n_it_edi_doi_bill_tax_ids
120+
)
120121
)
121122
move.l10n_it_edi_doi_amount = sum(declaration_lines.mapped("price_total"))
122123
return # W8110
@@ -169,13 +170,6 @@ def _post(self, soft=True):
169170
doi_bill_tax.name,
170171
)
171172
)
172-
if any(line.tax_ids != doi_bill_tax for line in declaration_lines):
173-
errors.append(
174-
_(
175-
"A line using tax %s should not contain any other taxes",
176-
doi_bill_tax.name,
177-
)
178-
)
179173
if errors:
180174
raise UserError("\n".join(errors))
181175
return super()._post(soft)
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
- Nextev Srl\<<odoo@nextev.it>\>
1+
- Nextev S.r.l\<<odoo@nextev.it>\>
2+
- [Stesi Consulting](https://www.stesi.consulting):
3+
- Michele Di Croce \<<dicroce.m@stesi.consulting>\>
4+

l10n_it_edi_doi_extension/static/description/index.html

Lines changed: 17 additions & 18 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>README.rst</title>
6+
<title>Declaration of Intent for Italy (OCA)</title>
77
<style type="text/css">
88

99
/*
@@ -360,21 +360,16 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document">
363+
<div class="document" id="declaration-of-intent-for-italy-oca">
364+
<h1 class="title">Declaration of Intent for Italy (OCA)</h1>
364365

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="declaration-of-intent-for-italy-oca">
370-
<h1>Declaration of Intent for Italy (OCA)</h1>
371366
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
372367
!! This file is generated by oca-gen-addon-readme !!
373368
!! changes will be overwritten. !!
374369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375370
!! source digest: sha256:dd3f65ff3d3ab5dfa833e27947ecec69833e36661bb35bfd01abda6583856522
376371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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-italy/tree/18.0/l10n_it_edi_doi_extension"><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_doi_extension"><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>
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/18.0/l10n_it_edi_doi_extension"><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_doi_extension"><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>
378373
<p><strong>English</strong></p>
379374
<p>This module extends the functionality of l10n_it_edi_doi, enabling the
380375
use of the Declaration of Intent (Dichiarazione di Intento) for incoming
@@ -413,7 +408,7 @@ <h1>Declaration of Intent for Italy (OCA)</h1>
413408
</ul>
414409
</div>
415410
<div class="section" id="usage">
416-
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
411+
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
417412
<p><strong>English</strong></p>
418413
<p>In the company configuration, it is necessary to define a dedicated tax
419414
for the Declaration of Intent for incoming vendor bills.</p>
@@ -447,7 +442,8 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
447442
due tipologie:</p>
448443
<ul class="simple">
449444
<li>“Issued from company”: per le dichiarazioni emesse dall’azienda.</li>
450-
<li>“Received from customer”: per le dichiarazioni ricevute dai fornitori.</li>
445+
<li>“Received from customer”: per le dichiarazioni ricevute dai
446+
fornitori.</li>
451447
</ul>
452448
<p><strong>Dichiarazioni di Intento Multiple:</strong></p>
453449
<p>Durante la creazione o modifica di una fattura fornitore, è ora
@@ -470,29 +466,33 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
470466
fatture diverse.</p>
471467
</div>
472468
<div class="section" id="bug-tracker">
473-
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
469+
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
474470
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
475471
In case of trouble, please check there if your issue has already been reported.
476472
If you spotted it first, help us to smash it by providing a detailed and welcomed
477473
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_edi_doi_extension%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
478474
<p>Do not contact contributors directly about support or help with technical issues.</p>
479475
</div>
480476
<div class="section" id="credits">
481-
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
477+
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
482478
<div class="section" id="authors">
483-
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
479+
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
484480
<ul class="simple">
485481
<li>Nextev Srl</li>
486482
</ul>
487483
</div>
488484
<div class="section" id="contributors">
489-
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
485+
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
490486
<ul class="simple">
491-
<li>Nextev Srl&lt;<a class="reference external" href="mailto:odoo&#64;nextev.it">odoo&#64;nextev.it</a>&gt;</li>
487+
<li>Nextev S.r.l&lt;<a class="reference external" href="mailto:odoo&#64;nextev.it">odoo&#64;nextev.it</a>&gt;</li>
488+
<li><a class="reference external" href="https://www.stesi.consulting">Stesi Consulting</a>:<ul>
489+
<li>Michele Di Croce &lt;<a class="reference external" href="mailto:dicroce.m&#64;stesi.consulting">dicroce.m&#64;stesi.consulting</a>&gt;</li>
490+
</ul>
491+
</li>
492492
</ul>
493493
</div>
494494
<div class="section" id="maintainers">
495-
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
495+
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
496496
<p>This module is maintained by the OCA.</p>
497497
<a class="reference external image-reference" href="https://odoo-community.org">
498498
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -505,6 +505,5 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
505505
</div>
506506
</div>
507507
</div>
508-
</div>
509508
</body>
510509
</html>

0 commit comments

Comments
 (0)