[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
This commit is contained in:
commit
7cd07d0c1f
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue