From 42c404b262564d476a67004c2195bbe8b03239eb Mon Sep 17 00:00:00 2001 From: David Tran Date: Tue, 16 May 2023 07:32:26 +0000 Subject: [PATCH] [FIX] sale: log notes with wrong quotation viewer The note "Quotation viewed by customer" posted when a public/portal user access an order came with the order's partner name instead of the actual user's partner name This made confused for internal users to see something in internal note like **Colleen Diaz** with a message **Quotation viewed by customer Nicole Ford** This commit makes sure to use the right partner name except the quotation is viewed anonymously (with access token) closes odoo/odoo#121571 X-original-commit: 8e37dcee1f5106e69d5784439e2657acf5706e4e Signed-off-by: Victor Feyens (vfe) --- addons/sale/controllers/portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/controllers/portal.py b/addons/sale/controllers/portal.py index bb0e0647316..061a7d0194c 100644 --- a/addons/sale/controllers/portal.py +++ b/addons/sale/controllers/portal.py @@ -130,7 +130,7 @@ class CustomerPortal(portal.CustomerPortal): # The "Quotation viewed by customer" log note is an information # dedicated to the salesman and shouldn't be translated in the customer/website lgg context = {'lang': order_sudo.user_id.partner_id.lang or order_sudo.company_id.partner_id.lang} - msg = _('Quotation viewed by customer %s', order_sudo.partner_id.name) + msg = _('Quotation viewed by customer %s', order_sudo.partner_id.name if request.env.user._is_public() else request.env.user.partner_id.name) del context _message_post_helper( "sale.order",