Gantt chat added day,month,week
This commit is contained in:
parent
65acafad06
commit
249938220c
|
@ -23,7 +23,8 @@ var PlanningGanttController = GanttController.extend({
|
|||
* @param {jQueryElement} $node to which the buttons will be appended
|
||||
*/
|
||||
renderButtons: function ($node) {
|
||||
if ($node) {
|
||||
//if ($node) {
|
||||
if (this.model && this.model.get()) {
|
||||
var state = this.model.get();
|
||||
this.$buttons = $(QWeb.render('PlanningGanttView.buttons', {
|
||||
groupedBy: state.groupedBy,
|
||||
|
|
|
@ -24,3 +24,34 @@ class View(models.Model):
|
|||
node.set(action, 'false')
|
||||
|
||||
return node
|
||||
|
||||
"""def _postprocess_access_rights(self, model, node):
|
||||
Model = self.env[model].sudo(False)
|
||||
is_base_model = self.env.context.get('base_model_name', model) == model
|
||||
if node.tag in ('gantt'):
|
||||
for action, operation in (('create', 'create'), ('edit', 'write')):
|
||||
if (not node.get(action) and
|
||||
not Model.check_access_rights(operation, raise_exception=False) or
|
||||
not self._context.get(action, True) and is_base_model):
|
||||
node.set(action, 'false')
|
||||
|
||||
if node.tag in ('kanban', 'tree', 'form', '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
|
||||
not self._context.get(action, True) and is_base_model):
|
||||
node.set(action, 'false')
|
||||
|
||||
if node.tag == 'kanban':
|
||||
group_by_name = node.get('default_group_by')
|
||||
group_by_field = Model._fields.get(group_by_name)
|
||||
if group_by_field and group_by_field.type == 'many2one':
|
||||
group_by_model = Model.env[group_by_field.comodel_name]
|
||||
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(operation, raise_exception=False) or
|
||||
not self._context.get(action, True) and is_base_model):
|
||||
node.set(action, 'false')"""
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue