Skip to content

Commit d67e9df

Browse files
committed
[FIX] l10n_it_fatturapa_pec - user without permission to access settings can send a PEC
1 parent d63c837 commit d67e9df

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def send_via_pec(self):
6363
}
6464
)
6565

66-
mail = self.env["mail.mail"].create(
66+
mail = self.env["mail.mail"].sudo().create(
6767
{
6868
"mail_message_id": mail_message.id,
6969
"body_html": mail_message.body,

l10n_it_fatturapa_pec/models/sdi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def check_email_validity(self):
8585
)
8686

8787
def check_first_pec_sending(self):
88-
sdi_address = self.env["ir.config_parameter"].get_param("sdi.pec.first.address")
88+
sdi_address = self.env["ir.config_parameter"].sudo().get_param("sdi.pec.first.address")
8989
if not self.first_invoice_sent:
9090
if self.email_exchange_system != sdi_address:
9191
raise exceptions.UserError(

0 commit comments

Comments
 (0)