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

I want to write a python code for automated action,

In my task, there are certain stages 

See the above image,

There is a radio field called Ready for Implementation? 

if the user clicks Yes, if should automatically change the stage to READY FOR IMPLEMENTATION, 

If they clicks No, I have remarks, It should automatically change the stage to Remarks before Implementation


For this purpose I have given an automated action

But I am not sure the python code is correct


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

Hi,


Try this:


def _onchange_ready_for_implementation(self):

        if self.ready_for_implementation == 'yes':

            self.stage = 'ready'

        elif self.ready_for_implementation == 'no':

            self.stage = 'remarks'


    @api.onchange('remarks')

    def _onchange_remarks(self):

        if self.remarks:

            self.stage = 'remarks'



Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يناير 23
1703
0
يوليو 22
1971
1
يونيو 23
3518
1
مايو 23
2074
0
أبريل 23
1842