Odoo 11 - Using custom settings (module defaults)
I managed to set up my custom module settings as described by the first answer here
_inherit = 'res.config.settings'
I read that in this model one are supposed to be able to use these custom settings as default values in other models, but how? I read all the source code on other models from the core, but cant seem to find the answer.
This article (old) states that this is possible
The value of a field named
default_foowill be set as a default value for a field named
fooon a model given as a
..but I can't make it work, so in the mean time I havea default method to set the value from the settings
res = self.env['res.config.settings'].get_values()
return res['foobar'] or 1
which works, but seems like the wrong solution.
Any ideas? Code example would be great.
default_foo = fields.Integer(default_model='some_model')
I try to set the default value in the model "some_model", but that model's property "foo" does not get the default value.