Files
odoo_source/addons/website_slides/models/res_config.py
T
Denis Ledoux caf42af596 [FIX] website_slides: config default values method
By convention, configuration wizards inheriting
from `res.config.settings` must define
their default values methods by
`get_default_`
not simply by
`get_`.

If not, the default values will simply not be loaded.
Therefore, the default value for the `Google Doc Key` field
was not loaded in the Website settings
(Settings > Configuration > Website Settings).

opw-646659
2015-08-04 17:56:02 +02:00

25 lines
862 B
Python

# -*- coding: utf-8 -*-
from openerp import api, fields, models
class website_config_settings(models.TransientModel):
_inherit = "website.config.settings"
website_slide_google_app_key = fields.Char(string='Google Doc Key')
@api.model
def get_default_website_slide_google_app_key(self, fields):
website_slide_google_app_key = False
if 'website_slide_google_app_key' in fields:
website_slide_google_app_key = self.env['ir.config_parameter'].sudo().get_param('website_slides.google_app_key')
return {
'website_slide_google_app_key': website_slide_google_app_key
}
@api.multi
def set_website_slide_google_app_key(self):
for wizard in self:
self.env['ir.config_parameter'].sudo().set_param('website_slides.google_app_key', wizard.website_slide_google_app_key)