From cef65f589d27f8e906b4edf52e50da4d88f1d0d9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 26 Jun 2020 07:33:02 +0000 Subject: [PATCH] [FIX] web,point_of_sale: print report preview with current company In 13.0, the current company selected in the company switcher can be different than self.env.user.company_id value. Wizard "Configure Document Layout" (model base.document.layout) is using the company in company switcher: ``` company_id = fields.Many2one( 'res.company', default=lambda self: self.env.company, required=True) ``` But the "Preview Document" button is using user company_id, so if you change the layout then preview, you may see the report layout of another company which make it seemed broken. note: also improve code of point of sale added in 59f5e57 (in case of point of sale, company maybe should be point of sale company but you can print several ones and the company used on point of sales is the one of company switcher). opw-2269849 closes #53712 closes odoo/odoo#53730 X-original-commit: bbb45e3412a5653d78aacc92903e95d1353ed60a Signed-off-by: Nicolas Lempereur (nle) --- addons/point_of_sale/views/report_saledetails.xml | 2 +- addons/web/views/report_templates.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/views/report_saledetails.xml b/addons/point_of_sale/views/report_saledetails.xml index e52fca524ff..5ca914f5502 100644 --- a/addons/point_of_sale/views/report_saledetails.xml +++ b/addons/point_of_sale/views/report_saledetails.xml @@ -2,7 +2,7 @@