Skip to content

Commit 10b1861

Browse files
committed
Merge PR #4911 into 18.0
Signed-off-by eLBati
2 parents 921ada6 + bb442dd commit 10b1861

19 files changed

Lines changed: 994 additions & 0 deletions
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
================================================
2+
Terzo intermediario per fatturazione elettronica
3+
================================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:1ee52872dd90b594fd4fa1d9c761b1625df8eb82b315a94b016d570f5c5eed71
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |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_sender_partner
21+
:alt: OCA/l10n-italy
22+
.. |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_sender_partner
24+
:alt: Translate me on Weblate
25+
.. |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
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
**English**
32+
33+
Module for managing the Third Party or Issuing Entity in electronic
34+
invoices. A dedicated field is available in the company record. When
35+
sending, if filled in, the intermediary is included in the XML. When
36+
importing, if the file contains an intermediary, it is linked to the
37+
invoice.
38+
39+
**Italiano**
40+
41+
Modulo per la gestione del Terzo Intermediario o Soggetto Emittente
42+
nelle fatture elettroniche. Il campo dedicato è disponibile
43+
nell’anagrafica azienda. In fase di invio, se valorizzato,
44+
l’intermediario viene riportato nell’XML. In fase di importazione, se il
45+
file contiene un intermediario, questo viene collegato alla fattura.
46+
47+
**Table of contents**
48+
49+
.. contents::
50+
:local:
51+
52+
Bug Tracker
53+
===========
54+
55+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
56+
In case of trouble, please check there if your issue has already been reported.
57+
If you spotted it first, help us to smash it by providing a detailed and welcomed
58+
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_edi_sender_partner%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
59+
60+
Do not contact contributors directly about support or help with technical issues.
61+
62+
Credits
63+
=======
64+
65+
Authors
66+
-------
67+
68+
* Nextev Srl
69+
70+
Contributors
71+
------------
72+
73+
- Nextev Srl <https://www.nextev.it>
74+
75+
Maintainers
76+
-----------
77+
78+
This module is maintained by the OCA.
79+
80+
.. image:: https://odoo-community.org/logo.png
81+
:alt: Odoo Community Association
82+
:target: https://odoo-community.org
83+
84+
OCA, or the Odoo Community Association, is a nonprofit organization whose
85+
mission is to support the collaborative development of Odoo features and
86+
promote its widespread use.
87+
88+
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_sender_partner>`_ project on GitHub.
89+
90+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from . import models
4+
5+
from openupgradelib import openupgrade
6+
7+
8+
def _l10n_it_fatturapa_pre_migration(env):
9+
RENAMED_FIELDS = [
10+
[
11+
(
12+
"res.company",
13+
"fatturapa_sender_partner",
14+
),
15+
(
16+
"res.company",
17+
"l10n_edi_it_sender_partner",
18+
),
19+
],
20+
[
21+
(
22+
"account.move",
23+
"intermediary",
24+
),
25+
(
26+
"account.move",
27+
"l10n_it_edi_intermediary_id",
28+
),
29+
],
30+
]
31+
field_spec = []
32+
for renamed_field in RENAMED_FIELDS:
33+
(old_model, old_field), (new_model, new_field) = renamed_field
34+
field_spec.append(
35+
(
36+
old_model,
37+
new_model.replace(".", "_"),
38+
old_field,
39+
new_field,
40+
)
41+
)
42+
openupgrade.rename_fields(
43+
env,
44+
field_spec,
45+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
{
4+
"name": "Terzo intermediario per fatturazione elettronica",
5+
"version": "18.0.1.0.0",
6+
"category": "Localization/Italy",
7+
"summary": "Terzo intermediario o soggetto emittete per fatturazione elettronica",
8+
"author": "Nextev Srl, Odoo Community Association (OCA)",
9+
"website": "https://github.com/OCA/l10n-italy",
10+
"license": "AGPL-3",
11+
"depends": [
12+
"l10n_it_edi_extension",
13+
],
14+
"external_dependencies": {
15+
"python": ["openupgradelib"],
16+
},
17+
"data": [
18+
"views/l10n_it_sender_partner.xml",
19+
"views/l10n_it_view.xml",
20+
"views/account_view.xml",
21+
"data/invoice_it_template.xml",
22+
],
23+
"installable": True,
24+
"pre_init_hook": "_l10n_it_fatturapa_pre_migration",
25+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<template
4+
id="account_invoice_it_partner_sender"
5+
inherit_id="l10n_it_edi.account_invoice_it_FatturaPA_export"
6+
>
7+
<xpath expr="//CessionarioCommittente" position="after">
8+
<t
9+
t-call="l10n_it_edi_sender_partner.l10n_it_edi_terzo_intermediario_soggetto_emittente"
10+
/>
11+
<SoggettoEmittente
12+
t-if="company.l10n_edi_it_sender_partner"
13+
>TZ</SoggettoEmittente>
14+
</xpath>
15+
</template>
16+
</odoo>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from . import account_move
4+
from . import res_company
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from odoo import fields, models
4+
5+
from odoo.addons.l10n_it_edi.models.account_move import get_text
6+
7+
8+
class AccountMove(models.Model):
9+
_inherit = "account.move"
10+
11+
l10n_it_edi_intermediary_id = fields.Many2one("res.partner", string="Intermediary")
12+
13+
def _l10n_it_edi_import_invoice(self, invoice, data, is_new):
14+
res = super()._l10n_it_edi_import_invoice(invoice, data, is_new)
15+
Partner = self.env["res.partner"]
16+
tree = data["xml_tree"]
17+
intermediary = tree.xpath("//TerzoIntermediarioOSoggettoEmittente")
18+
if not intermediary:
19+
return res
20+
intermediary = intermediary[0]
21+
paese = get_text(intermediary, ".//IdPaese")
22+
codice = get_text(intermediary, ".//IdCodice")
23+
if not codice:
24+
return res
25+
vat = (paese or "") + codice
26+
intermediary_id = Partner.search([("vat", "=", vat)], limit=1)
27+
if intermediary_id:
28+
invoice.l10n_it_edi_intermediary_id = intermediary_id
29+
return res
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from odoo import fields, models
4+
5+
6+
class ResCompany(models.Model):
7+
_inherit = "res.company"
8+
9+
l10n_edi_it_sender_partner = fields.Many2one(
10+
"res.partner",
11+
string="Third Party/Sender",
12+
help="Data of Third-Party Issuer Intermediary who emits the "
13+
"invoice on behalf of the seller/provider",
14+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Nextev Srl \<<https://www.nextev.it>\>
2+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
**English**
2+
3+
Module for managing the Third Party or Issuing Entity
4+
in electronic invoices.
5+
A dedicated field is available in the company record.
6+
When sending, if filled in, the intermediary is included
7+
in the XML.
8+
When importing, if the file contains an intermediary,
9+
it is linked to the invoice.
10+
11+
**Italiano**
12+
13+
Modulo per la gestione del Terzo Intermediario o Soggetto
14+
Emittente nelle fatture elettroniche.
15+
Il campo dedicato è disponibile nell’anagrafica azienda.
16+
In fase di invio, se valorizzato, l’intermediario viene riportato
17+
nell’XML.
18+
In fase di importazione, se il file contiene un intermediario,
19+
questo viene collegato alla fattura.

0 commit comments

Comments
 (0)