Browse Source

[ADD] Initial Commit

pull/81/head
SHEREEF PT 8 years ago
parent
commit
1ce0a0a8bc
  1. 19
      project_subtask/README.rst
  2. 24
      project_subtask/__init__.py
  3. 46
      project_subtask/__openerp__.py
  4. 24
      project_subtask/models/__init__.py
  5. 238
      project_subtask/models/project.py
  6. 98
      project_subtask/models/sub_task_report.py
  7. BIN
      project_subtask/static/description/11.png
  8. BIN
      project_subtask/static/description/Icon.png
  9. BIN
      project_subtask/static/description/banner.jpg
  10. BIN
      project_subtask/static/description/count.png
  11. 164
      project_subtask/static/description/index.html
  12. BIN
      project_subtask/static/description/sub_task.png
  13. BIN
      project_subtask/static/description/task.png
  14. BIN
      project_subtask/static/description/task2.png
  15. BIN
      project_subtask/static/description/task3.png
  16. BIN
      project_subtask/static/description/task4.png
  17. BIN
      project_subtask/static/description/task5.png
  18. BIN
      project_subtask/static/description/task6.png
  19. 20
      project_subtask/views/project_view.xml
  20. 131
      project_subtask/views/sub_task.xml
  21. 26
      project_subtask/views/sub_task_report.xml
  22. 84
      project_subtask/views/sub_task_type_view.xml
  23. 61
      project_subtask/views/task_view.xml

19
project_subtask/README.rst

@ -0,0 +1,19 @@
Sub-Task Implementation & Reports v9
====================================
Implementation & Reports of Sub-Task in Project Module.
Features
========
* User can decide whether the project need sub task feature or not.
* Sub-task Lines Under Task Form.
* Sub-task Kanban View
* Sub-Task Count in Task Kanban View.
* Sub-Task Dynamic Analysis Under Report.
* Deadline Validation for Sub-Task.
* Stage Validation for Sub-Task.
Credits
=======
Developer: Nilmar Shereef @ cybrosys, shereef@cybrosys.in
Developer: Jesni Banu @ cybrosys, jesni@cybrosys.in

24
project_subtask/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import models

46
project_subtask/__openerp__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Sub Tasks in Project',
'version': '9.0.1.0.0',
'summary': """Implementation & Reports of Sub-Task in Project Module""",
'description': 'This module helps you to create sub task under a task',
'category': 'Project Management',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'depends': ['base', 'project'],
'data': [
'views/project_view.xml',
'views/task_view.xml',
'views/sub_task.xml',
'views/sub_task_report.xml',
'views/sub_task_type_view.xml'
],
'images': ['static/description/project_banner.jpg'],
'license': 'LGPL-3',
'demo': [],
'installable': True,
'auto_install': False,
'application': False,
}

24
project_subtask/models/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import project
import sub_task_report

238
project_subtask/models/project.py

@ -0,0 +1,238 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api, fields, _
from openerp.exceptions import Warning, ValidationError
class ProjectMaster(models.Model):
_inherit = 'project.project'
use_sub_task = fields.Boolean(string="SubTasks", default=True)
label_sub_tasks = fields.Char(default='SubTasks')
class SubTaskMaster(models.Model):
_name = 'project.sub_task'
@api.constrains('date_deadline', 'task_ref')
def date_deadline_validation(self):
if self.date_deadline > self.task_ref.date_deadline:
raise ValidationError(_("Your main task will dead at this date"))
name = fields.Char(string="Name", requires=True)
priority = fields.Selection([('0', 'Normal'), ('1', 'High')], 'Priority', select=True, default='0')
assigned_user = fields.Many2one('res.users', string="Assigned Person", required=1)
task_ref = fields.Many2one('project.task', string='Task', required=1, domain=['|', '|', ('project_id.use_sub_task', '=', True),
('stage_id.done_state', '=', False),
('stage_id.cancel_state', '=', False)])
stage_id = fields.Many2one('project.sub_task.type', string='Stage', select=True,
domain="[('task_ids', '=', task_ref)]", copy=False)
project_id = fields.Many2one('project.project', related='task_ref.project_id', string='Project')
notes = fields.Html(string='Notes')
planned_hours = fields.Float(string='Initially Planned Hours',
help='Estimated time to do the Subtask, usually set by the project manager when the '
'task is in draft state.')
partner_id = fields.Many2one('res.partner', string='Customer', related='task_ref.partner_id', readonly=1)
color = fields.Integer(string='Color Index')
attachment_ids = fields.One2many('ir.attachment', 'res_id', domain=lambda self: [('res_model', '=', self._name)],
auto_join=True, string='Attachments')
displayed_image_id = fields.Many2one('ir.attachment',
domain="[('res_model', '=', 'project.sub_task'), ('res_id', '=', id), ('mimetype', 'ilike', 'image')]",
string='Displayed Image')
tag_ids = fields.Many2one('project.sub_task.tags', string='Tags')
write_date = fields.Datetime(string='Last Modification Date', readonly=True, select=True)
date_start = fields.Datetime(string='Starting Date', readonly=True, select=True)
date_deadline = fields.Date(string='Deadline')
active = fields.Boolean(string='Active', default=True)
description = fields.Html(String='Description')
sequence = fields.Integer(string='Sequence', select=True, default=10,
help="Gives the sequence order when displaying a list of sub tasks.")
company_id = fields.Many2one('res.company', string='Company')
date_last_stage_update = fields.Datetime(string='Last Stage Update', select=True, copy=False, readonly=True)
date_assign = fields.Datetime(string='Assigning Date', select=True, copy=False, readonly=True)
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
if isinstance(cases, (int, long)):
cases = self.browse(cr, uid, cases, context=context)
section_ids = []
if section_id:
section_ids.append(section_id)
for task in cases:
if task.project_id:
section_ids.append(task.project_id.id)
search_domain = []
if section_ids:
search_domain = [('|')] * (len(section_ids) - 1)
for section_id in section_ids:
search_domain.append(('project_ids', '=', section_id))
search_domain += list(domain)
stage_ids = self.pool.get('project.sub_task.type').search(cr, uid, search_domain, order=order, context=context)
if stage_ids:
return stage_ids[0]
return False
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
if context is None:
context = {}
return self.stage_find(cr, uid, [], context.get('default_project_id'), [('fold', '=', False)], context=context)
_defaults = {
'stage_id': _get_default_stage_id,
'date_last_stage_update': fields.Datetime.now(),
'date_start': fields.Datetime.now(),
}
class TaskMaster(models.Model):
_inherit = 'project.task'
sub_task_lines = fields.One2many('project.sub_task', 'task_ref', string='Sub Tasks')
date_deadline = fields.Date('Deadline', select=True, copy=False, required=1)
use_sub_task = fields.Boolean(string="SubTasks", related='project_id.use_sub_task')
subtask_count = fields.Integer(string='Count', compute='sub_task_found')
@api.depends('sub_task_lines')
def sub_task_found(self):
for each in self:
each.subtask_count = len(each.sub_task_lines)
@api.constrains('stage_id')
def restrict(self):
obj = self.env['project.sub_task.type'].search([('cancel_state', '=', True)])
if self.stage_id.cancel_state:
for each in self.sub_task_lines:
each.write({'stage_id': obj.id})
if self.stage_id.done_state:
for each in self.sub_task_lines:
if not each.stage_id.done_state:
raise ValidationError(_("You can't move it to final stage. Some child tasks are not completed yet.!"))
def _check_child_task(self, cr, uid, ids, context=None):
if context == None:
context = {}
tasks = self.browse(cr, uid, ids, context=context)
for task in tasks:
if task.sub_task_lines:
for child in task.sub_task_lines:
if child.stage_id and not child.stage_id.fold:
raise Warning("Sub task still open.\nPlease cancel or complete child task first.")
else:
child.unlink()
return True
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
self._check_child_task(cr, uid, ids, context=context)
res = super(TaskMaster, self).unlink(cr, uid, ids, context)
return res
def write(self, cr, uid, ids, vals, context=None):
if vals.get('alias_model'):
model_ids = self.pool.get('ir.model').search(cr, uid,
[('model', '=', vals.get('alias_model', 'project.sub_task'))])
vals.update(alias_model_id=model_ids[0])
res = super(TaskMaster, self).write(cr, uid, ids, vals, context=context)
if 'active' in vals:
projects = self.browse(cr, uid, ids, context)
tasks = projects.with_context(active_test=False).mapped('sub_task_lines')
tasks.write({'active': vals['active']})
return res
class ProjectTaskType(models.Model):
_inherit = 'project.task.type'
done_state = fields.Boolean(string='Final Stage',
help='This stage is Final Stage.')
cancel_state = fields.Boolean(string='Cancel Stage',
help='This stage is Cancel Stage.')
@api.onchange('done_state', 'cancel_state')
def set_done(self):
obj = self.env['project.task.type'].search([])
if self.done_state is True:
for each in obj:
if each.id != self.id:
each.write({'done_state': False})
if self.cancel_state is True:
for each in obj:
if each.id != self.id:
each.write({'cancel_state': False})
class ProjectSubTaskType(models.Model):
_name = 'project.sub_task.type'
_description = 'Sub Task Stage'
_order = 'sequence'
name = fields.Char(string='Stage Name', required=True, translate=True)
description = fields.Text(string='Description', translate=True)
sequence = fields.Integer(string='Sequence')
task_ids = fields.Many2many('project.task', string="Task Ids")
legend_priority = fields.Char(string='Priority Management Explanation', translate=True,
help='Explanation text to help users using the star and priority mechanism on stages '
'or issues that are in this stage.')
legend_blocked = fields.Char(string='Kanban Blocked Explanation', translate=True,
help='Override the default value displayed for the blocked state for kanban selection,'
'when the task or issue is in that stage.')
legend_done = fields.Char(string='Kanban Valid Explanation', translate=True,
help='Override the default value displayed for the done state for kanban selection, when '
'the task or issue is in that stage.')
legend_normal = fields.Char(string='Kanban Ongoing Explanation', translate=True,
help='Override the default value displayed for the normal state for kanban selection, '
'when the task or issue is in that stage.')
fold = fields.Boolean(string='Folded in Tasks Pipeline',
help='This stage is folded in the kanban view when '
'there are no records in that stage to display.')
done_state = fields.Boolean(string='Final Stage',
help='This stage is Final Stage.')
cancel_state = fields.Boolean(string='Cancel Stage',
help='This stage is Cancel Stage.')
@api.onchange('done_state', 'cancel_state')
def set_done(self):
obj = self.env['project.task.type'].search([])
if self.done_state is True:
for each in obj:
if each.id != self.id:
each.write({'done_state': False})
if self.cancel_state is True:
for each in obj:
if each.id != self.id:
each.write({'cancel_state': False})
def _get_default_task_ids(self, cr, uid, ctx=None):
if ctx is None:
ctx = {}
default_task_ids = ctx.get('default_task_ids')
return [default_task_ids] if default_task_ids else None
_defaults = {
'sequence': 1,
'task_ids': _get_default_task_ids,
}
_order = 'sequence'

