diff options
| author | Hiral Bhavsar <hbh@odoo.com> | 2019-02-13 13:00:19 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2019-06-17 11:34:17 +0000 |
| commit | 3cd7ed07a29c89ddf193796c20a812b9bf21e284 (patch) | |
| tree | 4d5ee7bbacec81a2254eb6f6f6a7cecf0a0d649c /odoo/tools | |
| parent | 3ab5612e4f5ec64ffa4a9b7cbf925af11a79a7fd (diff) | |
[IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.
Task 1937686
closes odoo/odoo#31243
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo/tools')
| -rw-r--r-- | odoo/tools/convert.py | 3 | ||||
| -rw-r--r-- | odoo/tools/test_reports.py | 17 |
2 files changed, 12 insertions, 8 deletions
diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index ac4098d4f84..32abc805b92 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -342,7 +342,6 @@ form: module.record_id""" % (xml_id,) domain = rec.get('domain') or '[]' res_model = rec.get('res_model') binding_model = rec.get('binding_model') - view_type = rec.get('view_type') or 'form' view_mode = rec.get('view_mode') or 'tree,form' usage = rec.get('usage') limit = rec.get('limit') @@ -371,7 +370,6 @@ form: module.record_id""" % (xml_id,) 'domain': domain, 'res_model': res_model, 'src_model': binding_model, - 'view_type': view_type, 'view_mode': view_mode, 'usage': usage, 'limit': limit, @@ -398,7 +396,6 @@ form: module.record_id""" % (xml_id,) 'domain': domain, 'context': context, 'res_model': res_model, - 'view_type': view_type, 'view_mode': view_mode, 'usage': usage, 'limit': limit, diff --git a/odoo/tools/test_reports.py b/odoo/tools/test_reports.py index 3e745990dd3..cc32313fa04 100644 --- a/odoo/tools/test_reports.py +++ b/odoo/tools/test_reports.py @@ -139,27 +139,34 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None, context.update(context1) env = env(context=context) if action['type'] in ['ir.actions.act_window', 'ir.actions.submenu']: - for key in ('res_id', 'res_model', 'view_type', 'view_mode', + for key in ('res_id', 'res_model', 'view_mode', 'limit', 'search_view', 'search_view_id'): datas[key] = action.get(key, datas.get(key, None)) view_id = False + view_type = None if action.get('views', []): if isinstance(action['views'],list): - view_id = action['views'][0][0] - datas['view_mode']= action['views'][0][1] + view_id, view_type = action['views'][0] + datas['view_mode']= view_type else: if action.get('view_id', False): view_id = action['view_id'][0] elif action.get('view_id', False): view_id = action['view_id'][0] + if view_type is None: + if view_id: + view_type = env['ir.ui.view'].browse(view_id).type + else: + view_type = action['view_mode'].split(',')[0] + assert datas['res_model'], "Cannot use the view without a model" # Here, we have a view that we need to emulate log_test("will emulate a %s view: %s#%s", - action['view_type'], datas['res_model'], view_id or '?') + view_type, datas['res_model'], view_id or '?') - view_res = env[datas['res_model']].fields_view_get(view_id, action['view_type']) + view_res = env[datas['res_model']].fields_view_get(view_id, view_type=view_type) assert view_res and view_res.get('arch'), "Did not return any arch for the view" view_data = {} if view_res.get('fields'): |
