0

There are some situation where we just need to add a record once and then update only. Suppose we save some settings data for our application, then we only update that data only. No new record will be added. I think there is a nice approach to do this in odoo15. Any idea?

Abdus Sattar Bhuiyan
  • 3,016
  • 4
  • 38
  • 72

1 Answers1

0

There is model ir.config_parameter for example

web_base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', default='')

And second way is to sore your configs on the company model.

if you want to update your configs you just have to get your record(search, browse or get by external id) and then you can update it like usual.

Paxmees
  • 1,540
  • 1
  • 15
  • 28