Browse Source

[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 script
pull/641/head
sebalix 8 years ago
parent
commit
47bd8d45d1
  1. 2
      base_user_role/__openerp__.py
  2. 6
      base_user_role/data/ir_cron.xml
  3. 25
      base_user_role/migrations/8.0.1.1.0/post-migration.py
  4. 6
      base_user_role/views/role.xml
  5. 6
      base_user_role/views/user.xml

2
base_user_role/__openerp__.py

@ -4,7 +4,7 @@
{
'name': 'User roles',
'version': '8.0.1.1.0',
'version': '9.0.1.0.0',
'category': 'Tools',
'author': 'ABF OSIELL, Odoo Community Association (OCA)',
'license': 'AGPL-3',

6
base_user_role/data/ir_cron.xml

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 ABF OSIELL <http://osiell.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<record model="ir.cron" id="cron_update_users">
<field name='name'>Update user roles</field>
@ -16,5 +15,4 @@
<field name="args">()</field>
</record>
</data>
</openerp>
</odoo>

25
base_user_role/migrations/8.0.1.1.0/post-migration.py

@ -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)

6
base_user_role/views/role.xml

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2014 ABF OSIELL <http://osiell.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<odoo>
<record id="view_res_users_role_form" model="ir.ui.view">
<field name="name">res.users.role.form</field>
@ -69,5 +68,4 @@
parent="base.menu_users"
action="action_res_users_role_tree"/>
</data>
</openerp>
</odoo>

6
base_user_role/views/user.xml

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2014 ABF OSIELL <http://osiell.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<odoo>
<record id="view_res_users_form_inherit" model="ir.ui.view">
<field name="name">res.users.form.inherit</field>
@ -35,5 +34,4 @@
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save