[FIX] base_gengo, website_gengo: groups on the gengo key.
Basically the admin group can read the gengo key. When adding website_gengo that adds the website groups, the groups allowed to access the key are updated. This is done because in base_gengo the website groups are not necesssarily defined. Website is not a dependency of base_gengo.
This commit is contained in:
parent
1b9c404e49
commit
6021b0fe8f
|
@ -40,6 +40,7 @@ GENGO_DEFAULT_LIMIT = 20
|
||||||
|
|
||||||
class base_gengo_translations(osv.osv_memory):
|
class base_gengo_translations(osv.osv_memory):
|
||||||
GENGO_KEY = "Gengo.UUID"
|
GENGO_KEY = "Gengo.UUID"
|
||||||
|
GROUPS = ['base.group_system']
|
||||||
|
|
||||||
_name = 'base.gengo.translations'
|
_name = 'base.gengo.translations'
|
||||||
_columns = {
|
_columns = {
|
||||||
|
@ -57,7 +58,7 @@ class base_gengo_translations(osv.osv_memory):
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
icp = self.pool['ir.config_parameter']
|
icp = self.pool['ir.config_parameter']
|
||||||
if not icp.get_param(cr, SUPERUSER_ID, self.GENGO_KEY, default=None):
|
if not icp.get_param(cr, SUPERUSER_ID, self.GENGO_KEY, default=None):
|
||||||
icp.set_param(cr, SUPERUSER_ID, self.GENGO_KEY, str(uuid.uuid4()), groups=['base.group_website_designer', 'base.group_website_publisher'])
|
icp.set_param(cr, SUPERUSER_ID, self.GENGO_KEY, str(uuid.uuid4()), groups=self.GROUPS)
|
||||||
|
|
||||||
def get_gengo_key(self, cr):
|
def get_gengo_key(self, cr):
|
||||||
icp = self.pool['ir.config_parameter']
|
icp = self.pool['ir.config_parameter']
|
||||||
|
|
|
@ -19,4 +19,5 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import controllers
|
import controllers
|
||||||
|
import models
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
import base_gengo_translations
|
|
@ -0,0 +1,11 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from openerp.osv import osv
|
||||||
|
|
||||||
|
|
||||||
|
class base_gengo_translations(osv.TransientModel):
|
||||||
|
_inherit = 'base.gengo.translations'
|
||||||
|
# update GROUPS, that are the groups allowing to access the gengo key.
|
||||||
|
# this is done here because in the base_gengo module, the various website
|
||||||
|
# groups do not exist, limiting the access to the admin group.
|
||||||
|
GROUPS = ['base.group_website_designer', 'base.group_website_publisher']
|
Loading…
Reference in New Issue