跳至內容
選單
此問題已被標幟
1 回覆
3302 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
1月 23
1610
0
7月 22
1861
1
6月 23
3349
1
5月 23
1941
0
4月 23
1738