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.
此问题已终结
1
回复
12019
查看
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
|
3496 | ||
|
|
0
10月 20
|
5917 | ||
|
|
0
5月 15
|
5357 | ||
|
|
2
3月 25
|
4583 | ||
|
|
5
10月 19
|
11833 |