Based on

res.config.settings is a base configuration wizard for application settings. It provides support for setting default values, assigning groups to employee users, and installing modules. To make such a ‘settings’ wizard, define a model like:

class MyConfigWizard(models.TransientModel):
    _name = 'my.settings'
    _inherit = 'res.config.settings'
    default_foo = fields.type(..., default_model='my.model')
    group_bar = fields.Boolean(..., group='base.group_user', implied_group='')
    module_baz = fields.Boolean(...)
    other_field = fields.type(...)

The method execute (Apply button) provides some support based on a naming convention:

  • For a field like default_XXX, execute sets the (global) default value of the field XXX in the model named by default_model to the field’s value.
  • For a boolean field like group_XXX, execute adds/removes ‘implied_group’ to/from the implied groups of ‘group’, depending on the field’s value. By default ‘group’ is the group Employee. Groups are given by their xml id. The attribute ‘group’ may contain several xml ids, separated by commas.
  • For a boolean field like module_XXX, execute triggers the immediate installation of the module named XXX if the field has value True.
  • For the other fields, the method execute invokes all methods with a name that starts with set_; such methods can be defined to implement the effect of those fields.

The method default_get retrieves values that reflect the current status of the fields like default_XXX, group_XXX and module_XXX. It also invokes all methods with a name that starts with get_default_; such methods can be defined to provide current values for other fields.


from openerp import models, fields, api

    ("login", "apps_odoo_com.login"),
    ("password", "apps_odoo_com.password"),

class Settings(models.TransientModel):

    _name = 'apps_odoo_com.settings'
    _inherit = 'res.config.settings'

    login = fields.Char("Login")
    password = fields.Char("Password")

    def set_params(self):

        for field_name, key_name in PARAMS:
            value = getattr(self, field_name, '').strip()
            self.env['ir.config_parameter'].set_param(key_name, value)

    def get_default_params(self, cr, uid, fields, context=None):
        res = {}
        for field_name, key_name in PARAMS:
            res[field_name] = self.env['ir.config_parameter'].get_param(key_name, '').strip()
        return res

Update settings on module install

To update settings from any res.config.settings do as follows:




Add implied group(s) to a group via implied_ids field:

<record model="res.groups" id="base.group_user">
    <field name="implied_ids" eval="[
        (4, ref(''))


Add XXX to the “depends” parameter in the file.

Other fields

Usually, other fields are saved to ir.config_parameter, so just update ir.config_parameter, for example:

<function model="ir.config_parameter" name="set_param" eval="(
    'pos_debt_notebook.debt_type', 'credit'
)" />