Skip to Content
मेन्यू
This question has been flagged
1 Reply
10540 Views

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.

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

Thanks a lot!

Related Posts Replies Views Activity
0
अक्तू॰ 21
2314
0
अक्तू॰ 20
3866
0
मई 15
3797
2
मार्च 25
1575
5
अक्तू॰ 19
9682