I know It is possible to get a record using self.env['res.partner'].search([]) and creating one using self.env['res.partner'].create({}). But how can I update an existing record? for example update name field of res.partner record.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
10593
查看
Hi,
You can update an existing in the following ways:
partner = self.env['res.partner'].search([], limit=1)
partner.name = 'Odoo'
partner.write({'name': 'odoo'})
To know more about the odoo orm methods, see: Odoo ORM Methods
Thanks
Thanks a lot!
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
0
10月 21
|
2355 | ||
|
0
10月 20
|
3994 | ||
|
0
5月 15
|
3844 | ||
|
2
3月 25
|
1743 | ||
|
5
10月 19
|
9767 |