mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
ADD security to project.task.line and show on website.
`website_project_task` module now includes optional template to display Todo List on the task view
This commit is contained in:
@@ -13,6 +13,7 @@ Adds "todo" lines onto Project Tasks, and improves sub-tasks.
|
|||||||
'project',
|
'project',
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
|
'security/ir.model.access.csv',
|
||||||
'views/project_views.xml',
|
'views/project_views.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ class ProjectTask(models.Model):
|
|||||||
def _compute_subtask_count(self):
|
def _compute_subtask_count(self):
|
||||||
for task in self:
|
for task in self:
|
||||||
task.subtask_count = self.search_count([('id', 'child_of', task.id), ('id', '!=', task.id)])
|
task.subtask_count = self.search_count([('id', 'child_of', task.id), ('id', '!=', task.id)])
|
||||||
task.subtask_count_done = self.search_count([('id', 'child_of', task.id), ('id', '!=', task.id), ('stage_id.fold', '=', True)])
|
if task.subtask_count:
|
||||||
|
task.subtask_count_done = self.search_count([('id', 'child_of', task.id), ('id', '!=', task.id),
|
||||||
|
('stage_id.fold', '=', True)])
|
||||||
|
else:
|
||||||
|
task.subtask_count_done = 0
|
||||||
|
|
||||||
|
|
||||||
class ProjectTaskLine(models.Model):
|
class ProjectTaskLine(models.Model):
|
||||||
|
|||||||
3
project_task_line/security/ir.model.access.csv
Normal file
3
project_task_line/security/ir.model.access.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||||
|
"access_project_task_line","access_project_task_line","model_project_task_line","base.group_user",1,1,1,1
|
||||||
|
"access_project_task_line_public","access_project_task_line public","model_project_task_line","base.group_public",1,0,0,0
|
||||||
|
@@ -36,4 +36,22 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template id="my_task_todo" inherit_id='project.portal_my_task' name="Todo List (requires project_task_line)" customize_show="True" active="False">
|
||||||
|
<xpath expr="//t[@t-if='task.description']" position="before">
|
||||||
|
<t t-if="task.line_ids">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<strong>Todo List</strong>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li t-foreach="task.line_ids" t-as="line">
|
||||||
|
<span t-if="line.kanban_state == 'normal'" class="text-muted"><i class="fa fa-circle"></i></span>
|
||||||
|
<span t-if="line.kanban_state == 'done'" class="text-success"><i class="fa fa-check-circle"></i></span>
|
||||||
|
<span t-if="line.kanban_state == 'blocked'" class="text-danger"><i class="fa fa-times-circle"></i></span>
|
||||||
|
<span t-field="line.name"/>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user