Skip to content

Commit

Permalink
[MIG] l10n_it_fatturapa_out_rc: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jado95 committed Mar 17, 2023
1 parent 00840b5 commit 051210a
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 57 deletions.
13 changes: 8 additions & 5 deletions l10n_it_fatturapa_out_rc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ ITA - Emissione e-fattura con reverse charge
: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/14.0/l10n_it_fatturapa_out_rc
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_out_rc
: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-14-0/l10n-italy-14-0-l10n_it_fatturapa_out_rc
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_fatturapa_out_rc
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/122/14.0
:target: https://runbot.odoo-community.org/runbot/122/16.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -59,7 +59,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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_out_rc%0Aversion:%2014.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_rc%0Aversion:%2016.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 All @@ -80,6 +80,9 @@ Contributors
* `Agile Business Group <https://agilebg.com>`_:

* Alex Comba <alex.comba@agilebg.com>
* `Dinamiche Aziendali <https://www.dinamicheaziendali.it>`_:

* Gianmarco Conte <gconte@dinamicheaziendali.it>

Maintainers
~~~~~~~~~~~
Expand All @@ -102,6 +105,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-eLBati|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out_rc/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "ITA - Emissione e-fattura con reverse charge",
"summary": "Integrazione l10n_it_fatturapa_out e l10n_it_reverse_charge",
"version": "14.0.1.3.0",
"version": "16.0.1.0.0",
"development_status": "Beta",
"category": "Hidden",
"website": "https://github.com/OCA/l10n-italy",
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out_rc/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-12-25 05:47+0000\n"
"PO-Revision-Date: 2022-03-02 18:31+0000\n"
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out_rc/i18n/l10n_it_fatturapa_out_rc.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
3 changes: 2 additions & 1 deletion l10n_it_fatturapa_out_rc/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def generate_self_invoice(self):
return res

def button_draft(self):
super().button_draft()
res = super().button_draft()
for inv in self:
if not inv.env.context.get(
"rc_set_to_draft"
Expand All @@ -43,6 +43,7 @@ def button_draft(self):
"Validate vendor invoice before."
)
)
return res

def preventive_checks(self):
super().preventive_checks()
Expand Down
3 changes: 3 additions & 0 deletions l10n_it_fatturapa_out_rc/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
* `Agile Business Group <https://agilebg.com>`_:

* Alex Comba <alex.comba@agilebg.com>
* `Dinamiche Aziendali <https://www.dinamicheaziendali.it>`_:

* Gianmarco Conte <gconte@dinamicheaziendali.it>
12 changes: 8 additions & 4 deletions l10n_it_fatturapa_out_rc/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>ITA - Emissione e-fattura con reverse charge</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">ITA - Emissione e-fattura con reverse charge</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_out_rc"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_out_rc"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/122/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" 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" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_out_rc"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_fatturapa_out_rc"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/122/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><strong>Italiano</strong></p>
<p>Gestione tipi documento fiscale TD16, TD17, TD18, TD19 in generazione fattura elettronica.</p>
<p>Il modulo permette di impostare, nell’XML, il corretto fornitore in caso di reverse charge.</p>
Expand Down Expand Up @@ -399,7 +399,7 @@ <h1><a class="toc-backref" href="#id2">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 smashing 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_rc%0Aversion:%2014.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_rc%0Aversion:%2016.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">
Expand All @@ -421,6 +421,10 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<li>Alex Comba &lt;<a class="reference external" href="mailto:alex.comba&#64;agilebg.com">alex.comba&#64;agilebg.com</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.dinamicheaziendali.it">Dinamiche Aziendali</a>:<ul>
<li>Gianmarco Conte &lt;<a class="reference external" href="mailto:gconte&#64;dinamicheaziendali.it">gconte&#64;dinamicheaziendali.it</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -432,7 +436,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/eLBati"><img alt="eLBati" src="https://github.com/eLBati.png?size=40px" /></a></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_rc">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/16.0/l10n_it_fatturapa_out_rc">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 @@ -60,7 +60,7 @@ def setUp(self):
@classmethod
def _create_invoice(cls, move_type, partner, name, invoice_date, ref, taxes):
invoice_form = Form(
cls.env["account.move"].with_context({"default_move_type": move_type})
cls.env["account.move"].with_context(**{"default_move_type": move_type})
)
invoice_form.partner_id = partner
invoice_form.name = name
Expand Down
111 changes: 68 additions & 43 deletions l10n_it_fatturapa_out_rc/views/invoice_it_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,105 @@
<!-- Copyright 2021 Alex Comba - Agile Business Group
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<template
<template
id="account_invoice_it_FatturaPA_export"
inherit_id="l10n_it_fatturapa_out.account_invoice_it_FatturaPA_export"
>
<xpath
<xpath
expr="//t[@t-call='l10n_it_fatturapa_out.account_invoice_it_cedente_prestatore']"
position="replace"
position="attributes"
>
<t
t-call="l10n_it_fatturapa_out.account_invoice_it_cedente_prestatore"
>
<t t-set="partner_id" t-value="company_id.partner_id" />
<t
<attribute name="style">display: none;</attribute>
</xpath>
<xpath
expr="//t[@t-call='l10n_it_fatturapa_out.account_invoice_it_cedente_prestatore']"
position="after"
>