98
project_subtask/models/sub_task_report.py

@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import fields, osv
from openerp import tools
class ProjectSubtaskHistory(osv.osv):
_name = "report.project.subtask.user"
_description = "Sub Tasks by user and project"
_auto = False
_columns = {
'name': fields.char(string='Sub Task', readonly=True),
'user_id': fields.many2one('res.users', string='Assigned To', readonly=True),
'date_start': fields.datetime(string='Assignation Date', readonly=True),
'no_of_days': fields.integer(string='# of Days', size=128, readonly=True),
'date_deadline': fields.date(string='Deadline', readonly=True),
'date_last_stage_update': fields.datetime(string='Last Stage Update', readonly=True),
'task_id': fields.many2one('project.task', string='Task', readonly=True),
'closing_days': fields.float(string='Days to Close', digits=(16, 2), readonly=True, group_operator="avg",
help="Number of Days to close the task"),
'opening_days': fields.float(string='Days to Assign', digits=(16, 2), readonly=True, group_operator="avg",
help="Number of Days to Open the task"),
'delay_endings_days': fields.float(string='Over passed Deadline', digits=(16, 2), readonly=True),
'nbr': fields.integer(string='# of Tasks', readonly=True), # TDE FIXME master: rename into nbr_tasks
'priority': fields.selection([('0', 'Low'), ('1', 'Normal'), ('2', 'High')],
string='Priority', size=1, readonly=True),
'company_id': fields.many2one('res.company', string='Company', readonly=True),
'stage_id': fields.many2one('project.sub_task.type', string='Stage'),
}
_order = 'name desc'
def _select(self):
select_str = """
SELECT
(select 1 ) AS nbr,
t.id as id,
t.date_start as date_start,
t.date_deadline as date_deadline,
abs((extract('epoch' from (t.write_date-t.date_start)))/(3600*24)) as no_of_days,
t.task_ref as task_id,
t.assigned_user as user_id,
t.date_last_stage_update as date_last_stage_update,
t.priority,
t.name as name,
t.company_id,
t.stage_id as stage_id,
(extract('epoch' from (t.write_date-t.create_date)))/(3600*24) as closing_days,
(extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
(extract('epoch' from (t.date_deadline-(now() at time zone 'UTC'))))/(3600*24) as delay_endings_days
"""
return select_str
def _group_by(self):
group_by_str = """
GROUP BY
t.id,
create_date,
write_date,
date_start,
date_deadline,
date_last_stage_update,
t.assigned_user,
t.priority,
name,
t.company_id,
stage_id
"""
return group_by_str
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_project_subtask_user')
cr.execute("""
CREATE view report_project_subtask_user as
%s
FROM project_sub_task t
WHERE t.active = 'true'
%s
"""% (self._select(), self._group_by()))

