[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) <lpe@odoo.com>
This commit is contained in:
Lucas Perais (lpe)
2019-07-08 15:03:50 +00:00
parent fb95cf7b51
commit 674ee035ca
+1 -1
View File
@@ -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