I'm using odoo 11, and I'm trying to create a module. I added web_google_maps
to the depends
tag in my __manifest__.py
, but I'm supposed to specify some parameters, such as: google_maps_view_api_key, google_maps_lang_localization, google_maps_region_localization, google_maps_theme.
Where can I specify them?
There is a special model in Odoo for specifying configuration/system parameters. The technical name is ir.config_parameter
. You can simply create one of these parameters in an xml file as a record.
Below is an example:
<record id="google_maps_view_api_key" model="ir.config_parameter">
<field name="key">google_maps_view_api_key</field>
<field name="value">my value here</field>
</record>
You can access the above parameter in code with the following:
self.env['ir.config_parameter'].get_param('google_maps_view_api_key')
It works on a key, value pair methodology. The key is the parameter, value is the value of that parameter.
Alternatively, if you'd like to create them manually through the Odoo front end, you can navigate to "Settings -> Technical -> System Parameters" and create the record there.