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

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
8月 25
481
2
8月 25
1493
0
2月 25
1607
1
8月 25
2216
2
12月 24
1867