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
94 changes: 94 additions & 0 deletions l10n_it_edi_sender_partner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

================================================
Terzo intermediario per fatturazione elettronica
================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a0af0a681ac91c7ddd3b994e0c6a1741e1c847fba7f75c69387f0613c9231816
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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
: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/19.0/l10n_it_edi_sender_partner
: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-19-0/l10n-italy-19-0-l10n_it_edi_sender_partner
: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=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

**English**

Module for managing the Third Party or Issuing Entity in electronic
invoices. A dedicated field is available in the company record. When
sending, if filled in, the intermediary is included in the XML. When
importing, if the file contains an intermediary, it is linked to the
invoice.

**Italiano**

Modulo per la gestione del Terzo Intermediario o Soggetto Emittente
nelle fatture elettroniche. Il campo dedicato è disponibile
nell’anagrafica azienda. In fase di invio, se valorizzato,
l’intermediario viene riportato nell’XML. In fase di importazione, se il
file contiene un intermediario, questo viene collegato alla fattura.

**Table of contents**

.. contents::
:local:

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_edi_sender_partner%0Aversion:%2019.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.

Credits
=======

Authors
-------

* Nextev Srl

Contributors
------------

- Nextev Srl <https://www.nextev.it>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/19.0/l10n_it_edi_sender_partner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions l10n_it_edi_sender_partner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
21 changes: 21 additions & 0 deletions l10n_it_edi_sender_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Terzo intermediario per fatturazione elettronica",
"version": "19.0.1.0.0",
"category": "Localization/Italy",
"summary": "Terzo intermediario o soggetto emittete per fatturazione elettronica",
"author": "Nextev Srl, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-italy",
"license": "AGPL-3",
"depends": [
"l10n_it_edi_extension",
],
"data": [
"views/l10n_it_sender_partner.xml",
"views/l10n_it_view.xml",
"views/account_view.xml",
"data/invoice_it_template.xml",
],
"installable": True,
}
16 changes: 16 additions & 0 deletions l10n_it_edi_sender_partner/data/invoice_it_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="account_invoice_it_partner_sender"
inherit_id="l10n_it_edi.account_invoice_it_FatturaPA_export"
>
<xpath expr="//CessionarioCommittente" position="after">
<t
t-call="l10n_it_edi_sender_partner.l10n_it_edi_terzo_intermediario_soggetto_emittente"
/>
<SoggettoEmittente
t-if="company.l10n_edi_it_sender_partner"
>TZ</SoggettoEmittente>
</xpath>
</template>
</odoo>
47 changes: 47 additions & 0 deletions l10n_it_edi_sender_partner/i18n/l10n_it_edi_sender_partner.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_it_edi_sender_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_it_edi_sender_partner
#: model:ir.model,name:l10n_it_edi_sender_partner.model_res_company
msgid "Companies"
msgstr ""

#. module: l10n_it_edi_sender_partner
#: model:ir.model.fields,help:l10n_it_edi_sender_partner.field_res_company__l10n_edi_it_sender_partner
msgid ""
"Data of Third-Party Issuer Intermediary who emits the invoice on behalf of "
"the seller/provider"
msgstr ""

#. module: l10n_it_edi_sender_partner
#: model:ir.model.fields,field_description:l10n_it_edi_sender_partner.field_account_bank_statement_line__l10n_it_edi_intermediary_id
#: model:ir.model.fields,field_description:l10n_it_edi_sender_partner.field_account_move__l10n_it_edi_intermediary_id
msgid "Intermediary"
msgstr ""

#. module: l10n_it_edi_sender_partner
#: model:ir.model,name:l10n_it_edi_sender_partner.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: l10n_it_edi_sender_partner
#: model_terms:ir.ui.view,arch_db:l10n_it_edi_sender_partner.account_invoice_it_partner_sender
msgid "TZ"
msgstr ""

#. module: l10n_it_edi_sender_partner
#: model:ir.model.fields,field_description:l10n_it_edi_sender_partner.field_res_company__l10n_edi_it_sender_partner
msgid "Third Party/Sender"
msgstr ""
4 changes: 4 additions & 0 deletions l10n_it_edi_sender_partner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import account_move
from . import res_company
29 changes: 29 additions & 0 deletions l10n_it_edi_sender_partner/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models

from odoo.addons.l10n_it_edi.models.account_move import get_text


class AccountMove(models.Model):
_inherit = "account.move"

l10n_it_edi_intermediary_id = fields.Many2one("res.partner", string="Intermediary")

def _l10n_it_edi_import_invoice(self, invoice, data, is_new):
res = super()._l10n_it_edi_import_invoice(invoice, data, is_new)
Partner = self.env["res.partner"]
tree = data["xml_tree"]
intermediary = tree.xpath("//TerzoIntermediarioOSoggettoEmittente")
if not intermediary:
return res
intermediary = intermediary[0]
paese = get_text(intermediary, ".//IdPaese")
codice = get_text(intermediary, ".//IdCodice")
if not codice:
return res
vat = (paese or "") + codice
intermediary_id = Partner.search([("vat", "=", vat)], limit=1)
if intermediary_id:
invoice.l10n_it_edi_intermediary_id = intermediary_id
return res
14 changes: 14 additions & 0 deletions l10n_it_edi_sender_partner/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

l10n_edi_it_sender_partner = fields.Many2one(
"res.partner",
string="Third Party/Sender",
help="Data of Third-Party Issuer Intermediary who emits the "
"invoice on behalf of the seller/provider",
)
3 changes: 3 additions & 0 deletions l10n_it_edi_sender_partner/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions l10n_it_edi_sender_partner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Nextev Srl \<<https://www.nextev.it>\>

19 changes: 19 additions & 0 deletions l10n_it_edi_sender_partner/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**English**

Module for managing the Third Party or Issuing Entity
in electronic invoices.
A dedicated field is available in the company record.
When sending, if filled in, the intermediary is included
in the XML.
When importing, if the file contains an intermediary,
it is linked to the invoice.

**Italiano**

Modulo per la gestione del Terzo Intermediario o Soggetto
Emittente nelle fatture elettroniche.
Il campo dedicato è disponibile nell’anagrafica azienda.
In fase di invio, se valorizzato, l’intermediario viene riportato
nell’XML.
In fase di importazione, se il file contiene un intermediario,
questo viene collegato alla fattura.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading