From 577333f5485723636c81db7e13bfab3af7d95620 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 19 Mar 2019 14:33:07 +0000 Subject: [PATCH] [FIX] account: invoice alias in multi company Install accounting in a multi company environment. Configure email server. Configure an alias for the vendor bill journal per company. Before this commit, all the invoices were created in the same company, regardless of the alias used. Now, the invoice is created in the company of the used alias. opw-1939909 closes odoo/odoo#31948 Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 00bdabb7f9e..c4569e91886 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -580,8 +580,7 @@ class AccountJournal(models.Model): if self.company_id != self.env.ref('base.main_company'): alias_name += '-' + str(self.company_id.name) return { - 'alias_defaults': {'type': 'in_invoice'}, - 'alias_user_id': self.env.user.id, + 'alias_defaults': {'type': 'in_invoice', 'company_id': self.company_id.id}, 'alias_parent_thread_id': self.id, 'alias_name': re.sub(r'[^\w]+', '-', alias_name) }