Skip to content

Commit

Permalink
[FIX] base_user_role_history - pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
baimont committed Jun 4, 2020
1 parent 4bdacd3 commit d427cea
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 76 deletions.
17 changes: 7 additions & 10 deletions base_user_role_history/security/base_user_role_line_history.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

<record model="ir.model.access" id="base_user_role_line_history_access_name">
<field name="name">base.user.role.line.history access user</field>
<field name="model_id" ref="model_base_user_role_line_history"/>
<field name="group_id" ref="base.group_user"/>
<field name="perm_read" eval="1"/>
<field name="perm_create" eval="0"/>
<field name="perm_write" eval="0"/>
<field name="perm_unlink" eval="0"/>
<field name="model_id" ref="model_base_user_role_line_history" />
<field name="group_id" ref="base.group_user" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="0" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="0" />
</record>

</odoo>
111 changes: 57 additions & 54 deletions base_user_role_history/views/base_user_role_line_history.xml
Original file line number Diff line number Diff line change
@@ -1,89 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

<!--FORM view-->

<record model="ir.ui.view" id="base_user_role_line_history_form_view">
<field name="name">base.user.role.line.history.form (in base_user_role_history)</field>
<field
name="name"
>base.user.role.line.history.form (in base_user_role_history)</field>
<field name="model">base.user.role.line.history</field>
<field name="arch" type="xml">
<form create="0" edit="0" delete="0">
<header>
</header>
<sheet>
<group name="group_main" col="4">
<field name="create_uid"
string="Editor"/>
<field name="performed_action"/>
<field name="user_id"
string="Edited user"/>
<field name="create_date"
string="Date and time of edition"/>
<field name="old_role_id"/>
<field name="new_role_id"/>
<field name="old_date_from"/>
<field name="new_date_from"/>
<field name="old_date_to"/>
<field name="new_date_to"/>
<field name="old_is_enabled"/>
<field name="new_is_enabled"/>
<field name="create_uid" string="Editor" />
<field name="performed_action" />
<field name="user_id" string="Edited user" />
<field name="create_date" string="Date and time of edition" />
<field name="old_role_id" />
<field name="new_role_id" />
<field name="old_date_from" />
<field name="new_date_from" />
<field name="old_date_to" />
<field name="new_date_to" />
<field name="old_is_enabled" />
<field name="new_is_enabled" />
</group>
</sheet>
</form>
</field>
</record>

<!--TREE view-->

<record model="ir.ui.view" id="base_user_role_line_history_tree_view">
<field name="name">base.user.role.line.history.tree (in base_user_role_history)</field>
<field
name="name"
>base.user.role.line.history.tree (in base_user_role_history)</field>
<field name="model">base.user.role.line.history</field>
<field name="arch" type="xml">
<tree decoration-success="performed_action == 'add'"
decoration-danger="performed_action == 'unlink'"
create="0" edit="0" delete="0">
<field name="create_uid"
string="Editor"/>
<field name="create_date"
string="Date and time of edition"/>
<field name="performed_action"/>
<field name="old_role_id"/>
<field name="new_role_id"/>
<field name="old_date_from"/>
<field name="new_date_from"/>
<field name="old_date_to"/>
<field name="new_date_to"/>
<field name="old_is_enabled"/>
<field name="new_is_enabled"/>
<tree
decoration-success="performed_action == 'add'"
decoration-danger="performed_action == 'unlink'"
create="0"
edit="0"
delete="0"
>
<field name="create_uid" string="Editor" />
<field name="create_date" string="Date and time of edition" />
<field name="performed_action" />
<field name="old_role_id" />
<field name="new_role_id" />
<field name="old_date_from" />
<field name="new_date_from" />
<field name="old_date_to" />
<field name="new_date_to" />
<field name="old_is_enabled" />
<field name="new_is_enabled" />
</tree>
</field>
</record>

<!--SEARCH view-->

<record model="ir.ui.view" id="base_user_role_line_history_search_view">
<field name="name">base.user.role.line.history.search (in base_user_role_history)</field>
<field
name="name"
>base.user.role.line.history.search (in base_user_role_history)</field>
<field name="model">base.user.role.line.history</field>
<field name="arch" type="xml">
<search>
<field name="old_role_id"/>
<field name="new_role_id"/>
<field name="old_role_id" />
<field name="new_role_id" />
<group string="Group By" name="groupby">
<filter name="group_by_old_role"
string="Old role"
context="{'group_by': 'old_role_id'}"/>
<filter name="group_by_new_role"
string="New role"
context="{'group_by': 'new_role_id'}"/>
<filter name="group_by_performed_action"
string="Action"
context="{'group_by': 'performed_action'}"/>
<filter
name="group_by_old_role"
string="Old role"
context="{'group_by': 'old_role_id'}"
/>
<filter
name="group_by_new_role"
string="New role"
context="{'group_by': 'new_role_id'}"
/>
<filter
name="group_by_performed_action"
string="Action"
context="{'group_by': 'performed_action'}"
/>
</group>
</search>
</field>
</record>

</odoo>
25 changes: 13 additions & 12 deletions base_user_role_history/views/res_users.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

<!--FORM view-->

<record model="ir.ui.view" id="res_users_form_view">
<field name="name">res.users.form (in base_user_role_history)</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="inherit_id" ref="base.view_users_form" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button name="show_role_lines_history"
help="Roles history"
class="oe_stat_button"
icon="fa-history"
type="object">
<button
name="show_role_lines_history"
help="Roles history"
class="oe_stat_button"
icon="fa-history"
type="object"
>
<div class="o_stat_info">
<span class="o_stat_text">Last update of roles</span>
<field class="o_stat_value" name="last_role_line_modification"/>
<field
class="o_stat_value"
name="last_role_line_modification"
/>
</div>
</button>
</div>
</field>
</record>

</odoo>

0 comments on commit d427cea

Please sign in to comment.