From 50c8b3d4efb527f39a9405b171ad348fa164c84f Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Mon, 12 Oct 2015 09:44:45 +0200 Subject: [PATCH] [FIX] point_of_sale: set CSRF token The introduction of the CSRF tokens in 8932c52e672ef106d5614643511ea2b8cbe54473 broke invoicing from the Point of Sale. chrome.do_action('point_of_sale.pos_invoice_report') would fail because no CSRF token is set in the POS. This fixes it using a similar approach as in the website module. --- addons/point_of_sale/views/templates.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/views/templates.xml b/addons/point_of_sale/views/templates.xml index 0d69cc157ee..1c6627b631f 100644 --- a/addons/point_of_sale/views/templates.xml +++ b/addons/point_of_sale/views/templates.xml @@ -46,8 +46,13 @@ }); return web_client; }); - + odoo.define('web.csrf', function (require) { + var token = ""; + require('web.core').csrf_token = token; + require('qweb').default_dict.csrf_token = token; + }); +