How to add the same job position in some contacts using server action.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- 專案管理
- MRP
此問題已被標幟
Hi Jordan,
Find the IDs of contacts for whom you need to change the job position and update the target_partner_ids list.
target_partner_ids = [1869,1870,1871]
partner_ids = env['res.partner'].search([('id', 'in', target_partner_ids)])
for partner in partner_ids :
partner.write({
'function':'Sales'
})
Or
Create a server action, select 'Contacts' as the model, update the Python code, and click on 'Create Contextual Action
Go to Contacts, select the contacts you want to change, click on 'Action,' and select the server action created.

Hope it helps,
Kiran K
Hi,
1. Create a new server action.

2. Select the contacts and click the 'Consultant job position' button

Please refer to this blog :https://www.cybrosys.com/blog/how-to-create-configure-server-actions-in-the-odoo-15
Hope it helps