From 674ee035ca954a57341cbaa951d2f6f31b5f8fe2 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 8 Jul 2019 15:03:50 +0000 Subject: [PATCH] [FIX] account: vendor display name multicompany In multicompany mode, /!\ Adress book sharing should be deactivated User A in company A creates a vendor bill without a partner User B in company observes the list. The new bill is present User A changes companies and goes to company B User B doesn't have access to company B User B reloads the list Before this commit, there was an access right error on User B side because the partner associated with User A changed company, and is now unreadable from User B perspective After this commit, there is no crash and we have the string: Created By User A in the list in place of the vendor display name OPW 2028451 closes odoo/odoo#34668 Signed-off-by: Lucas Perais (lpe) --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index f70b61bbe44..644f5dcd256 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -416,7 +416,7 @@ class AccountInvoice(models.Model): vendor_display_name = _('From: ') + invoice.source_email invoice.invoice_icon = '@' else: - vendor_display_name = ('Created by: ') + invoice.create_uid.name + vendor_display_name = ('Created by: ') + invoice.sudo().create_uid.name invoice.invoice_icon = '#' invoice.vendor_display_name = vendor_display_name