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. 10
      base_user_role/data/ir_cron.xml
  3. 25
      base_user_role/migrations/8.0.1.1.0/post-migration.py
  4. 24
      base_user_role/views/role.xml
  5. 14
      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',

10
base_user_role/data/ir_cron.xml

@ -1,10 +1,9 @@
<?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">
<record model="ir.cron" id="cron_update_users">
<field name='name'>Update user roles</field>
<field name='interval_number'>3</field>
<field name='interval_type'>hours</field>
@ -14,7 +13,6 @@
<field name="model">res.users.role</field>
<field name="function">cron_update_users</field>
<field name="args">()</field>
</record>
</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)

24
base_user_role/views/role.xml

@ -1,10 +1,9 @@
<?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">
<record id="view_res_users_role_form" model="ir.ui.view">
<field name="name">res.users.role.form</field>
<field name="model">res.users.role</field>
<field name="arch" type="xml">
@ -32,9 +31,9 @@
</sheet>
</form>
</field>
</record>
</record>
<record id="view_res_users_role_tree" model="ir.ui.view">
<record id="view_res_users_role_tree" model="ir.ui.view">
<field name="name">res.users.role.tree</field>
<field name="model">res.users.role</field>
<field name="arch" type="xml">
@ -43,9 +42,9 @@
<field name="user_ids"/>
</tree>
</field>
</record>
</record>
<record id="view_res_users_role_search" model="ir.ui.view">
<record id="view_res_users_role_search" model="ir.ui.view">
<field name="name">res.users.role.search</field>
<field name="model">res.users.role</field>
<field name="arch" type="xml">
@ -55,19 +54,18 @@
<field name="implied_ids"/>
</search>
</field>
</record>
</record>
<record model="ir.actions.act_window" id="action_res_users_role_tree">
<record model="ir.actions.act_window" id="action_res_users_role_tree">
<field name="name">Roles</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users.role</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_res_users_role_tree"/>
</record>
</record>
<menuitem id="menu_action_res_users_role_tree"
<menuitem id="menu_action_res_users_role_tree"
parent="base.menu_users"
action="action_res_users_role_tree"/>
</data>
</openerp>
</odoo>

14
base_user_role/views/user.xml

@ -1,10 +1,9 @@
<?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">
<record id="view_res_users_form_inherit" model="ir.ui.view">
<field name="name">res.users.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
@ -22,9 +21,9 @@
</page>
</notebook>
</field>
</record>
</record>
<record id="view_res_users_search_inherit" model="ir.ui.view">
<record id="view_res_users_search_inherit" model="ir.ui.view">
<field name="name">res.users.search.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_search"/>
@ -33,7 +32,6 @@
<field name="role_ids"/>
</field>
</field>
</record>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save