From d6d540a8d594aaa9952b51a1494db09597d64da5 Mon Sep 17 00:00:00 2001 From: "jerome hanke (jhk)" Date: Tue, 21 Jul 2020 20:18:35 +0000 Subject: [PATCH] [FIX] sale: portal generates pdf for the chatter in a separate request Steps to reproduce: - install studio, website and sales - go to sales > open studio > go to 'reports' > Quotation/Order - add a field anywhere on the report with the field expression set to "doc.signature" > save - go to sles > create a quotation > send by email > send > go to the customer portal - sign and send the quotation > go back to the edit mode > open the pdf attached to the latest message in the chatter Previous behavior: the custom field added was not rendered properly, the attachment is not available during the request and the generated pdf shows the placeholder image instead Current behavior: the message posted in the chatter is generated in another request, this makes the attachment available opw-2260989 closes odoo/odoo#54955 X-original-commit: a15cbb0a7be666d3ad438f6470d29cda75c24027 Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Nicolas Martinelli (nim) --- addons/sale/controllers/portal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/controllers/portal.py b/addons/sale/controllers/portal.py index 868235fde64..01a43a9f07a 100644 --- a/addons/sale/controllers/portal.py +++ b/addons/sale/controllers/portal.py @@ -224,6 +224,7 @@ class CustomerPortal(CustomerPortal): 'signed_on': fields.Datetime.now(), 'signature': signature, }) + request.env.cr.commit() except (TypeError, binascii.Error) as e: return {'error': _('Invalid signature data.')}