From 38b7c38e32575e736251e0a7c52a40dfee31ca9d Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 7 Feb 2014 18:21:57 +0100 Subject: [PATCH] [FIX] website: config settings does write the values on the website model This config contains only related fields of the website_id many2one. The problem is that applying the change CREATE a res config settings And the create orm method does not forward and write the values on the related fields. Write does. The best fix should be to change all these related fields to char fields, and to create the set_ method who will acutally set the value to the website_id. But, unfortunately, this is a stable branch And we cannot alter the database structure in stable branches. bzr revid: dle@openerp.com-20140207172157-6upyhuin93qlkrfa --- addons/website/models/res_config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/website/models/res_config.py b/addons/website/models/res_config.py index 9823d286f37..1ae491388a3 100644 --- a/addons/website/models/res_config.py +++ b/addons/website/models/res_config.py @@ -29,6 +29,14 @@ class website_config_settings(osv.osv_memory): values[fname] = v[0] if v and self._columns[fname]._type == 'many2one' else v return {'value' : values} + # FIXME in trunk for god sake. Change the fields above to fields.char instead of fields.related, + # and create the function set_website who will set the value on the website_id + # create does not forward the values to the related many2one. Write does. + def create(self, cr, uid, vals, context=None): + config_id = super(website_config_settings, self).create(cr, uid, vals, context=context) + self.write(cr, uid, config_id, vals, context=context) + return config_id + _defaults = { 'website_id': lambda self,cr,uid,c: self.pool.get('website').search(cr, uid, [], context=c)[0], }