summaryrefslogtreecommitdiff
path: root/addons/purchase/controllers
diff options
context:
space:
mode:
authorAchraf (abz) <abz@odoo.com>2020-11-18 15:19:31 +0000
committerAchraf (abz) <abz@odoo.com>2020-11-19 12:50:58 +0000
commit044bca5e64451d86c6f7c9dbb919c0c319a37bd5 (patch)
treec9886f3aef024d751b743bbca0a2bb9d251fac5d /addons/purchase/controllers
parentba907de2a8fad7351b1b66cd96d76d870eeb0d6a (diff)
[FIX] purchase: Display the right logo in portal with multicompany
What are the steps to reproduce your issue ? 1. Create two companies on a multi-company database without Website installed. For this use case, install Purchase 2. Configure two distinct logos per company 3. Create a Purchase Order with the second company. 4. Send PO from second company over as email. 5. Check recipient email (or mailhog for Runbot) for the email 6. Find that while the PDF report reflects second company's logo, the header navigation bar in the client email when clicking "View Request for Quotation" reflects company_id=1's logo. What is currently happening ? The displayed logo is not the correct one. What are you expecting to happen ? Display the right logo. Why is this happening ? Because when rendering the view. The value of 'res_company' declared in the context has as value the id of the default company of the user How to fix the bug ? Specify the current company. opw-2380274 closes odoo/odoo#62013 X-original-commit: 5eb40d222d58eab5a1414c4b25cd6e161ece10db Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/purchase/controllers')
-rw-r--r--addons/purchase/controllers/portal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/purchase/controllers/portal.py b/addons/purchase/controllers/portal.py
index cd1b999d09a..82de7c58239 100644
--- a/addons/purchase/controllers/portal.py
+++ b/addons/purchase/controllers/portal.py
@@ -119,6 +119,8 @@ class CustomerPortal(CustomerPortal):
values = self._purchase_order_get_page_view_values(order_sudo, access_token, **kw)
update_date = kw.get('update')
+ if order_sudo.company_id:
+ values['res_company'] = order_sudo.company_id
if update_date == 'True':
return request.render("purchase.portal_my_purchase_order_update_date", values)
return request.render("purchase.portal_my_purchase_order", values)