[IMP] base, mail: set CRUD on activity view as attributes
Just like other views (form, list, kanban, etc.) CRUD operations (create, delete and edit) are now set as attributes on the activity node based on the user access rights. Task 1894990
This commit is contained in:
committed by
Martin Geubelle
parent
132c0ad9bf
commit
a02d273ebc
@@ -44,6 +44,7 @@ var ActivityController = BasicController.extend({
|
||||
res_model: state.model,
|
||||
domain: this.model.originalDomain,
|
||||
title: _.str.sprintf(_t("Search: %s"), this.renderer.arch.attrs.string),
|
||||
no_create: !this.activeActions.create,
|
||||
disable_multiple_selection: true,
|
||||
on_selected: function (record) {
|
||||
var fakeRecord = self.renderer.getKanbanActivityData({}, record[0]);
|
||||
|
||||
@@ -1177,7 +1177,7 @@ actual arch.
|
||||
not self._context.get("create", True) and is_base_model):
|
||||
node.set("create", 'false')
|
||||
|
||||
if node.tag in ('kanban', 'tree', 'form', 'gantt'):
|
||||
if node.tag in ('kanban', 'tree', 'form', 'gantt', 'activity'):
|
||||
for action, operation in (('create', 'create'), ('delete', 'unlink'), ('edit', 'write')):
|
||||
if (not node.get(action) and
|
||||
not Model.check_access_rights(operation, raise_exception=False) or
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<define name="activity">
|
||||
<element name="activity">
|
||||
<attribute name="string"/>
|
||||
<optional><attribute name="create"/></optional>
|
||||
<interleave>
|
||||
<zeroOrMore><ref name="field"/></zeroOrMore>
|
||||
<optional>
|
||||
|
||||
Reference in New Issue
Block a user