Browse Source
[IMP] base_user_role - Bump module version to '9.0.1.0.0'
[IMP] base_user_role - Bump module version to '9.0.1.0.0'
[IMP] base_user_role - Replace '<openerp>' tags by '<odoo>' + Remove useless '<data>' tags + Reindent XML content [FIX] base_user_role - Fix noupdate declaration [REM] base_user_role - Remove old migration scriptpull/641/head
sebalix
8 years ago
5 changed files with 107 additions and 138 deletions
-
2base_user_role/__openerp__.py
-
10base_user_role/data/ir_cron.xml
-
25base_user_role/migrations/8.0.1.1.0/post-migration.py
-
24base_user_role/views/role.xml
-
14base_user_role/views/user.xml
@ -1,25 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2016 ABF OSIELL <http://osiell.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
from openerp import api, SUPERUSER_ID |
|||
|
|||
|
|||
def migrate_res_users_role(env): |
|||
"""Migrate user roles database schema. |
|||
('res_users_role_user_rel' many2many table to 'res.users.role.line' model. |
|||
""" |
|||
role_line_model = env['res.users.role.line'] |
|||
query = "SELECT role_id, user_id FROM res_users_role_user_rel;" |
|||
env.cr.execute(query) |
|||
rows = env.cr.fetchall() |
|||
for row in rows: |
|||
vals = { |
|||
'role_id': row[0], |
|||
'user_id': row[1], |
|||
} |
|||
role_line_model.create(vals) |
|||
|
|||
|
|||
def migrate(cr, version): |
|||
env = api.Environment(cr, SUPERUSER_ID, {}) |
|||
migrate_res_users_role(env) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue