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

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


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

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 23
1627
0
thg 7 22
1867
1
thg 6 23
3361
1
thg 5 23
1954
0
thg 4 23
1743