Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3318 มุมมอง

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'

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 23
1623
0
ก.ค. 22
1866
1
มิ.ย. 23
3355
1
พ.ค. 23
1949
0
เม.ย. 23
1739