<t t-call="l10n_it_fatturapa_out.account_invoice_it_cedente_prestatore">
<t t-set="partner_id" t-value="company_id.partner_id" />
<t
t-set="rc_supplier"
t-value="invoices.mapped('rc_purchase_invoice_id.partner_id')"
/>
<t t-if="rc_supplier">
<t t-set="partner_id" t-value="rc_supplier" />
<t t-set="company_id" t-value="" />
</t>
</t>
</xpath>
<xpath
<t t-if="rc_supplier">
<t t-set="partner_id" t-value="rc_supplier" />
<t t-set="company_id" t-value="" />
</t>
</t>
</xpath>
<xpath
expr="//t[@t-call='l10n_it_fatturapa_out.account_invoice_it_fattura_elettronica_body']"
position="replace"
position="attributes"
>
<t
<attribute name="style">display: none;</attribute>
</xpath>
<xpath
expr="//t[@t-call='l10n_it_fatturapa_out.account_invoice_it_fattura_elettronica_body']"
position="after"
>
<t
t-call="l10n_it_fatturapa_out.account_invoice_it_fattura_elettronica_body"
>
<t
<t
t-set="rc_document_type"
t-value="record.rc_purchase_invoice_id.fiscal_position_id.rc_type_id.fiscal_document_type_id"
/>
</t>
</xpath>
</template>
</t>
</xpath>
</template>

<template
<template
id="account_invoice_it_fattura_elettronica_body"
inherit_id="l10n_it_fatturapa_out.account_invoice_it_fattura_elettronica_body"
>
<xpath expr="//DatiGeneraliDocumento/TipoDocumento" position="replace">
<TipoDocumento t-if="rc_document_type" t-esc="rc_document_type.code" />
<TipoDocumento
<xpath expr="//DatiGeneraliDocumento/TipoDocumento" position="attributes">
<attribute name="style">display: none;</attribute>
</xpath>
<xpath expr="//DatiGeneraliDocumento/TipoDocumento" position="after">
<TipoDocumento t-if="rc_document_type" t-esc="rc_document_type.code" />
<TipoDocumento
t-if="not rc_document_type"
t-esc="record.fiscal_document_type_id.code"
/>
</xpath>
<xpath expr="//DatiRiepilogo/ImponibileImporto" position="replace">
<ImponibileImporto
</xpath>
<xpath expr="//DatiRiepilogo/ImponibileImporto" position="attributes">
<attribute name="style">display: none;</attribute>
</xpath>
<xpath expr="//DatiRiepilogo/ImponibileImporto" position="after">
<ImponibileImporto
t-esc="format_monetary(fpa_to_eur(get_sign(record) * tax_data['ImponibileImporto'], record), euro)"
/>
</xpath>
<xpath expr="//DatiRiepilogo/Imposta" position="replace">
<Imposta
</xpath>
<xpath expr="//DatiRiepilogo/Imposta" position="attributes">
<attribute name="style">display: none;</attribute>
</xpath>
<xpath expr="//DatiRiepilogo/Imposta" position="after">
<Imposta
t-esc="format_monetary(get_sign(record) * tax_data['Imposta'], currency)"
/>
</xpath>
</template>
</xpath>
</template>

<template
<template
id="account_invoice_line_it_FatturaPA"
inherit_id="l10n_it_fatturapa_out.account_invoice_line_it_FatturaPA"
>
<xpath expr="//PrezzoUnitario" position="replace">
<PrezzoUnitario
t-esc="format_price(line, get_sign(line.move_id))"
/>
</xpath>
<xpath expr="//PrezzoTotale" position="replace">
<PrezzoTotale
<xpath expr="//PrezzoUnitario" position="attributes">
<attribute name="style">display: none;</attribute>
</xpath>
<xpath expr="//PrezzoUnitario" position="after">
<PrezzoUnitario t-esc="format_price(line, get_sign(line.move_id))" />
</xpath>

<xpath expr="//PrezzoTotale" position="attributes">
<attribute name="style">display: none;</attribute>
</xpath>
<xpath expr="//PrezzoTotale" position="after">
<PrezzoTotale
t-esc="format_monetary(fpa_to_eur(get_sign(line.move_id) * line.price_subtotal, record), euro)"
/>
</xpath>
</template>
</xpath>
</template>

</odoo>

0 comments on commit 051210a

Please sign in to comment.