ITA - Fattura elettronica - Supporto PEC

l10n_it_edi_pec
REPOSITORY
REPOSITORYOCA/l10n-italy
GIT
GIThttps://github.com/OCA/l10n-italy.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_pec
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYLocalization/Italy
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA)
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA)
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, Simone Rubino, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/l10n-italy
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:12
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-financial-reporting:
    - account_tax_balance
OCA/account-financial-tools:
    - account_fiscal_year
OCA/l10n-italy:
    - l10n_it_account
    - l10n_it_edi_sdi
OCA/server-ux:
    - date_range
odoo/odoo:
    - account
    - base_setup
    - base
    - web
    - onboarding
    - product
    - mail
    - bus
    - web_tour
    - html_editor
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - l10n_it
    - base_iban
    - base_vat
    - l10n_it_edi
    - account_edi_proxy_client
    - certificate
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES openupgradelib
cryptography
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
**Italiano**

Questo modulo implementa il canale PEC (Posta Elettronica Certificata)
per la comunicazione con il Sistema di Interscambio (SdI), in
alternativa al proxy IAP standard di Odoo.

Si basa su `l10n_it_edi_sdi` per la logica condivisa di elaborazione
delle notifiche e ricezione delle fatture, aggiungendo il trasporto
specifico via PEC.

Funzionalità principali:

- Invio fatture elettroniche via PEC al SdI
- Ricezione email PEC dal SdI e instradamento ai gestori appropriati
- Gestione errori PEC con notifica automatica ai contatti configurati
  e disabilitazione del server dopo ripetuti fallimenti
- Configurazione server SMTP e IMAP/POP3 dedicati alla PEC

**English**

This module implements the PEC (Certified Email) transport channel for
communication with the Italian Exchange System (SdI), as an alternative
to Odoo's standard IAP proxy.

It builds on `l10n_it_edi_sdi` for the shared notification processing
and invoice reception logic, adding PEC-specific transport.

Main features:

- Send electronic invoices to SdI via PEC
- Receive PEC emails from SdI and route to appropriate handlers
- PEC error handling with automatic notification to configured contacts
  and server auto-disable after repeated failures
- Dedicated SMTP and IMAP/POP3 server configuration for PEC

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
ir_mail_server_form ir.mail.server.form.inherit.l10n.it.edi.pec ir.mail_server xpath Inherits base.ir_mail_server_form
res_config_settings_view_form res.config.settings.view.form.inherit.l10n.it.edi.pec res.config.settings xpath Inherits l10n_it_edi.res_config_settings_view_form
view_email_server_form_e_invoice fetchmail.server.form.inherit.l10n.it.edi.pec fetchmail.server xpath Inherits mail.view_email_server_form
Models touched (6)

New fields (0)

No new fields.

Public methods (1)
  • action_check_l10n_it_edi(self)
    Override to trigger PEC fetch instead of proxy poll.

New fields (4)
  • e_inv_notify_partner_ids Many2many → res.partner
    default=<expr> domain=[('email', '!=', False)] help="Contacts to notify when PEC message can't be processed" string='Contacts to notify' args: 'res.partner'
  • is_l10n_it_edi_pec Boolean
    string='E-invoice PEC server'
  • last_pec_error_message Text
    readonly=True string='Last PEC Error Message'
  • pec_error_count Integer
    readonly=True string='PEC error count'
Public methods (1)
  • fetch_mail(self, raise_exception=True)
    Override to add PEC-specific error tracking and auto-disable. PEC messages are legally relevant: if a message cannot be processed as an electronic invoice, it must NOT be marked as read (IMAP) or deleted (POP3) so it can be manually reviewed, and configured contacts are notified. After repeated failures the server is automatically disabled to prevent silent message loss.

New fields (2)
  • is_l10n_it_edi_pec Boolean
    string='E-invoice PEC server'
  • l10n_it_edi_pec_email_from Char
    help='Email address used as sender for e-invoices sent via PEC.' string='PEC Sender Email Address'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (1)
  • message_route(self, message, message_dict, model=None, thread_id=None, custom_values=None)
    @api.model

New fields (4)
  • l10n_it_edi_pec_email_exchange_system Char
    help='PEC address used to communicate with the Exchange System (SDI).' string='SDI PEC Email Address'
  • l10n_it_edi_pec_fetch_server_id Many2one → fetchmail.server
    domain=[('is_l10n_it_edi_pec', '=', True)] string='Incoming PEC server' args: 'fetchmail.server'
  • l10n_it_edi_pec_server_id Many2one → ir.mail_server
    domain=[('is_l10n_it_edi_pec', '=', True)] string='Outgoing PEC server' args: 'ir.mail_server'
  • l10n_it_edi_use_pec Boolean
    help='If enabled, electronic invoices will be sent and received through PEC (Certified Email) instead of the standard IAP proxy.' string='Use PEC for e-invoicing'
Public methods (0)

No public methods.

New fields (4)
  • l10n_it_edi_pec_email_exchange_system Char
    readonly=False related='company_id.l10n_it_edi_pec_email_exchange_system'
  • l10n_it_edi_pec_fetch_server_id Many2one
    readonly=False related='company_id.l10n_it_edi_pec_fetch_server_id'
  • l10n_it_edi_pec_server_id Many2one
    readonly=False related='company_id.l10n_it_edi_pec_server_id'
  • l10n_it_edi_use_pec Boolean
    readonly=False related='company_id.l10n_it_edi_use_pec'
Public methods (0)

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/l10n-italy
PULL REQUEST
PULL REQUEST[19.0] [MIG] l10n_it_edi_pec: Migration to 19.0 (#5218)