From 0d3662432bb589300675c850f240466e6c677136 Mon Sep 17 00:00:00 2001 From: Tony Masci Date: Tue, 5 Mar 2024 12:20:32 +0100 Subject: [PATCH] [FIX] l10n_it_edi: make the Cron work in multi-company When the Cron runs in a multi-company environment, all invoices imported only in first company. They should be imported in the company they belong to. Ticket link: https://www.odoo.com/web#model=project.task&id=3744537 opw-3744537 closes odoo/odoo#156462 Signed-off-by: Josse Colpaert --- addons/l10n_it_edi/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_it_edi/models/account_move.py b/addons/l10n_it_edi/models/account_move.py index 96676b7a0bd..bb4bd5d5200 100644 --- a/addons/l10n_it_edi/models/account_move.py +++ b/addons/l10n_it_edi/models/account_move.py @@ -632,7 +632,7 @@ class AccountMove(models.Model): # then try and fill it with the content imported from the attachment. # Should the import fail, thanks to try..except and savepoint, # we will anyway end up with an empty `in_invoice` with the attachment posted on it. - if move := self.with_company(self.company_id)._l10n_it_edi_create_move_with_attachment( + if move := self.with_company(proxy_user.company_id)._l10n_it_edi_create_move_with_attachment( invoice_data['filename'], invoice_data['file'], invoice_data['key'],