From 8ab9cd3411d89dbe29f8e9252177e5e0b45b4d76 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 20 Jun 2011 12:58:18 +0200 Subject: [PATCH] [imp] changed bin_size behavior bzr revid: nicolas.vanhoren@openerp.com-20110620105818-gq2ajlxl4npwn038 --- addons/base/controllers/main.py | 5 ++--- openerpweb/openerpweb.py | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index bc4a1eac616..3f519f30962 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -761,12 +761,11 @@ class Action(openerpweb.Controller): Actions = req.session.model('ir.actions.actions') value = False context = req.session.eval_context(req.context) + context["bin_size"] = False action_type = Actions.read([action_id], ['type'], context) if action_type: action = req.session.model(action_type[0]['type']).read([action_id], False, - #TODO fme: check why does not work with context - #context) - {}) + context) if action: value = clean_action(action[0], req.session) return {'result': value} diff --git a/openerpweb/openerpweb.py b/openerpweb/openerpweb.py index fa2bec8e4b5..9da14d5ace0 100644 --- a/openerpweb/openerpweb.py +++ b/openerpweb/openerpweb.py @@ -138,6 +138,9 @@ class OpenERPSession(object): """ assert self._uid, "The user needs to be logged-in to initialize his context" self.context = self.model('res.users').context_get(self.context) + # set bin_size to True all the time + self.context = self.context or {} + self.context["bin_size"] = True self.client_timezone = self.context.get("tz", False) # invalid code, anyway we decided the server will be in UTC