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

to start with I just want to be able to set a char field in a res.partner object given that the 'supplier' boolean is set to true. So far I know that I can use automated actions to call a server action when the supplier field is changed. I don't know how to write the python code for the server action. And I don't know how to only execute it if the boolean is true. Could I please get some pointers on this?

الصورة الرمزية
إهمال

please elaborate your query ," I just want to be able to set a char field in a res.partner object given that the 'supplier' boolean is set to true" and "And I don't know how to only execute it if the boolean is true"

الكاتب

@Prakash Sharma does my response below make more sense?

الكاتب أفضل إجابة

Let me be more clear. In the res.partner.form view the user can tick or untick the checkbox which says that the contact is a 'Vendor' (by default the model calls this field 'supplier' and it is a boolean). I want to be able to set the value of a custom char field to 'whatever' if the 'supplier' boolean is set to true, otherwise I want that char field empty. This is all just a stepping stone for me to eventually be able to do something more complex but I'll omit that as I don't want to add complexity here.

So far I know that I can use automated actions to call a server action when the 'supplier' field is changed. I don't know how to write the python code for the server action. Could I please get some pointers on this?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 25
479
2
أغسطس 25
1491
0
فبراير 25
1602
1
أغسطس 25
2213
2
ديسمبر 24
1865