diff options
| author | Darshan Kalola <dka@tinyerp.com> | 2014-04-17 13:40:33 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-04-17 13:40:33 +0200 |
| commit | 7cd07d0c1fbff8229529a7a1c2ab2ccb4d88ea2e (patch) | |
| tree | 3be6c50a73889e143c66c7815c7a672eb5b8ab42 | |
| parent | e6f8666b521fe8c2522d6e94c0c3def54a5f73ed (diff) | |
| parent | 2f9c0ad1afd89f26d7b357275605d85aba575d0e (diff) | |
[MERGE] [IMP] ir_ui_view: kanban view: also add action_enabled information
about the columns in kanban view. This allows to display the 'create a new column', as well as 'edit' or 'delete'
options on column in kanban view, based on the users' access rights.
bzr revid: tde@openerp.com-20140417114033-39rez93cmcwask69
| -rw-r--r-- | openerp/addons/base/ir/ir_ui_view.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index f67f65f2c1c..314865ae066 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -698,6 +698,16 @@ class view(osv.osv): for action, operation in (('create', 'create'), ('delete', 'unlink'), ('edit', 'write')): if not node.get(action) and not Model.check_access_rights(cr, user, operation, raise_exception=False): node.set(action, 'false') + if node.tag in ('kanban'): + group_by_field = node.get('default_group_by') + if group_by_field and Model._all_columns.get(group_by_field): + group_by_column = Model._all_columns[group_by_field].column + if group_by_column._type == 'many2one': + group_by_model = Model.pool.get(group_by_column._obj) + for action, operation in (('group_create', 'create'), ('group_delete', 'unlink'), ('group_edit', 'write')): + if not node.get(action) and not group_by_model.check_access_rights(cr, user, operation, raise_exception=False): + node.set(action, 'false') + arch = etree.tostring(node, encoding="utf-8").replace('\t', '') for k in fields.keys(): if k not in fields_def: |
