diff options
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 896ad1a1889..9b4c8335e35 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -79,7 +79,7 @@ def concat_files(file_list, reader=None, intersperse=""): if reader is None: def reader(f): - with open(f) as fp: + with open(f, 'rb') as fp: return fp.read() files_content = [] @@ -261,8 +261,8 @@ class WebClient(openerpweb.Controller): def reader(f): """read the a css file and absolutify all relative uris""" - with open(f) as fp: - data = fp.read() + with open(f, 'rb') as fp: + data = fp.read().decode('utf-8') path = file_map[f] # convert FS path into web path @@ -279,7 +279,7 @@ class WebClient(openerpweb.Controller): r"""url(\1%s/""" % (web_dir,), data, ) - return data + return data.encode('utf-8') content, checksum = concat_files((f[0] for f in files), reader) @@ -802,9 +802,6 @@ def fix_view_modes(action): new view mode ``list`` which is the result of the ``tree`` view_mode in conjunction with the ``form`` view_type. - This method also adds a ``page`` view mode in case there is a ``form`` in - the input action. - TODO: this should go into the doc, some kind of "peculiarities" section :param dict action: an action descriptor @@ -818,8 +815,6 @@ def fix_view_modes(action): if mode == 'form': id_form = id break - if id_form is not None: - action['views'].insert(index + 1, (id_form, 'page')) if action.pop('view_type', 'form') != 'form': return action @@ -875,13 +870,13 @@ class Menu(openerpweb.Controller): context = req.session.eval_context(req.context) Menus = req.session.model('ir.ui.menu') - menu_roots = Menus.read(self.do_get_user_roots(req), ['name', 'sequence', 'parent_id', 'action'], context) + menu_roots = Menus.read(self.do_get_user_roots(req), ['name', 'sequence', 'parent_id', 'action', 'needaction_enabled', 'needaction_counter'], context) menu_root = {'id': False, 'name': 'root', 'parent_id': [-1, ''], 'children' : menu_roots} # menus are loaded fully unlike a regular tree view, cause there are a # limited number of items (752 when all 6.1 addons are installed) menu_ids = Menus.search([], 0, False, False, context) - menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action'], context) + menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action', 'needaction_enabled', 'needaction_counter'], context) # adds roots at the end of the sequence, so that they will overwrite # equivalent menu items from full menu read when put into id:item # mapping, resulting in children being correctly set on the roots. @@ -1083,6 +1078,7 @@ class View(openerpweb.Controller): arch = fvg['arch'].encode('utf-8') else: arch = fvg['arch'] + fvg['arch_string'] = arch if transform: evaluation_context = session.evaluation_context(context or {}) |
