[FIX] l10n_it_edi: only send e-invoice in IT companies
Have 2 companies, one in FR (with l10n_fr), one in IT (with l10n_it_edi) From the French company create an invoice for a french customer. Confirm. The message ' E-Invoice check failed. You can modify the invoice, and resend it.' related to italian e-invoicing will appear opw-2481035 closes odoo/odoo#69050 X-original-commit: d5075308131f82020702c6650a1869ffd93fb85e Signed-off-by: Josse Colpaert <jco@openerp.com>
This commit is contained in:
@@ -260,7 +260,7 @@ class AccountMove(models.Model):
|
||||
# OVERRIDE
|
||||
posted = super()._post(soft=soft)
|
||||
|
||||
for move in posted.filtered(lambda m: m.l10n_it_send_state == 'to_send' and m.move_type == 'out_invoice'):
|
||||
for move in posted.filtered(lambda m: m.l10n_it_send_state == 'to_send' and m.move_type == 'out_invoice' and m.company_id.country_id.code == 'IT'):
|
||||
move.send_pec_mail()
|
||||
|
||||
return posted
|
||||
|
||||
Reference in New Issue
Block a user