summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2020-02-27 10:08:33 +0000
committerAntoine Prieels <anp@odoo.com>2020-02-27 13:09:32 +0000
commit9db8860840a149261d6d2a0ec404fc223f6b4d72 (patch)
tree7311d7c28f31c965a529bdc3baae4e9d277e110a
parent103e72398a6dcc29128dde401037038b8bce03de (diff)
[FIX] point_of_sale: Connect to the IoT Box in debug
When using the PoS in debug mode in 12.0, the call to the '/hw_proxy/handshake' route contains the 'X-Debug-Mode' header. This header was removed from the 'Access-Control-Allow-Headers' in 13.0, which is used to create the image of the IoT Box. This means that if the code of http.py was not checked out to 12.0 (i.e. when using an IoT Box in Community), the connection would fail and none of the devices could be used. closes odoo/odoo#46442 X-original-commit: e6cfbd35e0878c9c07a98f950495a682c6cff535 Signed-off-by: Antoine Prieƫls <aprieels@users.noreply.github.com>
-rw-r--r--addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/odoo/http.py.iotpatch15
1 files changed, 12 insertions, 3 deletions
diff --git a/addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/odoo/http.py.iotpatch b/addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/odoo/http.py.iotpatch
index 7f9cad6b1a8..7bcfb3e9578 100644
--- a/addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/odoo/http.py.iotpatch
+++ b/addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/odoo/http.py.iotpatch
@@ -1,6 +1,15 @@
---- http_old.py 2019-11-07 15:01:37.190918774 +0100
-+++ http_new.py 2019-11-07 15:02:16.406711394 +0100
-@@ -1496,7 +1496,7 @@
+--- http_old.py 2020-02-27 10:56:47.236000000 +0100
++++ http_new.py 2020-02-27 10:58:30.737536611 +0100
+@@ -763,7 +763,7 @@
+ if request.httprequest.method == 'OPTIONS' and request.endpoint and request.endpoint.routing.get('cors'):
+ headers = {
+ 'Access-Control-Max-Age': 60 * 60 * 24,
+- 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
++ 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, X-Debug-Mode'
+ }
+ return Response(status=200, headers=headers)
+
+@@ -1497,7 +1497,7 @@
"""
httprequest = httprequest or request.httprequest