From ad50324a8e644e42a6e40f1abead4ec510c1fbb0 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 15 Feb 2017 13:04:47 +0100 Subject: [PATCH] [FIX] base: company contact data As a portal user, access one of your invoices from the frontend (download the PDF). The generation of the report crashes because of an access error. The error arises when trying to access the company contact information (address, phone, fax...) displayed in the report footer. This is due an API migration error (7eab8e26d3d). Before the migration, the partner was browsed in `_get_address_data` as: `address = part_obj.read(cr, openerp.SUPERUSER_ID, ...` After the migration, this is not browsed as superuser anymore. Therefore, users with limited access rights won't be able to read it anymore. opw-708581 --- openerp/addons/base/res/res_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_company.py b/openerp/addons/base/res/res_company.py index 86034d6f8a0..cf30ff2652f 100644 --- a/openerp/addons/base/res/res_company.py +++ b/openerp/addons/base/res/res_company.py @@ -164,7 +164,7 @@ class Company(models.Model): for company in self.filtered(lambda company: company.partner_id): address_data = company.partner_id.sudo().address_get(adr_pref=['contact']) if address_data['contact']: - partner = company.partner_id.browse(address_data['contact']) + partner = company.partner_id.browse(address_data['contact']).sudo() company.street = partner.street company.street2 = partner.street2 company.city = partner.city