BIN
project_subtask/static/description/11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
project_subtask/static/description/Icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
project_subtask/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
project_subtask/static/description/count.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

164
project_subtask/static/description/index.html

@ -0,0 +1,164 @@
<section class="oe_container">
<div class="oe_spaced">
<h2 class="oe_slogan">Sub Tasks in Project</h2>
<h3 class="oe_slogan">This Module Enables Sub-task feature in Project Module.</h3>
<h4 class="oe_slogan" style="font-size: 23px;">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
</div>
<div class="oe_spaced" style="padding-left:65px;">
<h4>Features:</h4>
<div>
<span style="color:green;"> &#9745; </span> Sub-task Feature for Project.<br/>
<span style="color:green;"> &#9745; </span> Sub-Task Lists Under Task.<br/>
<span style="color:green;"> &#9745; </span> Sub-Task Count in Task Kanban View.<br/>
<span style="color:green;"> &#9745; </span> Sub-Task Stages in Configuration.<br/>
<span style="color:green;"> &#9745; </span> Sub-Task Analysis Under Report.<br/>
<span style="color:green;"> &#9745; </span> Deadline Validation for Sub-Task.<br/>
<span style="color:green;"> &#9745; </span> Stage Validation for Sub-Task.<br/>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">
Currently Odoo has no sub-task feature in project. This module brings "SUB-TASK" forms and its configuration for projects with configured stages.
User can also analyse the sub tasks under the project reporting menu dynamically.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Sub Task Configuration</h3>
<div class="" style="text-align: center">
<p>
<h4>Project -> Configuration -> Sub Task Stages</h4>
<p>
</div>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" style="border:10px solid white;" src="task2.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; Please tick marked fields to identify your final stage and cancel stage.</span>
</div>
<br>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="task3.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; If you want to create sub tasks for your project please select the option Sub Tasks.</span>
</div>
<br>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Sub Task Creation</h3>
<div class="" style="text-align: center">
<p>
<h4>You can create sub tasks via 2 ways.</h4>
<p>
</div>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="sub_task.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; Create sub tasks directly from Menu 'Sub Task'.</span>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="task.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; Create sub tasks from task itself</span>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Sub-Task Count in Task Kanban View</h3>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="count.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; You can see the count of sub task on each task's kanaban view</span>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_spaced">
<h3 class="oe_slogan"> Sub-Task Analysis</h3>
<div class="oe_span12" align="center">
<img style="border:10px solid white;width: 47%; height: 450px;" class="oe_picture oe_screenshot" src="task4.png">
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Stage Validation for Sub-Task</h3>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="task5.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; You cant move your task into final stage until all sub tasks are reach in final stage</span>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Automatically Cancel/kill the sub-task by moving parent task to 'cancel'</h3>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="task6.png">
</div>
<span class="center-block" style="text-align: center;">&#9755; When you move your task into cancel stage then all sub tasks also will go to cancel stage</span>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Deadline Validation for Sub-Task</h3>
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white; height: 450px;" src="11.png">
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
project_subtask/static/description/sub_task.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
project_subtask/static/description/task.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
project_subtask/static/description/task2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
project_subtask/static/description/task3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
project_subtask/static/description/task4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
project_subtask/static/description/task5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
project_subtask/static/description/task6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

20
project_subtask/views/project_view.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="sub_task_project_form">
<field name="name">Project Form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='options_active']" position="inside">
<div class="o_row">
<field name="use_sub_task" class="oe_inline" string="Sub Tasks" attrs="{'invisible':[('use_tasks', '=', False)]}"/>
<label for="use_sub_task" class="oe_inline" attrs="{'invisible':[('use_tasks', '=', False) ]}"/>
<span attrs="{'invisible':['|', ('use_sub_task', '=', False), ('use_tasks', '=', False) ]}">as </span>
<field name="label_sub_tasks" class="oe_inline oe_input_align" attrs="{'invisible':['|', ('use_sub_task', '=', False), ('use_tasks', '=', False) ]}"/>
</div>
</xpath>
</field>
</record>
</data>
</openerp>

