[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:
Mitesh Savani 2014-08-01 17:09:09 +05:30 committed by Thibault Delavallée
parent 1b9c404e49
commit 6021b0fe8f
4 changed files with 16 additions and 2 deletions

View File

@ -40,6 +40,7 @@ GENGO_DEFAULT_LIMIT = 20
class base_gengo_translations(osv.osv_memory):
GENGO_KEY = "Gengo.UUID"
GROUPS = ['base.group_system']
_name = 'base.gengo.translations'
_columns = {
@ -57,7 +58,7 @@ class base_gengo_translations(osv.osv_memory):
def init(self, cr):
icp = self.pool['ir.config_parameter']
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):
icp = self.pool['ir.config_parameter']

View File

@ -19,4 +19,5 @@
#
##############################################################################
import controllers
import controllers
import models

View File

@ -0,0 +1 @@
import base_gengo_translations

View File

@ -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']