File tree Expand file tree Collapse file tree
l10n_it_fatturapa_pec/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,15 +63,19 @@ def send_via_pec(self):
6363 }
6464 )
6565
66- mail = self .env ["mail.mail" ].create (
67- {
68- "mail_message_id" : mail_message .id ,
69- "body_html" : mail_message .body ,
70- "email_to" : self .env .company .email_exchange_system ,
71- "headers" : {
72- "Return-Path" : self .env .company .email_from_for_fatturaPA
73- },
74- }
66+ mail = (
67+ self .env ["mail.mail" ]
68+ .sudo ()
69+ .create (
70+ {
71+ "mail_message_id" : mail_message .id ,
72+ "body_html" : mail_message .body ,
73+ "email_to" : self .env .company .email_exchange_system ,
74+ "headers" : {
75+ "Return-Path" : self .env .company .email_from_for_fatturaPA
76+ },
77+ }
78+ )
7579 )
7680
7781 if mail :
Original file line number Diff line number Diff line change @@ -85,7 +85,9 @@ 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 = (
89+ self .env ["ir.config_parameter" ].sudo ().get_param ("sdi.pec.first.address" )
90+ )
8991 if not self .first_invoice_sent :
9092 if self .email_exchange_system != sdi_address :
9193 raise exceptions .UserError (
You can’t perform that action at this time.
0 commit comments