add close stage in task list

This commit is contained in:
Pawan Kumar 2021-02-16 23:00:27 +05:30
parent a327a354f5
commit 2654c2b90a
3 changed files with 13 additions and 11 deletions

View File

@ -330,6 +330,8 @@ class InheritProjectTask(models.Model):
start_date = fields.Date(string='Start Date')
# def action_done_task(self):
# print('88888888888888')
def action_done_task(self):
stage_id = self.env['project.task.type'].search([('is_closed', '=', True)], limit=1)
for stage in self:
stage.write({'stage_id' : stage_id.id})

View File

@ -57,7 +57,7 @@
</record>
<!-- Overide all timesheet action -->
<!--<record id="hr_timesheet.timesheet_action_all" model="ir.actions.act_window">
<record id="hr_timesheet.timesheet_action_all" model="ir.actions.act_window">
<field name="name">All Timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">tree,form,pivot,kanban,calendar</field>
@ -93,11 +93,11 @@
<field name="view_mode">calendar</field>
<field name="view_id" ref="view_hr_timesheet_line_calendar"/>
<field name="act_window_id" ref="hr_timesheet.timesheet_action_all"/>
</record>-->
</record>
<!-- Overide my timesheet action -->
<!--<record id="hr_timesheet.act_hr_timesheet_line" model="ir.actions.act_window">
<record id="hr_timesheet.act_hr_timesheet_line" model="ir.actions.act_window">
<field name="name">My Timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">tree,form,kanban,calendar</field>
@ -133,6 +133,6 @@
<field name="view_mode">calendar</field>
<field name="view_id" ref="view_hr_my_timesheet_line_calendar"/>
<field name="act_window_id" ref="hr_timesheet.act_hr_timesheet_line"/>
</record>-->
</record>
</odoo>

View File

@ -235,16 +235,16 @@
</record>
<!-- Done Task action -->
<!--<record id="project_task_server_action_batch_done" model="ir.actions.server">
<record id="project_task_server_action_batch_done" model="ir.actions.server">
<field name="name">Done</field>
<field name="model_id" ref="project.model_project_task"/>
<field name="binding_model_id" ref="project.model_project_task"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_done_task()
</field>
</record>-->
if records:
action = records.action_done_task()
</field>
</record>
<!-- Tags -->
<record model="ir.ui.view" id="custom_project_tags_search_view">