From 19ed75ddab69d1bf3f7e6b4eb701136fb2caddcf Mon Sep 17 00:00:00 2001 From: Yolann Sabaux Date: Wed, 14 Sep 2022 13:09:41 +0000 Subject: [PATCH] [FIX] mail: revert upload_attachment fix Cookies should be used internally by the web UI. The server-side is not supposed to be aware of it at all. Reverts: odoo#88745 Based on odoo#93812 discussion. It has been decided to revert the fix to avoid further unattended behaviours. closes odoo/odoo#100178 X-original-commit: bdde7dda7356744d459e3991a7f382fee42bf8c5 Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Yolann Sabaux (yosa) --- addons/web/controllers/binary.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/web/controllers/binary.py b/addons/web/controllers/binary.py index ee80fe8f5ed..185a385308b 100644 --- a/addons/web/controllers/binary.py +++ b/addons/web/controllers/binary.py @@ -174,9 +174,7 @@ class Binary(http.Controller): filename = unicodedata.normalize('NFD', ufile.filename) try: - cids = request.httprequest.cookies.get('cids', str(request.env.user.company_id.id)) - allowed_company_ids = [int(cid) for cid in cids.split(',')] - attachment = Model.with_context(allowed_company_ids=allowed_company_ids).create({ + attachment = Model.create({ 'name': filename, 'datas': base64.encodebytes(ufile.read()), 'res_model': model,