summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/views
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2020-06-26 07:33:02 +0000
committerNicolas Lempereur <nle@odoo.com>2020-06-26 11:04:05 +0000
commitcef65f589d27f8e906b4edf52e50da4d88f1d0d9 (patch)
tree0e9426ef4322e827f4105863d111a8c4bf4a8086 /addons/point_of_sale/views
parente01ad94c4b5e09984df1f45ee26cb71bd395a3cc (diff)
[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) <nle@odoo.com>
Diffstat (limited to 'addons/point_of_sale/views')
-rw-r--r--addons/point_of_sale/views/report_saledetails.xml2
1 files changed, 1 insertions, 1 deletions
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 @@
<openerp>
<data>
<template id="report_saledetails">
- <t t-set="company" t-value="env['res.company'].browse(env.context.get('allowed_company_ids', [None])[0])"/>
+ <t t-set="company" t-value="env.company"/>
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div class="page">