Skip to content
Permalink
Browse files

⬆️1️⃣2️⃣

  • Loading branch information...
Ommo73 committed Jul 16, 2019
1 parent e8fc3fa commit d2871468c69735c2037b399ea41ba20f123ec9a7
Showing with 15 additions and 17 deletions.
  1. +9 −13 project_subtask/models/project.py
  2. +1 −1 project_subtask/views/project_view.xml
  3. +5 −3 project_subtask/views/task_view.xml
@@ -67,14 +67,10 @@ def date_deadline_validation(self):

active = fields.Boolean(default=True)
name = fields.Char(string="Name", requires=True)
priority = fields.Selection([('0', 'Normal'), ('1', 'High')], 'Priority', select=True, default='0')
priority = fields.Selection([('0', 'Normal'), ('1', 'High')], 'Priority', index=True, default='0')
assigned_user = fields.Many2one('res.users', string="Assigned Person", required=1)
task_ref = fields.Many2one('project.task', string='Name', required=1,
default=lambda self: self.env.context.get('default_task_ref'),
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,
task_ref = fields.Many2one('project.task', 'Task', ondelete='cascade', required=True, index="1")
stage_id = fields.Many2one('project.sub_task.type', string='Stage', index=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')
@@ -90,17 +86,17 @@ def date_deadline_validation(self):
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, default=fields.Datetime.now())
write_date = fields.Datetime(string='Last Modification Date', readonly=True, index=True)
date_start = fields.Datetime(string='Starting Date', readonly=True, index=True, default=fields.Datetime.now())
date_deadline = fields.Datetime(string='Deadline')
active = fields.Boolean(string='Active', default=True)
description = fields.Html(String='Description')
sequence = fields.Integer(string='Sequence', select=True, default=10,
sequence = fields.Integer(string='Sequence', index=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_last_stage_update = fields.Datetime(string='Last Stage Update', index=True, copy=False, readonly=True,
default=fields.Datetime.now())
date_assign = fields.Datetime(string='Assigning Date', select=True, copy=False, readonly=True)
date_assign = fields.Datetime(string='Assigning Date', index=True, copy=False, readonly=True)

@api.model
def create(self, vals):
@@ -125,7 +121,7 @@ class TaskMaster(models.Model):
_inherit = 'project.task'

sub_task_lines = fields.One2many('project.sub_task', 'task_ref', string='Sub Tasks')
date_deadline = fields.Datetime('Deadline', select=True, copy=False)
date_deadline = fields.Datetime('Deadline', index=True, copy=False)
use_sub_task = fields.Boolean(string="SubTasks", related='project_id.use_sub_task')
subtask_count = fields.Integer(string='Count', compute='sub_task_found')

@@ -7,7 +7,7 @@
<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">
<div>
<field name="use_tasks" invisible="1"/>
<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) ]}"/>
@@ -7,6 +7,8 @@
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[2]" position="after">
<field name="use_sub_task" invisible="1"/>
<field name="subtask_count" invisible="1"/>
<page name="project_sub_tasks" string="Sub Tasks" attrs="{'invisible':[('use_sub_task','=',False)]}">
<field name="sub_task_lines" attrs="{'invisible': [('sub_task_lines', '=', [(6, False, [])])]}">
<tree string="Sub Task Lines" editable="bottom" colors="red:current_date > date_deadline;">
@@ -22,9 +24,9 @@
<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 name="stage_id" position="attributes">
<attribute name="attrs">{'invisible':[('active','=',False)]}</attribute>
</field>
</field>
</record>

0 comments on commit d287146

Please sign in to comment.
You can’t perform that action at this time.