تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4739 أدوات العرض

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.

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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?


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يونيو 23
3348
1
نوفمبر 22
3616
Cannot create task تم الحل
2
يونيو 20
3814
2
يوليو 18
7350
4
يوليو 18
8178