From 2654c2b90acf7cf10e71e9b4d0a3e0ce78b3d97f Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Tue, 16 Feb 2021 23:00:27 +0530 Subject: [PATCH] add close stage in task list --- cor_custom/models/project.py | 6 ++++-- cor_custom/views/analytic_view.xml | 8 ++++---- cor_custom/views/project_view.xml | 10 +++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cor_custom/models/project.py b/cor_custom/models/project.py index d28cbc1..dff23db 100755 --- a/cor_custom/models/project.py +++ b/cor_custom/models/project.py @@ -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}) diff --git a/cor_custom/views/analytic_view.xml b/cor_custom/views/analytic_view.xml index f593883..8160eb9 100755 --- a/cor_custom/views/analytic_view.xml +++ b/cor_custom/views/analytic_view.xml @@ -57,7 +57,7 @@ - + - + diff --git a/cor_custom/views/project_view.xml b/cor_custom/views/project_view.xml index dbd0721..e016fd7 100755 --- a/cor_custom/views/project_view.xml +++ b/cor_custom/views/project_view.xml @@ -235,16 +235,16 @@ - + if records: + action = records.action_done_task() + +