odoo-addon-l10n-it-edi-extension 18.0.1.0.0.30__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/l10n_it_edi_extension/README.rst +493 -0
- odoo/addons/l10n_it_edi_extension/__init__.py +951 -0
- odoo/addons/l10n_it_edi_extension/__manifest__.py +37 -0
- odoo/addons/l10n_it_edi_extension/controllers/__init__.py +1 -0
- odoo/addons/l10n_it_edi_extension/controllers/portal.py +27 -0
- odoo/addons/l10n_it_edi_extension/data/FoglioStileAssoSoftware.xsl +3150 -0
- odoo/addons/l10n_it_edi_extension/data/invoice_it_template.xml +50 -0
- odoo/addons/l10n_it_edi_extension/data/res.city.it.code.csv +13898 -0
- odoo/addons/l10n_it_edi_extension/i18n/l10n_it_edi_extension.pot +1167 -0
- odoo/addons/l10n_it_edi_extension/i18n/l10n_it_edi_fatturapa.pot +44 -0
- odoo/addons/l10n_it_edi_extension/models/__init__.py +15 -0
- odoo/addons/l10n_it_edi_extension/models/account_journal.py +152 -0
- odoo/addons/l10n_it_edi_extension/models/account_move.py +765 -0
- odoo/addons/l10n_it_edi_extension/models/account_move_line.py +10 -0
- odoo/addons/l10n_it_edi_extension/models/ir_attachment.py +37 -0
- odoo/addons/l10n_it_edi_extension/models/l10n_it_edi_activity_progress.py +14 -0
- odoo/addons/l10n_it_edi_extension/models/l10n_it_edi_article_code.py +15 -0
- odoo/addons/l10n_it_edi_extension/models/l10n_it_edi_discount_rise_price.py +25 -0
- odoo/addons/l10n_it_edi_extension/models/l10n_it_edi_line.py +48 -0
- odoo/addons/l10n_it_edi_extension/models/l10n_it_edi_line_other_data.py +17 -0
- odoo/addons/l10n_it_edi_extension/models/l10n_it_edi_summary_data.py +77 -0
- odoo/addons/l10n_it_edi_extension/models/res_city_it_code.py +83 -0
- odoo/addons/l10n_it_edi_extension/models/res_company.py +62 -0
- odoo/addons/l10n_it_edi_extension/models/res_partner.py +64 -0
- odoo/addons/l10n_it_edi_extension/readme/CONFIGURE.md +45 -0
- odoo/addons/l10n_it_edi_extension/readme/CONTRIBUTORS.md +5 -0
- odoo/addons/l10n_it_edi_extension/readme/DESCRIPTION.md +160 -0
- odoo/addons/l10n_it_edi_extension/security/ir.model.access.csv +14 -0
- odoo/addons/l10n_it_edi_extension/static/description/icon.png +0 -0
- odoo/addons/l10n_it_edi_extension/static/description/index.html +832 -0
- odoo/addons/l10n_it_edi_extension/tests/__init__.py +2 -0
- odoo/addons/l10n_it_edi_extension/tests/import_xmls/IT01234567890_FPR03.xml +166 -0
- odoo/addons/l10n_it_edi_extension/tests/import_xmls/IT02780790107_11004.xml +216 -0
- odoo/addons/l10n_it_edi_extension/tests/import_xmls/IT02780790107_11005.xml +224 -0
- odoo/addons/l10n_it_edi_extension/tests/import_xmls/IT05979361218_003.xml +107 -0
- odoo/addons/l10n_it_edi_extension/tests/import_xmls/test.png +0 -0
- odoo/addons/l10n_it_edi_extension/tests/import_xmls/xml_import.zip +0 -0
- odoo/addons/l10n_it_edi_extension/tests/test_fiscalcode.py +126 -0
- odoo/addons/l10n_it_edi_extension/tests/test_import_edi_extension_xml.py +350 -0
- odoo/addons/l10n_it_edi_extension/views/company_view.xml +41 -0
- odoo/addons/l10n_it_edi_extension/views/l10n_it_view.xml +164 -0
- odoo/addons/l10n_it_edi_extension/views/res_partner_view.xml +19 -0
- odoo/addons/l10n_it_edi_extension/wizards/__init__.py +2 -0
- odoo/addons/l10n_it_edi_extension/wizards/compute_fc.py +176 -0
- odoo/addons/l10n_it_edi_extension/wizards/compute_fc_view.xml +65 -0
- odoo/addons/l10n_it_edi_extension/wizards/l10n_it_edi_import_file_wizard.py +98 -0
- odoo/addons/l10n_it_edi_extension/wizards/l10n_it_edi_import_file_wizard.xml +46 -0
- odoo_addon_l10n_it_edi_extension-18.0.1.0.0.30.dist-info/METADATA +513 -0
- odoo_addon_l10n_it_edi_extension-18.0.1.0.0.30.dist-info/RECORD +51 -0
- odoo_addon_l10n_it_edi_extension-18.0.1.0.0.30.dist-info/WHEEL +5 -0
- odoo_addon_l10n_it_edi_extension-18.0.1.0.0.30.dist-info/top_level.txt +1 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class AccountMoveLineInherit(models.Model):
|
8
|
+
_inherit = "account.move.line"
|
9
|
+
|
10
|
+
l10n_it_edi_admin_ref = fields.Char(string="Admin. ref.", size=20, copy=False)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from io import BytesIO
|
5
|
+
|
6
|
+
from lxml import etree
|
7
|
+
|
8
|
+
from odoo import api, models, tools
|
9
|
+
from odoo.exceptions import UserError
|
10
|
+
|
11
|
+
|
12
|
+
class IrAttachmentInherit(models.Model):
|
13
|
+
_inherit = "ir.attachment"
|
14
|
+
|
15
|
+
@api.model
|
16
|
+
def get_fatturapa_preview_style_name(self):
|
17
|
+
"""Hook to have a clean inheritance."""
|
18
|
+
return "FoglioStileAssoSoftware.xsl"
|
19
|
+
|
20
|
+
def get_xml_string(self):
|
21
|
+
if not self._is_l10n_it_edi_import_file():
|
22
|
+
raise UserError(self.env._("Invalid xml %s.") % self.name)
|
23
|
+
xml_string = self._decode_edi_l10n_it_edi(self.name, self.raw)[0]["content"]
|
24
|
+
return xml_string
|
25
|
+
|
26
|
+
def get_fattura_elettronica_preview(self):
|
27
|
+
xsl_path = tools.misc.file_path(
|
28
|
+
f"l10n_it_edi_extension/data/{self.get_fatturapa_preview_style_name()}"
|
29
|
+
)
|
30
|
+
xslt = etree.parse(xsl_path)
|
31
|
+
xml_string = self.sudo().get_xml_string()
|
32
|
+
xml_file = BytesIO(xml_string)
|
33
|
+
recovering_parser = etree.XMLParser(recover=True, resolve_entities=False)
|
34
|
+
dom = etree.parse(xml_file, parser=recovering_parser)
|
35
|
+
transform = etree.XSLT(xslt)
|
36
|
+
newdom = transform(dom)
|
37
|
+
return etree.tostring(newdom, pretty_print=True, encoding="unicode")
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class EInvoiceActivityProgress(models.Model):
|
8
|
+
_name = "l10n_it_edi.activity_progress"
|
9
|
+
_description = "E-invoice activity progress"
|
10
|
+
|
11
|
+
activity_progress = fields.Integer()
|
12
|
+
invoice_id = fields.Many2one(
|
13
|
+
"account.move", string="Related Invoice", ondelete="cascade", index=True
|
14
|
+
)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class EInvoiceArticleCode(models.Model):
|
8
|
+
_name = "l10n_it_edi.article_code"
|
9
|
+
_description = "E-invoice Article Code"
|
10
|
+
|
11
|
+
name = fields.Char(string="Code Type")
|
12
|
+
code_val = fields.Char(string="Code Value")
|
13
|
+
l10n_it_edi_line_id = fields.Many2one(
|
14
|
+
"l10n_it_edi.line", string="Related E-invoice Line", readonly=True
|
15
|
+
)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class EInvoiceDiscountRisePrice(models.Model):
|
8
|
+
_name = "l10n_it_edi.discount_rise_price"
|
9
|
+
_description = "E-invoice Discount Supplement Data"
|
10
|
+
|
11
|
+
name = fields.Selection([("SC", "Discount"), ("MG", "Supplement")], string="Type")
|
12
|
+
percentage = fields.Float()
|
13
|
+
amount = fields.Float(digits="Discount")
|
14
|
+
invoice_line_id = fields.Many2one(
|
15
|
+
"account.move.line",
|
16
|
+
string="Related Invoice from line",
|
17
|
+
ondelete="cascade",
|
18
|
+
index=True,
|
19
|
+
)
|
20
|
+
invoice_id = fields.Many2one(
|
21
|
+
"account.move", string="Related Invoice", ondelete="cascade", index=True
|
22
|
+
)
|
23
|
+
l10n_it_edi_line_id = fields.Many2one(
|
24
|
+
"l10n_it_edi.line", string="Related E-invoice Line", readonly=True
|
25
|
+
)
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class EInvoiceLine(models.Model):
|
8
|
+
_name = "l10n_it_edi.line"
|
9
|
+
_description = "E-invoice Line"
|
10
|
+
|
11
|
+
invoice_id = fields.Many2one(
|
12
|
+
"account.move", string="Invoice", readonly=True, ondelete="cascade"
|
13
|
+
)
|
14
|
+
invoice_line_id = fields.Many2one(
|
15
|
+
"account.move.line", string="Invoice Line", readonly=True, ondelete="cascade"
|
16
|
+
)
|
17
|
+
line_number = fields.Integer(readonly=True)
|
18
|
+
service_type = fields.Char(string="Sale Provision Type", readonly=True)
|
19
|
+
l10n_it_edi_article_code_ids = fields.One2many(
|
20
|
+
"l10n_it_edi.article_code",
|
21
|
+
"l10n_it_edi_line_id",
|
22
|
+
string="Articles Code",
|
23
|
+
readonly=True,
|
24
|
+
)
|
25
|
+
name = fields.Char(string="Description", readonly=True)
|
26
|
+
qty = fields.Float(
|
27
|
+
string="Quantity", readonly=True, digits="Product Unit of Measure"
|
28
|
+
)
|
29
|
+
uom = fields.Char(string="Unit of measure", readonly=True)
|
30
|
+
period_start_date = fields.Date(readonly=True)
|
31
|
+
period_end_date = fields.Date(readonly=True)
|
32
|
+
unit_price = fields.Float(readonly=True, digits="Product Price")
|
33
|
+
l10n_it_edi_discount_rise_price_ids = fields.One2many(
|
34
|
+
"l10n_it_edi.discount_rise_price",
|
35
|
+
"l10n_it_edi_line_id",
|
36
|
+
string="Discount and Supplement Details",
|
37
|
+
readonly=True,
|
38
|
+
)
|
39
|
+
total_price = fields.Float(readonly=True)
|
40
|
+
tax_amount = fields.Float(string="VAT Rate", readonly=True)
|
41
|
+
wt_amount = fields.Char(string="Tax Withholding", readonly=True)
|
42
|
+
tax_kind = fields.Char(string="Nature", readonly=True)
|
43
|
+
l10n_it_edi_line_other_data_ids = fields.One2many(
|
44
|
+
"l10n_it_edi.line_other_data",
|
45
|
+
"l10n_it_edi_line_id",
|
46
|
+
string="Other Administrative Data",
|
47
|
+
readonly=True,
|
48
|
+
)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class EInvoiceLineOtherData(models.Model):
|
8
|
+
_name = "l10n_it_edi.line_other_data"
|
9
|
+
_description = "E-invoice line other data"
|
10
|
+
|
11
|
+
l10n_it_edi_line_id = fields.Many2one(
|
12
|
+
"l10n_it_edi.line", string="Related E-bill Line", readonly=True
|
13
|
+
)
|
14
|
+
name = fields.Char(string="Data Type", readonly=True)
|
15
|
+
text_ref = fields.Char(string="Text Reference", readonly=True)
|
16
|
+
num_ref = fields.Float(string="Number Reference", readonly=True)
|
17
|
+
date_ref = fields.Char(string="Date Reference", readonly=True)
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class EInvoiceSummaryData(models.Model):
|
8
|
+
_name = "l10n_it_edi.summary_data"
|
9
|
+
_description = "E-invoice summary data"
|
10
|
+
|
11
|
+
tax_rate = fields.Float()
|
12
|
+
non_taxable_nature = fields.Selection(
|
13
|
+
selection=[
|
14
|
+
("N1", "[N1] Escluse ex art. 15"),
|
15
|
+
("N2", "[N2] Non soggette"),
|
16
|
+
(
|
17
|
+
"N2.1",
|
18
|
+
"[N2.1] Non soggette ad IVA ai sensi degli artt. Da 7 a 7-septies del DPR 633/72", # noqa: E501
|
19
|
+
),
|
20
|
+
("N2.2", "[N2.2] Non soggette - altri casi"),
|
21
|
+
("N3", "[N3] Non imponibili"),
|
22
|
+
("N3.1", "[N3.1] Non imponibili - esportazioni"),
|
23
|
+
("N3.2", "[N3.2] Non imponibili - cessioni intracomunitarie"),
|
24
|
+
("N3.3", "[N3.3] Non imponibili - cessioni verso San Marino"),
|
25
|
+
(
|
26
|
+
"N3.4",
|
27
|
+
"[N3.4] Non imponibili - operazioni assimilate alle cessioni all'esportazione", # noqa: E501
|
28
|
+
),
|
29
|
+
("N3.5", "[N3.5] Non imponibili - a seguito di dichiarazioni d'intento"),
|
30
|
+
(
|
31
|
+
"N3.6",
|
32
|
+
"[N3.6] Non imponibili - altre operazioni che non concorrono alla formazione del plafond", # noqa: E501
|
33
|
+
),
|
34
|
+
("N4", "[N4] Esenti"),
|
35
|
+
("N5", "[N5] Regime del margine / IVA non esposta in fattura"),
|
36
|
+
(
|
37
|
+
"N6",
|
38
|
+
"[N6] Inversione contabile (per le operazioni in reverse charge ovvero nei casi di autofatturazione per acquisti extra UE di servizi ovvero per importazioni di beni nei soli casi previsti)", # noqa: E501
|
39
|
+
),
|
40
|
+
(
|
41
|
+
"N6.1",
|
42
|
+
"[N6.1] Inversione contabile - cessione di rottami e altri materiali di recupero", # noqa: E501
|
43
|
+
),
|
44
|
+
("N6.2", "[N6.2] Inversione contabile - cessione di oro e argento puro"),
|
45
|
+
("N6.3", "[N6.3] Inversione contabile - subappalto nel settore edile"),
|
46
|
+
("N6.4", "[N6.4] Inversione contabile - cessione di fabbricati"),
|
47
|
+
("N6.5", "[N6.5] Inversione contabile - cessione di telefoni cellulari"),
|
48
|
+
("N6.6", "[N6.6] Inversione contabile - cessione di prodotti elettronici"),
|
49
|
+
(
|
50
|
+
"N6.7",
|
51
|
+
"[N6.7] Inversione contabile - prestazioni comparto edile esettori connessi", # noqa: E501
|
52
|
+
),
|
53
|
+
("N6.8", "[N6.8] Inversione contabile - operazioni settore energetico"),
|
54
|
+
("N6.9", "[N6.9] Inversione contabile - altri casi"),
|
55
|
+
(
|
56
|
+
"N7",
|
57
|
+
"[N7] IVA assolta in altro stato UE (prestazione di servizi di telecomunicazioni, tele-radiodiffusione ed elettronici ex art. 7-octies, comma 1 lett. a, b, art. 74-sexies DPR 633/72)", # noqa: E501
|
58
|
+
),
|
59
|
+
],
|
60
|
+
string="Non taxable nature",
|
61
|
+
)
|
62
|
+
incidental_charges = fields.Float()
|
63
|
+
rounding = fields.Float()
|
64
|
+
amount_untaxed = fields.Float()
|
65
|
+
amount_tax = fields.Float()
|
66
|
+
payability = fields.Selection(
|
67
|
+
[
|
68
|
+
("I", "Immediate payability"),
|
69
|
+
("D", "Deferred payability"),
|
70
|
+
("S", "Split payment"),
|
71
|
+
],
|
72
|
+
string="VAT payability",
|
73
|
+
)
|
74
|
+
law_reference = fields.Char(string="Law reference", size=128)
|
75
|
+
invoice_id = fields.Many2one(
|
76
|
+
"account.move", string="Related Invoice", ondelete="cascade", index=True
|
77
|
+
)
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
2
|
+
|
3
|
+
from odoo import fields, models, tools
|
4
|
+
|
5
|
+
|
6
|
+
class ResCityItCode(models.Model):
|
7
|
+
#
|
8
|
+
# First...
|
9
|
+
# FIXME: URL in class description is no more useful...
|
10
|
+
#
|
11
|
+
# Visit:
|
12
|
+
# https://www.agenziaentrate.gov.it/wps/content/Nsilib/Nsi/
|
13
|
+
# Strumenti/Codici+attivita+e+tributo/Codici+territorio/
|
14
|
+
# ... and then click on "Consultazione Archivio Comuni e Stati esteri".
|
15
|
+
# You will be redirected on:
|
16
|
+
# https://www.agenziaentrate.gov.it/wps/content/nsilib/nsi/schede/
|
17
|
+
# fabbricatiterreni/archivio+comuni+e+stati+esteri/
|
18
|
+
# consultazione+archivio+comuni+stati+esteri
|
19
|
+
# Here, you can download the new and updated file CSV.
|
20
|
+
# (last update on 30/07/2018)
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# ... BUT then...
|
24
|
+
# TODO: Find out how to import the new CSV without breaking existing data.
|
25
|
+
#
|
26
|
+
# The new CSV as a new structure:
|
27
|
+
# - some records have been deleted.
|
28
|
+
# - some columns no longer exist.
|
29
|
+
# - ...
|
30
|
+
# - ... and so on...
|
31
|
+
# - ...
|
32
|
+
#
|
33
|
+
#
|
34
|
+
# Good luck! ;)
|
35
|
+
#
|
36
|
+
|
37
|
+
"""
|
38
|
+
To create res.city.it.code.csv:
|
39
|
+
- download the file named: Codici Comuni d’Italia - xls
|
40
|
+
- open it in LibreOffice and save it as .ods
|
41
|
+
- some date cells contain a "'" to be removed using Calc's menu
|
42
|
+
Data / Text to columns
|
43
|
+
- rows 216,1122 contain wrong written dates
|
44
|
+
- dates format must be yyyy-mm-dd
|
45
|
+
- add first column with numeric ids
|
46
|
+
- change first row with column names from res.city.it.code model
|
47
|
+
id,national_code,cadastre_code,province,name,notes,national_code_var,
|
48
|
+
cadastre_code_var,province_var,name_var,creation_date,var_date
|
49
|
+
- save as csv in data/res.city.it.code.csv
|
50
|
+
"""
|
51
|
+
|
52
|
+
_name = "res.city.it.code"
|
53
|
+
_description = "National city codes"
|
54
|
+
|
55
|
+
national_code = fields.Char("National code", size=4)
|
56
|
+
cadastre_code = fields.Char("Belfiore cadastre code (not used anymore)", size=4)
|
57
|
+
province = fields.Char(size=5)
|
58
|
+
name = fields.Char()
|
59
|
+
notes = fields.Char(size=4)
|
60
|
+
national_code_var = fields.Char("National code variation", size=4)
|
61
|
+
cadastre_code_var = fields.Char("Cadastre code variation", size=4)
|
62
|
+
province_var = fields.Char("Province variation", size=5)
|
63
|
+
name_var = fields.Char("Name variation", size=100)
|
64
|
+
creation_date = fields.Date()
|
65
|
+
var_date = fields.Date("Variation date")
|
66
|
+
|
67
|
+
|
68
|
+
class ResCityItCodeDistinct(models.Model):
|
69
|
+
_name = "res.city.it.code.distinct"
|
70
|
+
_description = "National city codes distinct"
|
71
|
+
_auto = False
|
72
|
+
|
73
|
+
name = fields.Char(size=100)
|
74
|
+
|
75
|
+
def init(self):
|
76
|
+
tools.drop_view_if_exists(self.env.cr, self._table)
|
77
|
+
self.env.cr.execute(
|
78
|
+
"""
|
79
|
+
CREATE OR REPLACE VIEW res_city_it_code_distinct AS (
|
80
|
+
SELECT name, MAX(id) AS id FROM res_city_it_code
|
81
|
+
GROUP BY name)
|
82
|
+
"""
|
83
|
+
)
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class ResCompanyInherit(models.Model):
|
8
|
+
_inherit = "res.company"
|
9
|
+
|
10
|
+
l10n_edi_it_art73 = fields.Boolean(
|
11
|
+
string="Art. 73",
|
12
|
+
help="Indicates whether the document has been issued according to "
|
13
|
+
"methods and terms laid down in a ministerial decree under "
|
14
|
+
"the terms of Article 73 of Italian Presidential Decree "
|
15
|
+
"633/72 (this enables the company to issue in the same "
|
16
|
+
"year several documents with same number)",
|
17
|
+
)
|
18
|
+
l10n_edi_it_admin_ref = fields.Char(string="Public Administration Reference Code")
|
19
|
+
l10n_edi_it_stable_organization = fields.Many2one(
|
20
|
+
"res.partner",
|
21
|
+
string="Stable Organization",
|
22
|
+
help="The fields must be entered only when the seller/provider is "
|
23
|
+
"non-resident, with a stable organization in Italy",
|
24
|
+
)
|
25
|
+
l10n_edi_it_create_partner = fields.Boolean(
|
26
|
+
string="Create Partner on Eletronic Invoice import",
|
27
|
+
help="Automatically create the partner if it does not "
|
28
|
+
"exist during the import of Electronic Invoices.",
|
29
|
+
)
|
30
|
+
l10n_it_edi_import_detail_level = fields.Selection(
|
31
|
+
selection=[
|
32
|
+
("min", "Minimum"),
|
33
|
+
("tax", "Tax rate"),
|
34
|
+
("max", "Maximum"),
|
35
|
+
],
|
36
|
+
default="max",
|
37
|
+
required=True,
|
38
|
+
string="E-bills import detail level",
|
39
|
+
help="Minimum: the bill is created with no lines; "
|
40
|
+
"the user will have to create them, according to what specified in "
|
41
|
+
"the electronic bill.\n"
|
42
|
+
"Tax rate: every tax rate present in the electronic bill "
|
43
|
+
"will create a line in the bill.\n"
|
44
|
+
"Maximum (default): every line contained in the electronic bill "
|
45
|
+
"will create a line in the bill.",
|
46
|
+
)
|
47
|
+
|
48
|
+
|
49
|
+
class AccountConfigSettings(models.TransientModel):
|
50
|
+
_inherit = "res.config.settings"
|
51
|
+
|
52
|
+
l10n_edi_it_create_partner = fields.Boolean(
|
53
|
+
related="company_id.l10n_edi_it_create_partner",
|
54
|
+
string="Create Partner on Eletronic Invoice import",
|
55
|
+
help="Automatically create the partner if it does not "
|
56
|
+
"exist during the import of Electronic Invoices.",
|
57
|
+
readonly=False,
|
58
|
+
)
|
59
|
+
l10n_it_edi_import_detail_level = fields.Selection(
|
60
|
+
related="company_id.l10n_it_edi_import_detail_level",
|
61
|
+
readonly=False,
|
62
|
+
)
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Copyright 2024 Simone Rubino - Aion Tech
|
2
|
+
# Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
|
3
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
4
|
+
|
5
|
+
from odoo import api, fields, models
|
6
|
+
from odoo.exceptions import ValidationError
|
7
|
+
|
8
|
+
|
9
|
+
class ResPartnerInherit(models.Model):
|
10
|
+
_inherit = "res.partner"
|
11
|
+
|
12
|
+
l10n_edi_it_eori_code = fields.Char(string="EORI Code")
|
13
|
+
l10n_edi_it_electronic_invoice_no_contact_update = fields.Boolean(
|
14
|
+
string="Do not update the contact from Electronic Invoice Details"
|
15
|
+
)
|
16
|
+
l10n_edi_it_register = fields.Char(string="Professional Register")
|
17
|
+
l10n_edi_it_register_province_id = fields.Many2one(
|
18
|
+
"res.country.state", string="Register Province"
|
19
|
+
)
|
20
|
+
l10n_edi_it_register_code = fields.Char(string="Register Registration Number")
|
21
|
+
l10n_edi_it_register_regdate = fields.Date(string="Register Registration Date")
|
22
|
+
l10n_it_edi_import_detail_level = fields.Selection(
|
23
|
+
selection=[
|
24
|
+
("min", "Minimum"),
|
25
|
+
("tax", "Tax rate"),
|
26
|
+
("max", "Maximum"),
|
27
|
+
],
|
28
|
+
string="E-bills import detail level",
|
29
|
+
help="Override the 'E-bills import detail level' of the company "
|
30
|
+
"for bills of this supplier.\n"
|
31
|
+
"Minimum: the bill is created with no lines; "
|
32
|
+
"the user will have to create them, according to what specified in "
|
33
|
+
"the electronic bill.\n"
|
34
|
+
"Tax rate: every tax rate present in the electronic bill "
|
35
|
+
"will create a line in the bill.\n"
|
36
|
+
"Maximum: every line contained in the electronic bill "
|
37
|
+
"will create a line in the bill.",
|
38
|
+
)
|
39
|
+
|
40
|
+
@api.constrains(
|
41
|
+
"l10n_it_codice_fiscale",
|
42
|
+
"company_type",
|
43
|
+
)
|
44
|
+
def validate_codice_fiscale(self):
|
45
|
+
res = super().validate_codice_fiscale()
|
46
|
+
for partner in self:
|
47
|
+
if not partner.l10n_it_codice_fiscale:
|
48
|
+
# Because it is not mandatory
|
49
|
+
continue
|
50
|
+
elif partner.company_type == "person":
|
51
|
+
# Person case
|
52
|
+
if partner.company_name:
|
53
|
+
# In E-commerce, if there is company_name,
|
54
|
+
# the user might insert VAT in l10n_it_codice_fiscale field.
|
55
|
+
# Perform the same check as Company case
|
56
|
+
continue
|
57
|
+
if len(partner.l10n_it_codice_fiscale) != 16:
|
58
|
+
# Check l10n_it_codice_fiscale length of a person
|
59
|
+
msg = self.env._(
|
60
|
+
"The fiscal code '%s' must have 16 characters.",
|
61
|
+
partner.l10n_it_codice_fiscale,
|
62
|
+
)
|
63
|
+
raise ValidationError(msg)
|
64
|
+
return res
|
@@ -0,0 +1,45 @@
|
|
1
|
+
**Italiano**
|
2
|
+
|
3
|
+
Le uniche configurazioni disponibili sono:
|
4
|
+
- Livello di dettaglio importazione e-fatture: in Fatturazione (o Contabilità per EE) > Configurazione > Impostazioni > Fatturazione Elettronica Italiana, valorizzare "Livello di dettaglio importazione e-fatture" per importare le fatture elettroniche senza righe, con una riga per ogni aliquota, oppure con tutte le righe (default).
|
5
|
+
Questa configurazione può essere sovrascritta dal campo "Livello di dettaglio importazione e-fatture" in ogni fornitore.
|
6
|
+
- Crea il partner se non esiste durante l'importazione: in Fatturazione (o Contabilità per EE) > Configurazione > Impostazioni > Fatturazione Elettronica Italiana, spuntare l'opzione se si vuole attivare la funzionalità per i dati dei nodi:
|
7
|
+
- `<CessionarioCommittente>`
|
8
|
+
- `<CedentePrestatore>`
|
9
|
+
- `<RappresentanteFiscale>`
|
10
|
+
|
11
|
+
Non sono necessarie altre configurazioni specifiche per l10n_it_edi_extension: una volta installato, le sue funzionalità sono attive e si integrano automaticamente nell'interfaccia esistente.
|
12
|
+
|
13
|
+
Tuttavia, è fondamentale capire che questo modulo è un'estensione e si basa su altri moduli preesistenti e sulla configurazione generale di Odoo per la localizzazione italiana e la fatturazione elettronica.
|
14
|
+
Quindi, affinché le funzionalità di questo modulo siano utilizzabili, è necessario che siano installati e configurati i moduli dipendenti:
|
15
|
+
- `account`: Il modulo base della contabilità di Odoo deve essere installato e configurato (piano dei conti, tasse, giornali contabili, ecc.).
|
16
|
+
- `l10n_it_edi`: Il modulo principale per la fatturazione elettronica italiana deve essere installato e correttamente configurato. Questo include:
|
17
|
+
- Configurazione dei dati aziendali (partita IVA, codice fiscale, regime fiscale, ecc.).
|
18
|
+
- Configurazione dei registri contabili per l'emissione delle fatture elettroniche (indicando il formato FatturaPA/Elettronica).
|
19
|
+
- Configurazione delle sequenze dedicate per la numerazione delle fatture elettroniche.
|
20
|
+
- Eventuale configurazione delle credenziali SDI se si utilizza l'invio diretto tramite Odoo (se supportato dalla configurazione generale).
|
21
|
+
|
22
|
+
Nel partner è possibile abilitare il campo "Non aggiornare il contatto dai dettagli della fattura elettronica" così i dati del partner non saranno modificati in base a quanto presente in una delle loro fatture durante l'importazione.
|
23
|
+
|
24
|
+
**English**
|
25
|
+
|
26
|
+
The only available configurations are:
|
27
|
+
- E-invoice import detail level: in Invoicing (or Accounting for EE) > Configuration > Settings > Italian Electronic Invoicing, set "E-invoice import detail level" to import electronic invoices without lines, with one line per tax rate, or with all lines (default).
|
28
|
+
This configuration can be overridden by the "E-invoice import detail level" field in each supplier.
|
29
|
+
- Create partner if not existing during import: in Invoicing (or Accounting for EE) > Configuration > Settings > Italian Electronic Invoicing, check this option if you want to enable the functionality for the following node data:
|
30
|
+
- `<CessionarioCommittente>`
|
31
|
+
- `<CedentePrestatore>`
|
32
|
+
- `<RappresentanteFiscale>`
|
33
|
+
|
34
|
+
No other specific configurations are required for l10n_it_edi_extension: once installed, its features are active and automatically integrate into the existing interface.
|
35
|
+
|
36
|
+
However, it's essential to understand that this module is an extension and relies on other pre-existing modules and Odoo's general configuration for Italian localization and electronic invoicing.
|
37
|
+
Therefore, for this module's features to be usable, the dependent modules must be installed and configured:
|
38
|
+
- `account`: Odoo's basic accounting module must be installed and configured (chart of accounts, taxes, journals, etc.).
|
39
|
+
- `l10n_it_edi`: The main module for Italian electronic invoicing must be installed and properly configured. This includes:
|
40
|
+
- Company data configuration (VAT number, fiscal code, tax regime, etc.).
|
41
|
+
- Configuration of accounting journals for issuing electronic invoices (indicating FatturaPA/Electronic format).
|
42
|
+
- Configuration of dedicated sequences for electronic invoice numbering.
|
43
|
+
- Optional SDI credentials configuration if direct sending through Odoo is used (if supported by general configuration).
|
44
|
+
|
45
|
+
In the partner, you can enable "Do not update the contact from Electronic Invoice Details" so that the partner's data are not modified with what is found in one of their imported e-bill.
|