131
project_subtask/views/sub_task.xml

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="project_sub_task_form">
<field name="name">Sub Task form</field>
<field name="model">project.sub_task</field>
<field name="arch" type="xml">
<form string="Project">
<header>
<field name="stage_id" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}"/>
</header>
<sheet string="Sub Task">
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" groups="base.group_user"
class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
</button>
</div>
<div class="oe_title">
<h1 class="o_row">
<field name="priority" widget="priority"/>
<field name="name" placeholder="Sub Task Title..."/>
</h1>
</div>
<group>
<group>
<field name="task_ref"/>
<field name="assigned_user"/>
</group>
<group>
<field name="date_deadline"/>
</group>
</group>
<notebook>
<page name="sub_task_description_page" string="Sub Task Description">
<field name="description" type="html"/>
<div class="oe_clear"/>
</page>
<page name="sub_task_extra_info_page" string="Extra Info">
<group col="4">
<group col="2">
<field name="sequence" groups="base.group_no_one"/>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="displayed_image_id" groups="base.group_no_one"/>
</group>
<group col="2">
<field name="date_start" groups="base.group_no_one"/>
<field name="date_assign" groups="base.group_no_one"/>
<field name="project_id" readonly="1"/>
<field name="date_last_stage_update" groups="base.group_no_one"/>
</group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="project_sub_task_tree">
<field name="name">project.sub_task.tree</field>
<field name="model">project.sub_task</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="assigned_user"/>
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="project_sub_task_kanban">
<field name="name">project.sub_task.kanban</field>
<field name="model">project.sub_task</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id" >
<field name="color"/>
<field name="priority"/>
<field name="stage_id"/>
<field name="assigned_user"/>
<field name="description"/>
<field name="sequence"/>
<field name="date_deadline"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
<div class="oe_kanban_content">
<div><b><field name="name"/></b></div>
<div>
<field name="project_id"/><br/>
<t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
<span t-attf-class="#{red || ''}"><i><field name="date_deadline"/></i></span>
</div>
<div class="oe_kanban_footer_left">
<span groups="project.group_time_work_estimation_tasks" title="Remaining hours">
<span class="oe_e">N</span>
<t t-esc="Math.round(record.remaining_hours.raw_value)"/>
</span>
</div>
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.assigned_user.raw_value)" t-att-title="record.assigned_user.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
<div class="pull-left" groups="base.group_user">
<field name="priority" widget="priority"/>
</div>
</div>
</div>
<div class="oe_clear"/>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="project_sub_task_action_n" model="ir.actions.act_window">
<field name="name">Sub Task Details</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">project.sub_task</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add new Sub Task.
</p>
</field>
</record>
<menuitem id="sub_task_main_menu" name="Sub Tasks" parent="project.menu_project_management" sequence="5" action="project_sub_task_action_n"/>
</data>
</openerp>

26
project_subtask/views/sub_task_report.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_sub_task_project_user_pivot1" model="ir.ui.view">
<field name="name">report.project.task.user.pivot1</field>
<field name="model">report.project.subtask.user</field>
<field name="arch" type="xml">
<pivot string="Tasks Analysis" display_quantity="true" disable_linking="True">
<field name="task_id" type="row"/>
</pivot>
</field>
</record>
<record id="action_project_subtask_user_tree" model="ir.actions.act_window">
<field name="name">Sub Tasks Analysis</field>
<field name="res_model">report.project.subtask.user</field>
<field name="view_type">form</field>
<field name="view_mode">pivot</field>
<field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
<field name="help">This report allows you to analyse the performance of your projects and users. You can analyse the quantities of tasks, the hours spent compared to the planned hours, the average number of days to open or close a task, etc.</field>
</record>
<menuitem name="Sub Tasks" action="action_project_subtask_user_tree" id="menu_project_subtask_user_tree" parent="base.menu_project_report" sequence="2"/>
</data>
</openerp>

