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

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.

頭像
捨棄
最佳答案

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
2468
0
10月 20
4227
0
5月 15
3988
2
3月 25
2036
5
10月 19
9992