Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4859 Lượt xem

Hi,

first thank you for your time and your help.

I created some Task Stages (stage1, stage2, stage3), created a project, associated stages to the project. Then created 2 tasks with default stage stage1.

When the user changes the task from stage1 to stage2 I need to check if all others tasks are in stage2 too and in case do something... how can I do it? It doesn't appear to me to be a workflow.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I resolved overriding the 'project.task' write method



class task(models.Model):

     _inherit = 'project.task'

    @api.multi

    def write(self, values, context=None):


        result = super(task, self).write(values)

        if 'stage_id' in values:

            #do checks here



Is this the best and most elegant solution?


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 23
3467
1
thg 11 22
3762
Cannot create task Đã xử lý
2
thg 6 20
3969
2
thg 7 18
7499
4
thg 7 18
8348