[IMP] project_task_line: make inline tree editable and update kanban states

H4497
This commit is contained in:
Connor Christian
2020-11-17 13:06:02 -05:00
committed by Mayank Patel
parent 32d79d96fc
commit 8245f25e93
2 changed files with 8 additions and 8 deletions

View File

@@ -27,14 +27,14 @@ class ProjectTaskLine(models.Model):
user_id = fields.Many2one('res.users', string='User') user_id = fields.Many2one('res.users', string='User')
sequence = fields.Integer(string='Sequence') sequence = fields.Integer(string='Sequence')
kanban_state = fields.Selection([ kanban_state = fields.Selection([
('normal', 'Grey'), ('normal', ''),
('done', 'Green'), ('done', 'Done'),
('blocked', 'Red')], string='Kanban State', ('blocked', 'Blocked')], string='State',
copy=False, default='normal', required=True, copy=False, default='normal', required=True,
help="A task's kanban state indicates special situations affecting it:\n" help="A task's kanban state indicates special situations affecting it:\n"
" * Grey is the default situation\n" " * Blank is the default situation\n"
" * Red indicates something is preventing the progress of this task\n" " * Blocked indicates something is preventing the progress of this task\n"
" * Green indicates the task is complete") " * Doen indicates the task is complete")
@api.onchange('kanban_state') @api.onchange('kanban_state')
def _onchange_kanban_state(self): def _onchange_kanban_state(self):

View File

@@ -14,10 +14,10 @@
<xpath expr="//page[@name='description_page']" position="after"> <xpath expr="//page[@name='description_page']" position="after">
<page name="task_lines" string="Todo List"> <page name="task_lines" string="Todo List">
<field name="line_ids" widget="one2many_list" context="{'default_task_id': id}"> <field name="line_ids" widget="one2many_list" context="{'default_task_id': id}">
<tree> <tree editable="bottom">
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="name"/> <field name="name"/>
<field name="kanban_state" widget="state_selection" string="Status"/> <field name="kanban_state" widget="selection" string="Status"/>
<field name="user_id" string="Completed by" options="{'no_create': True, 'no_create_edit': True, 'no_open': True}"/> <field name="user_id" string="Completed by" options="{'no_create': True, 'no_create_edit': True, 'no_open': True}"/>
</tree> </tree>
</field> </field>