diff --git a/trytond/init.sql b/trytond/init.sql
index f77a91d8d8..d4ec9612e2 100644
--- a/trytond/init.sql
+++ b/trytond/init.sql
@@ -78,6 +78,16 @@ CREATE TABLE ir_translation (
primary key(id)
);
+CREATE TABLE ir_lang (
+ id serial NOT NULL,
+ name varchar(64) NOT NULL,
+ code varchar(5) NOT NULL,
+ translatable boolean default False,
+ active boolean default True,
+ direction varchar(3) NOT NULL,
+ primary key(id)
+);
+
---------------------------------
-- Res user
---------------------------------
@@ -107,18 +117,6 @@ CREATE TABLE res_group (
primary key(id)
);
-create table res_role (
- id serial NOT NULL,
- parent_id int references res_role on delete set null,
- name varchar(32) NOT NULL,
- primary key(id)
-);
-
-CREATE TABLE res_role_user_rel (
- uid integer NOT NULL references res_user on delete cascade,
- rid integer NOT NULL references res_role on delete cascade
-);
-
CREATE TABLE res_group_user_rel (
uid integer NOT NULL references res_user on delete cascade,
gid integer NOT NULL references res_group on delete cascade
@@ -164,7 +162,7 @@ create table wkf_transition
trigger_expr_id varchar(128) default NULL,
signal varchar(64) default null,
- role_id int references res_role on delete set null,
+ "group" int references res_group on delete set null,
primary key(id)
);
diff --git a/trytond/ir/lang.py b/trytond/ir/lang.py
index 66467db514..4d56a88764 100644
--- a/trytond/ir/lang.py
+++ b/trytond/ir/lang.py
@@ -5,6 +5,7 @@ from trytond.osv import fields, OSV
class Lang(OSV):
"Language"
_name = "ir.lang"
+ _log_access = False
_description = __doc__
_columns = {
'name': fields.Char('Name', size=64, required=True),
diff --git a/trytond/res/user.py b/trytond/res/user.py
index 6b65bd7ca6..ea4524e63e 100644
--- a/trytond/res/user.py
+++ b/trytond/res/user.py
@@ -34,29 +34,6 @@ class Group(OSV):
Group()
-class Role(OSV):
- "Role"
- _name = "res.role"
- _description = __doc__
- _columns = {
- 'name': fields.Char('Role Name', size=64, required=True),
- 'parent_id': fields.Many2One('res.role', 'Parent', select=1),
- 'child_id': fields.One2Many('res.role', 'parent_id', 'Childs')
- }
-
- def check_recursion(self, cursor, user, ids, parent=None):
- "Check for recursion"
- return super(Role, self).check_recursion(cursor, user, ids,
- parent=parent)
-
- _constraints = [
- (check_recursion, 'Error! You can not create recursive roles.',
- ['parent_id'])
- ]
-
-Role()
-
-
class User(OSV):
"User"
_name = "res.user"
@@ -73,8 +50,6 @@ class User(OSV):
'menu_id': fields.Many2One('ir.action', 'Menu Action'),
'groups_id': fields.Many2Many('res.group', 'res_group_user_rel',
'uid', 'gid', 'Groups'),
- 'roles_id': fields.Many2Many('res.role', 'res_role_user_rel',
- 'uid', 'rid', 'Roles'),
#'company_id': fields.Many2One('res.company', 'Company'),
'rule_groups': fields.Many2Many('ir.rule.group', 'user_rule_group_rel',
'user_id', 'rule_group_id', 'Rules',
diff --git a/trytond/res/user.xml b/trytond/res/user.xml
index 79f7e7665b..466b5ee09f 100644
--- a/trytond/res/user.xml
+++ b/trytond/res/user.xml
@@ -149,65 +149,5 @@
-
- res.role
- form
-
-
-
-
-
-
-
- ]]>
-
-
-
- res.role
- tree
- parent_id
-
-
-
-
- ]]>
-
-
-
- Roles
- ir.action.act_window
- res.role
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Roles
- ir.action.act_window
- res.role
- tree
-
-
-
-
-
-
-
-
diff --git a/trytond/trytond.py b/trytond/trytond.py
index 742b8eb68a..ba35338740 100644
--- a/trytond/trytond.py
+++ b/trytond/trytond.py
@@ -92,8 +92,6 @@ class TrytonServer(object):
"'ir_ui_menu', "
"'res_user', "
"'res_group', "
- "'res_role', "
- "'res_role_user_rel', "
"'res_group_user_rel', "
"'wkf', "
"'wkf_activity', "
@@ -104,8 +102,9 @@ class TrytonServer(object):
"'wkf_logs', "
"'ir_module_category', "
"'ir_module_module', "
- "'ir_module_module_dependency'"
- "'ir_translation'"
+ "'ir_module_module_dependency, '"
+ "'ir_translation, '"
+ "'ir_lang'"
")")
if len(cursor.fetchall()) == 0:
self.logger.notify_channel("init", netsvc.LOG_INFO, "init db")
diff --git a/trytond/wkf_service/wkf_expr.py b/trytond/wkf_service/wkf_expr.py
index 4fa35c0c6c..8a8b4babc5 100644
--- a/trytond/wkf_service/wkf_expr.py
+++ b/trytond/wkf_service/wkf_expr.py
@@ -62,12 +62,11 @@ def check(cursor, ident, transition, signal):
if transition['signal']:
res = (signal == transition['signal'])
- if transition['role_id']:
+ if transition['group']:
user = ident[0]
serv = netsvc.LocalService('object_proxy')
- user_roles = serv.execute_cr(cursor, user, 'res.user', 'read', [user],
- ['roles_id'])[0]['roles_id']
- res = res and serv.execute_cr(cursor, user, 'res.role', 'check',
- user_roles, transition['role_id'])
+ user_groups = serv.execute_cr(cursor, user, 'res.user', 'read', user,
+ ['groups_id'])['groups_id']
+ res = transition['group'] in user_groups
res = res and eval_expr(cursor, ident, transition['condition'])
return res
diff --git a/trytond/workflow/workflow.py b/trytond/workflow/workflow.py
index bd9b418d4c..f545be7022 100644
--- a/trytond/workflow/workflow.py
+++ b/trytond/workflow/workflow.py
@@ -93,7 +93,7 @@ class WorkflowTransition(OSV):
'trigger_model': fields.char('Trigger Type', size=128),
'trigger_expr_id': fields.char('Trigger Expr ID', size=128),
'signal': fields.char('Signal (button Name)', size=64),
- 'role_id': fields.many2one('res.role', 'Role Required'),
+ 'group': fields.many2one('res.group', 'Group Required'),
'condition': fields.char('Condition', required=True, size=128),
'act_from': fields.many2one('workflow.activity', 'Source Activity',
required=True, select=1, ondelete='cascade'),
diff --git a/trytond/workflow/workflow.xml b/trytond/workflow/workflow.xml
index fa78d765e7..0bb2f3f591 100644
--- a/trytond/workflow/workflow.xml
+++ b/trytond/workflow/workflow.xml
@@ -83,7 +83,7 @@
-
+
@@ -96,8 +96,8 @@
-
-
+
+
@@ -109,7 +109,7 @@
-
+
@@ -122,8 +122,8 @@
-
-
+
+
@@ -183,8 +183,8 @@
-
-
+
+
@@ -202,7 +202,7 @@
-
+