Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions l10n_it_edi_doi_extension/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=====================================
Declaration of Intent for Italy (OCA)
=====================================
Expand All @@ -17,7 +13,7 @@ Declaration of Intent for Italy (OCA)
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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
Expand All @@ -40,11 +36,11 @@ vendor bills and purchase orders.

Key features:

- Support for multiple Declarations of Intent per invoice
- Dedicated tab in invoice form for managing DOI associations
- Automatic validation of DOI amounts and available thresholds
- Smart warnings when invoice amounts don't match DOI coverage
- Backward compatibility with single-declaration workflow
- Support for multiple Declarations of Intent per invoice
- Dedicated tab in invoice form for managing DOI associations
- Automatic validation of DOI amounts and available thresholds
- Smart warnings when invoice amounts don't match DOI coverage
- Backward compatibility with single-declaration workflow

**Italiano**

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

Caratteristiche principali:

- Supporto per dichiarazioni di intento multiple per fattura
- Tab dedicato nel form fattura per gestire le associazioni DOI
- Validazione automatica degli importi e soglie disponibili
- Avvisi intelligenti quando gli importi non corrispondono
- Retrocompatibilità con il flusso a dichiarazione singola
- Supporto per dichiarazioni di intento multiple per fattura
- Tab dedicato nel form fattura per gestire le associazioni DOI
- Validazione automatica degli importi e soglie disponibili
- Avvisi intelligenti quando gli importi non corrispondono
- Retrocompatibilità con il flusso a dichiarazione singola

**Table of contents**

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

- "Issued from company": for declarations issued by the company.
- "Received from customer": for declarations received from suppliers.
- "Issued from company": for declarations issued by the company.
- "Received from customer": for declarations received from suppliers.

**Multiple Declarations of Intent:**

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

- Validate that amounts don't exceed available thresholds
- Show a warning if total DOI amounts don't match invoice amount
- Update the invoiced amounts on each declaration
- Generate protocol numbers in the XML export
- Validate that amounts don't exceed available thresholds
- Show a warning if total DOI amounts don't match invoice amount
- Update the invoiced amounts on each declaration
- Generate protocol numbers in the XML export

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

- "Issued from company": per le dichiarazioni emesse dall'azienda.
- "Received from customer": per le dichiarazioni ricevute dai fornitori.
- "Issued from company": per le dichiarazioni emesse dall'azienda.
- "Received from customer": per le dichiarazioni ricevute dai
fornitori.

**Dichiarazioni di Intento Multiple:**

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

- Valida che gli importi non superino le soglie disponibili
- Mostra un avviso se il totale DOI non corrisponde all'importo
fattura
- Aggiorna gli importi fatturati su ogni dichiarazione
- Genera i numeri di protocollo nell'esportazione XML
- Valida che gli importi non superino le soglie disponibili
- Mostra un avviso se il totale DOI non corrisponde all'importo
fattura
- Aggiorna gli importi fatturati su ogni dichiarazione
- Genera i numeri di protocollo nell'esportazione XML

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

- Nextev Srl<odoo@nextev.it>
- Nextev Srl<odoo@nextev.it>
- `Stesi Consulting <https://www.stesi.consulting>`__:

- Michele Di Croce <dicroce.m@stesi.consulting>

Maintainers
-----------
Expand Down
11 changes: 1 addition & 10 deletions l10n_it_edi_doi_extension/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ def _compute_l10n_it_edi_doi_amount(self):
move.l10n_it_edi_doi_amount = 0
continue
declaration_lines = move.invoice_line_ids.filtered(
# The declaration tax cannot be used with other taxes on a single line
# (checked in `_post`)
lambda line, tax=tax: line.tax_ids.ids == tax.ids
lambda line, tax=tax: tax in line.tax_ids
)
move.l10n_it_edi_doi_amount = sum(declaration_lines.mapped("price_total"))
return # W8110
Expand Down Expand Up @@ -169,13 +167,6 @@ def _post(self, soft=True):
doi_bill_tax.name,
)
)
if any(line.tax_ids != doi_bill_tax for line in declaration_lines):
errors.append(
_(
"A line using tax %s should not contain any other taxes",
doi_bill_tax.name,
)
)
if errors:
raise UserError("\n".join(errors))
return super()._post(soft)
Expand Down
3 changes: 3 additions & 0 deletions l10n_it_edi_doi_extension/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
- Nextev Srl\<<odoo@nextev.it>\>
- [Stesi Consulting](https://www.stesi.consulting):
- Michele Di Croce \<<dicroce.m@stesi.consulting>\>

33 changes: 16 additions & 17 deletions l10n_it_edi_doi_extension/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Declaration of Intent for Italy (OCA)</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="declaration-of-intent-for-italy-oca">
<h1 class="title">Declaration of Intent for Italy (OCA)</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="declaration-of-intent-for-italy-oca">
<h1>Declaration of Intent for Italy (OCA)</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:dd3f65ff3d3ab5dfa833e27947ecec69833e36661bb35bfd01abda6583856522
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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>
<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>
<p><strong>English</strong></p>
<p>This module extends the functionality of l10n_it_edi_doi, enabling the
use of the Declaration of Intent (Dichiarazione di Intento) for incoming
Expand Down Expand Up @@ -413,7 +408,7 @@ <h1>Declaration of Intent for Italy (OCA)</h1>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p><strong>English</strong></p>
<p>In the company configuration, it is necessary to define a dedicated tax
for the Declaration of Intent for incoming vendor bills.</p>
Expand Down Expand Up @@ -447,7 +442,8 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
due tipologie:</p>
<ul class="simple">
<li>“Issued from company”: per le dichiarazioni emesse dall’azienda.</li>
<li>“Received from customer”: per le dichiarazioni ricevute dai fornitori.</li>
<li>“Received from customer”: per le dichiarazioni ricevute dai
fornitori.</li>
</ul>
<p><strong>Dichiarazioni di Intento Multiple:</strong></p>
<p>Durante la creazione o modifica di una fattura fornitore, è ora
Expand All @@ -470,29 +466,33 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
fatture diverse.</p>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
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
<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>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Nextev Srl</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Nextev Srl&lt;<a class="reference external" href="mailto:odoo&#64;nextev.it">odoo&#64;nextev.it</a>&gt;</li>
<li><a class="reference external" href="https://www.stesi.consulting">Stesi Consulting</a>:<ul>
<li>Michele Di Croce &lt;<a class="reference external" href="mailto:dicroce.m&#64;stesi.consulting">dicroce.m&#64;stesi.consulting</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -505,6 +505,5 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
Loading