Skip to content

Commit

Permalink
l10n_it_fatturapa_out_oss: backporting to 14.0
Browse files Browse the repository at this point in the history
FIX l10n_it_fatturapa_out: it does not depend on l10n_eu_oss_oca so it can't use oss_country_id
  • Loading branch information
eLBati committed Jan 12, 2024
1 parent 9857de5 commit 91e7bef
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 36 deletions.
12 changes: 6 additions & 6 deletions l10n_it_fatturapa_out_oss/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ITA - Fattura elettronica - Emissione - OSS
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:677c39673d4af845f6ce0c075e1f472c13abe55c7a96c8fdad2ef23e33d59077
!! source digest: sha256:88fe86904abb0356b30b42262b7e64b67957992e2cd4a8321bf89c57f7168ef9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
Expand All @@ -17,13 +17,13 @@ ITA - Fattura elettronica - Emissione - OSS
: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
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_out_oss
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_out_oss
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_fatturapa_out_oss
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_out_oss
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -52,7 +52,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
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
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_out_oss%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_out_oss%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -86,6 +86,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_out_oss>`_ project on GitHub.
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_out_oss>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions l10n_it_fatturapa_out_oss/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "ITA - Fattura elettronica - Emissione - OSS",
"version": "16.0.1.0.0",
"version": "14.0.1.0.0",
"development_status": "Alpha",
"category": "Localization/Italy",
"summary": "OSS in fatturapa",
Expand All @@ -11,7 +11,7 @@
"license": "AGPL-3",
"depends": [
"l10n_it_fatturapa_out",
"l10n_eu_oss_oca",
"l10n_eu_oss",
],
"data": [
"data/invoice_it_template.xml",
Expand Down
14 changes: 7 additions & 7 deletions l10n_it_fatturapa_out_oss/data/invoice_it_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
<AliquotaIVA>0.00</AliquotaIVA>
<Natura
t-if="tax_data.get('Natura', False)"
t-out="tax_data['Natura']"
t-esc="tax_data['Natura']"
/>
<ImponibileImporto
t-out="format_monetary(fpa_to_eur(tax_data['ImponibileImporto'], record), euro)"
t-esc="format_monetary(fpa_to_eur(tax_data['ImponibileImporto'], record), euro)"
/>
<Imposta>0.00</Imposta>
<EsigibilitaIVA
t-if="tax_data.get('EsigibilitaIVA', False)"
t-out="tax_data['EsigibilitaIVA']"
t-esc="tax_data['EsigibilitaIVA']"
/>
<RiferimentoNormativo
t-if="tax_data.get('RiferimentoNormativo', False)"
t-out="encode_for_export(tax_data['RiferimentoNormativo'], 100)"
t-esc="encode_for_export(tax_data['RiferimentoNormativo'], 100)"
/>
</DatiRiepilogo>
</xpath>
Expand All @@ -50,20 +50,20 @@
position="attributes"
>
<attribute
name="t-out"
name="t-esc"
>format_numbers(0) if tax_ids and tax_ids.oss_country_id and tax_ids.kind_id else format_numbers(tax_ids.amount)</attribute>
</xpath>
<xpath expr="//AliquotaIVA[@t-if='line_is_section_note']">
<attribute
name="t-out"
name="t-esc"
>format_numbers(0) if tax_ids and tax_ids.oss_country_id and tax_ids.kind_id else existing_tax_line['AliquotaIVA']</attribute>
</xpath>
<xpath expr="//DettaglioLinee">
<AltriDatiGestionali
t-if="tax_ids and tax_ids.oss_country_id and tax_ids.kind_id"
>
<TipoDato>OSS</TipoDato>
<RiferimentoTesto t-out="format_numbers(tax_ids.amount)" />
<RiferimentoTesto t-esc="format_numbers(tax_ids.amount)" />
</AltriDatiGestionali>
</xpath>
</template>
Expand Down
36 changes: 18 additions & 18 deletions l10n_it_fatturapa_out_oss/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>ITA - Fattura elettronica - Emissione - OSS</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

Expand Down Expand Up @@ -367,9 +367,9 @@ <h1 class="title">ITA - Fattura elettronica - Emissione - OSS</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:677c39673d4af845f6ce0c075e1f472c13abe55c7a96c8fdad2ef23e33d59077
!! source digest: sha256:88fe86904abb0356b30b42262b7e64b67957992e2cd4a8321bf89c57f7168ef9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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_fatturapa_out_oss"><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_fatturapa_out_oss"><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>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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/14.0/l10n_it_fatturapa_out_oss"><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-14-0/l10n-italy-14-0-l10n_it_fatturapa_out_oss"><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=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><strong>Italiano</strong></p>
<p>Modulo tecnico di integrazione tra l10n_eu_oss e l10n_it_fatturapa_out</p>
<p><strong>English</strong></p>
Expand All @@ -383,33 +383,33 @@ <h1 class="title">ITA - Fattura elettronica - Emissione - OSS</h1>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-1">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_fatturapa_out_oss%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_out_oss%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Sergio Corato</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Sergio Corato &lt;<a class="reference external" href="https://github.com/sergiocorato">https://github.com/sergiocorato</a>&gt;</li>
<li><a class="reference external" href="https://takobi.online">TAKOBI</a>:<ul>
Expand All @@ -419,13 +419,13 @@ <h2><a class="toc-backref" href="#id4">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">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" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_out_oss">OCA/l10n-italy</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_out_oss">OCA/l10n-italy</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<TipoDocumento>TD01</TipoDocumento>
<Divisa>EUR</Divisa>
<Data>2022-02-28</Data>
<Numero>INV/2022/00001</Numero>
<Numero>INV/2022/02/0001</Numero>
<ImportoTotaleDocumento>16.80</ImportoTotaleDocumento>
</DatiGeneraliDocumento>
</DatiGenerali>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<TipoDocumento>TD01</TipoDocumento>
<Divisa>EUR</Divisa>
<Data>2023-02-28</Data>
<Numero>INV/2023/00001</Numero>
<Numero>INV/2023/02/0001</Numero>
<ImportoTotaleDocumento>17.08</ImportoTotaleDocumento>
</DatiGeneraliDocumento>
</DatiGenerali>
Expand Down
1 change: 1 addition & 0 deletions l10n_it_fatturapa_out_oss/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import l10n_eu_oss_wizard
from . import wizard_export_fatturapa
4 changes: 3 additions & 1 deletion l10n_it_fatturapa_out_oss/wizard/l10n_eu_oss_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class L10nEuOssWizard(models.TransientModel):
_inherit = "l10n.eu.oss.wizard"

def _prepare_tax_vals(self, country, tax, rate, tax_group):
vals = super(L10nEuOssWizard, self)._prepare_tax_vals(country, tax, rate, tax_group)
vals = super(L10nEuOssWizard, self)._prepare_tax_vals(

Check warning on line 8 in l10n_it_fatturapa_out_oss/wizard/l10n_eu_oss_wizard.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_fatturapa_out_oss/wizard/l10n_eu_oss_wizard.py#L8

Added line #L8 was not covered by tests
country, tax, rate, tax_group
)
vals["kind_id"] = self.env.ref("l10n_it_account_tax_kind.n3_2").id
return vals

Check warning on line 12 in l10n_it_fatturapa_out_oss/wizard/l10n_eu_oss_wizard.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_fatturapa_out_oss/wizard/l10n_eu_oss_wizard.py#L11-L12

Added lines #L11 - L12 were not covered by tests
13 changes: 13 additions & 0 deletions l10n_it_fatturapa_out_oss/wizard/wizard_export_fatturapa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from odoo import api, models


class WizardExportFatturapa(models.TransientModel):
_inherit = "wizard.export.fatturapa"

@api.model
def getAllTaxes(self, invoice):
out = super().getAllTaxes(invoice)
for tax_line_id in out:
tax_line = self.env["account.tax"].browse(tax_line_id)
out[tax_line_id]["Oss Country"] = tax_line.oss_country_id
return out
6 changes: 6 additions & 0 deletions setup/l10n_it_fatturapa_out_oss/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 91e7bef

Please sign in to comment.