84
project_subtask/views/sub_task_type_view.xml

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="sub_task_type_edit" model="ir.ui.view">
<field name="name">project.sub_task.type.form</field>
<field name="model">project.sub_task.type</field>
<field name="arch" type="xml">
<form string="Sub Task Stage">
<group>
<group>
<field name="name"/>
<field name="sequence" groups="base.group_no_one"/>
</group>
<group>
<field name="fold"/>
<field name="done_state"/>
<field name="cancel_state"/>
</group>
</group>
<group string="Projects &amp;Tasks using this stage">
<field name="task_ids" widget="many2many_tags"/>
</group>
<group string="Stage Description and Tooltips">
<p class="text-muted" colspan="2">
At each stage employees can block or make task/issue ready for next stage.
You can define here labels that will be displayed for the state instead
of the default labels.
</p>
<label for="legend_normal" string=" " class="oe_kanban_status oe_project_kanban_legend"/>
<field name="legend_normal" nolabel="1"/>
<label for="legend_blocked" string=" " class="oe_kanban_status oe_kanban_status_red oe_project_kanban_legend"/>
<field name="legend_blocked" nolabel="1"/>
<label for="legend_done" string=" " class="oe_kanban_status oe_kanban_status_green oe_project_kanban_legend"/>
<field name="legend_done" nolabel="1"/>
<p class="text-muted" colspan="2">
You can also give a tooltip about the use of the stars available in the kanban and form views.
</p>
<label for="legend_priority" string=" " class="fa fa-star fa-lg o_star_on oe_project_kanban_legend"/>
<field name="legend_priority" nolabel="1"/>
<p class="text-muted" colspan="2">
You can also add a description to help your coworkers understand the meaning and purpose of the stage.
</p>
<field name="description" placeholder="Add a description..." nolabel="1" colspan="2"/>
</group>
</form>
</field>
</record>
<record id="sub_task_type_tree" model="ir.ui.view">
<field name="name">project.sub_task.type.tree</field>
<field name="model">project.sub_task.type</field>
<field name="arch" type="xml">
<tree string="Task Stage">
<field name="sequence" widget="handle" groups="base.group_no_one"/>
<field name="name"/>
<field name="fold"/>
<field name="description"/>
</tree>
</field>
</record>
<record id="open_sub_task_type_form" model="ir.actions.act_window">
<field name="name">Stages</field>
<field name="res_model">project.sub_task.type</field>
<field name="view_type">form</field>
<field name="view_id" ref="sub_task_type_tree"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a stage in the task pipeline.
</p><p>
Define the steps that will be used in the project from the
creation of the task, up to the closing of the task or issue.
You will use these stages in order to track the progress in
solving a task or an issue.
</p>
</field>
</record>
<menuitem action="project.open_task_type_form" id="base.menu_project_config_project" name="Task Stages" parent="project.menu_project_config" sequence="3" groups="project.group_project_manager"/>
<menuitem action="open_sub_task_type_form" id="menu_project_config_project_sub_task_stage" name="Sub Task Stages" parent="project.menu_project_config" sequence="4" groups="project.group_project_manager"/>
</data>
</openerp>

61
project_subtask/views/task_view.xml

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="sub_task_task_form">
<field name="name">Task Form</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='description_page']" position="after">
<page name="project_sub_tasks" string="Sub Tasks"
attrs="{'invisible':[('use_sub_task','=',False)]}">
<field name="sub_task_lines">
<tree string="Sub Task Lines" editable="bottom" colors="red:current_date > date_deadline;">
<field name="name"/>
<field name="assigned_user"/>
<field name="date_deadline"/>
<field name="stage_id" readonly="1"/>
</tree>
</field>
</page>
</xpath>
<field name="kanban_state" position="after">
<field name="use_sub_task" invisible="1"/>
<field name="subtask_count" invisible="1"/>
</field>
<field name="stage_id" position="attributes">
<attribute name="attrs">{'invisible':[('active','=',False)]}</attribute>
</field>
</field>
</record>
<record model="ir.ui.view" id="subtask_partner_kanban_view">
<field name="name">project.task.kanban.inherit1</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_kanban"/>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<field name="legend_done" position="after">
<field name="subtask_count"/>
</field>
<xpath expr="//div[@class='oe_kanban_content']" position="inside">
<div>
<span class="badge" t-if="record.subtask_count.value>0"><i class="fa fa-tasks"/><t t-esc=" "/> <t t-esc="record.subtask_count.value"/></span>
</div>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sub_task_type_form">
<field name="name">Task Type Form</field>
<field name="model">project.task.type</field>
<field name="inherit_id" ref="project.task_type_edit"/>
<field name="arch" type="xml">
<field name="fold" position="after">
<field name="done_state"/>
<field name="cancel_state"/>
</field>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save