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

Hello,

I created a button in a new model and trying to change the status bar from status1 to status2 using this button, so I went to server actions and created an action for that by executing a python code. but keeps getting all types of errors.

My question is: what code I should put into this Server Action in order to get executed and the button does its transition

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

Hi,
To change state you don't need to create a server action. you can do it in following way in your python file.
def button_name(self):
      self.write({'state': 'status2'})

Regards

الصورة الرمزية
إهمال
الكاتب

Thank you for the answer it worked!

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يونيو 23
3864
4
يناير 22
7286
1
مارس 15
5250
0
مارس 23
1835
1
أبريل 22
6445