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

Odoo 14.  I have a widget many2many checkboxes, related model crm_tag. The list includes 6 boxes. I also have a toggle button on the same form. 

When this button is set to 1(true) i need an automation to check one of checkboxes. What Python expression could be used to achieve this?


Thanks!

頭像
捨棄
最佳答案

Hello Peter,

Please find the below Python code done in Automated Action. 
And add these fields :
- Trigger : On update
- Trigger Fields : select the toggle button field
- Action To do : Execute Python Code
Where ‘x_selection_field’ is the field you want to update based on toggle button field.

Find Example in comment.

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

頭像
捨棄

sale_order = env['sale.order'].search([('id','=',record['id'])])
if sale_order['x_toggle_boolean']:
sale_order['x_selection_field'] = 'ans1'

相關帖文 回覆 瀏覽次數 活動
2
2月 23
2540
1
5月 22
4370
0
11月 21
21
0
11月 21
3514
0
11月 23
1147