Files
odoo_source/odoo/addons/base/res/res_users_view.xml
T
Olivier Dony eb391c2ae2 [IMP] base: improve consistency of ACL views
Further improves on previous commit:

- Remove some unnecessary cruft
- Make names/labels more consistent
- Make fields and their ordering more consistent in list views
- Change "active" field on rules into an "Archive" button
- Slightly improve inline doc on rules form view
- Add colors for "global" rules and "apply-for-all" access rights
  ('Global' is an info, but "Apply For All" is a warning, as it can
   indicate an ACL problem)
2017-11-07 18:26:40 +01:00

362 lines
20 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- change password wizard -->
<record id="change_password_wizard_view" model="ir.ui.view">
<field name="name">Change Password</field>
<field name="model">change.password.wizard</field>
<field name="arch" type="xml">
<form string="Change Password">
<field name="user_ids"/>
<footer>
<button string="Change Password" name="change_password_button" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-default" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="change_password_wizard_user_tree_view" model="ir.ui.view">
<field name="name">Change Password Users</field>
<field name="model">change.password.user</field>
<field name="arch" type="xml">
<!-- the user list is editable, but one cannot add or delete rows -->
<tree string="Users" editable="bottom" create="false" delete="false">
<field name="user_login"/>
<field name="new_passwd" required="True" password="True"/>
</tree>
</field>
</record>
<act_window id="change_password_wizard_action"
name="Change Password"
src_model="res.users"
res_model="change.password.wizard"
view_type="form" view_mode="form"
key2="client_action_multi" target="new"
groups="base.group_erp_manager"/>
<!-- res.groups -->
<record id="view_groups_search" model="ir.ui.view">
<field name="name">res.groups.search</field>
<field name="model">res.groups</field>
<field name="arch" type="xml">
<search string="Groups">
<field name="name" filter_domain="['|', ('name','ilike',self), ('category_id','ilike',self)]" string="Group"/>
<filter name="portal" string="Portal Groups" domain="[('is_portal','=',True)]"/>
<filter name="no_portal" string="Non-Portal Groups" domain="[('is_portal','=',False)]"/>
<separator orientation="vertical"/>
<field name="share"/>
<filter name="no_share" string="Internal Groups" domain="[('share','=',False)]"/>
</search>
</field>
</record>
<record id="view_groups_form" model="ir.ui.view">
<field name="name">res.groups.form</field>
<field name="model">res.groups</field>
<field name="arch" type="xml">
<form string="Groups">
<sheet>
<group col="4">
<field name="category_id"/>
<field name="name"/>
<field name="is_portal"/>
<field name="share"/>
</group>
<notebook>
<page string="Users">
<field name="users" context="{'search_default_no_share':1}"/>
</page>
<page string="Inherited">
<label string="Users added to this group are automatically added in the following groups."/>
<field name="implied_ids"/>
</page>
<page string="Menus">
<field name="menu_access"/>
</page>
<page string="Views">
<field name="view_access"/>
</page>
<page string="Access Rights">
<field name="model_access">
<tree string="Access Rights" editable="top">
<field name="name"/>
<field name="model_id"/>
<field name="perm_read"/>
<field name="perm_write"/>
<field name="perm_create"/>
<field name="perm_unlink"/>
</tree>
</field>
</page>
<page string="Record Rules">
<field name="rule_groups">
<tree string="Record Rules" editable="top">
<field name="name"/>
<field name="model_id"/>
<field name="domain_force"/>
<field name="perm_read"/>
<field name="perm_write"/>
<field name="perm_create"/>
<field name="perm_unlink"/>
</tree>
</field>
</page><page string="Notes">
<field name="comment"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="action_res_groups" model="ir.actions.act_window">
<field name="name">Groups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.groups</field>
<field name="view_type">form</field>
<field name="context">{'search_default_no_share': 1}</field>
<field name="help">A group is a set of functional areas that will be assigned to the user in order to give them access and rights to specific applications and tasks in the system. You can create custom groups or edit the ones existing by default in order to customize the view of the menu that users will be able to see. Whether they can have a read, write, create and delete access right can be managed from here.</field>
</record>
<menuitem action="action_res_groups" id="menu_action_res_groups" parent="base.menu_users" groups="base.group_no_one" sequence="3"/>
<!-- res.users -->
<record id="view_users_simple_form" model="ir.ui.view">
<field name="name">res.users.simplified.form</field>
<field name="model">res.users</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<form string="Users">
<sheet>
<field name="id" invisible="1"/>
<div class="oe_form_box_info oe_text_center" style="margin-bottom: 10px" attrs="{'invisible': [('id', '>', 0)]}">
You are creating a new user. After saving, the user will receive an invite email containing a link to set its password.
</div>
<field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" required="1"/></h1>
<field name="email" invisible="1"/>
<label for="login" class="oe_edit_only" string="Email Address"/>
<h2>
<field name="login"
placeholder="email@yourcompany.com"/>
</h2>
<label for="company_id" class="oe_edit_only" groups="base.group_multi_company"/>
<field name="company_id" context="{'user_preference': 0}" groups="base.group_multi_company"/>
</div>
<group>
<label for="groups_id" string="Access Rights"
attrs="{'invisible': [('id', '>', 0)]}" groups="base.group_no_one"/>
<div attrs="{'invisible': [('id', '>', 0)]}" groups="base.group_no_one">
<field name="groups_id" readonly="1" widget="many2many_tags" options="{'color_field': 'color'}" style="display: inline;"/> You will be able to define additional access rights by editing the newly created user under the Settings / Users menu.
</div>
<field name="phone" widget="phone"/>
<field name="mobile" widget="phone"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="arch" type="xml">
<form string="Users">
<header>
</header>
<sheet>
<field name="id" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-check">
<field name="active" widget="boolean_button" options='{"terminology": "active"}'/>
</button>
</div>
<field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" required="1"/></h1>
<field name="email" invisible="1"/>
<label for="login" class="oe_edit_only" string="Email Address"/>
<h2><field name="login"/></h2>
<group>
<field name="partner_id" readonly="1" required="0" groups="base.group_no_one"
attrs="{'invisible': [('id', '=', False)]}"/>
</group>
</div>
<notebook colspan="4">
<page name="access_rights" string="Access Rights">
<group string="Multi Companies" attrs="{'invisible': [('companies_count', '&lt;=', 1)]}">
<field string="Allowed Companies" name="company_ids" widget="many2many_tags"/>
<field string="Current Company" name="company_id" context="{'user_preference': 0}"/>
<field string="Companies count" name="companies_count" invisible="1"/>
</group>
<field name="groups_id"/>
</page>
<page string="Preferences">
<group>
<group string="Localization" name="preferences">
<field name="lang"/>
<field name="tz" widget="timezone_mismatch" options="{'tz_offset_field': 'tz_offset'}" />
<field name="tz_offset" invisible="1"/>
</group>
<group string="Menus Customization" groups="base.group_no_one">
<field name="action_id"/>
</group>
</group>
<group string="Messaging and Social" name="messaging">
<field name="signature"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_users_tree" model="ir.ui.view">
<field name="name">res.users.tree</field>
<field name="model">res.users</field>
<field name="arch" type="xml">
<tree string="Users">
<field name="name"/>
<field name="login"/>
<field name="lang"/>
<field name="login_date"/>
</tree>
</field>
</record>
<record id="view_res_users_kanban" model="ir.ui.view">
<field name="name">res.users.kanban</field>
<field name="model">res.users</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="id"/>
<field name="name"/>
<field name="login"/>
<field name="lang"/>
<field name="active"/>
<field name="login_date"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('res.users', 'image_medium', record.id.value)"/>
</div>
<div class="oe_kanban_details">
<ul>
<li class="text-success pull-right mb4" t-if="record.active.raw_value"><i class="fa fa-circle" aria-hidden="true"></i></li>
<li class="text-danger pull-right mb4" t-if="!record.active.raw_value"><i class="fa fa-circle"></i></li>
<li class="mb4">
<strong><field name="name"/></strong>
</li>
<li class="badge pull-right mb4" t-if="record.lang.raw_value"><field name="lang"/></li>
<li class="mb4" t-if="record.login.raw_value"><i class="fa fa-envelope"/> <field name="login"/></li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_users_search" model="ir.ui.view">
<field name="name">res.users.search</field>
<field name="model">res.users</field>
<field name="arch" type="xml">
<search string="Users">
<field name="name" filter_domain="['|', '|', ('name','ilike',self), ('login','ilike',self), ('email','ilike',self)]" string="User"/>
<field name="company_ids" string="Company" groups="base.group_multi_company"/>
<field name="share"/>
<filter name="no_share" string="Internal Users" domain="[('share','=',False)]"/>
<filter name="Inactive" string="Inactive Users" domain="[('active','=',False)]"/>
</search>
</field>
</record>
<record id="user_groups_view" model="ir.ui.view">
<field name="name">res.users.groups</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="view_users_form"/>
<field name="arch" type="xml">
<!-- dummy, will be modified by groups -->
<field name="groups_id" position="after"/>
</field>
</record>
<!-- dummy update on group, to force the view above to be update -->
<record model="res.groups" id="group_no_one"/>
<record id="action_res_users" model="ir.actions.act_window">
<field name="name">Users</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" ref="view_users_tree"/>
<field name="search_view_id" ref="view_users_search"/>
<field name="context">{'search_default_no_share': 1}</field>
<field name="help">Create and manage users that will connect to the system. Users can be deactivated should there be a period of time during which they will/should not connect to the system. You can assign them groups in order to give them specific access to the applications they need to use in the system.</field>
</record>
<record id="action_res_users_view1" model="ir.actions.act_window.view">
<field eval="10" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_users_tree"/>
<field name="act_window_id" ref="action_res_users"/>
</record>
<record id="action_res_users_view2" model="ir.actions.act_window.view">
<field eval="20" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_users_form"/>
<field name="act_window_id" ref="action_res_users"/>
</record>
<menuitem action="action_res_users" id="menu_action_res_users" parent="base.menu_users" sequence="0"/>
<record id="view_users_form_simple_modif" model="ir.ui.view">
<field name="name">res.users.preferences.form</field>
<field name="model">res.users</field>
<field eval="18" name="priority"/>
<field name="arch" type="xml">
<form string="Users">
<field name="image" readonly="0" widget='image' class="oe_right oe_avatar" options='{"preview_image": "image_small"}'/>
<h1>
<field name="name" readonly="1" class="oe_inline"/>
</h1>
<button name="preference_change_password" type="object" string="Change password" class="oe_link"/>
<group name="preferences" col="4">
<field name="lang" readonly="0"/>
<field name="tz" widget="timezone_mismatch" options="{'tz_offset_field': 'tz_offset'}" readonly="0"/>
<field name="tz_offset" invisible="1"/>
<field name="company_id" options="{'no_create': True}" readonly="0"
groups="base.group_multi_company"/>
</group>
<group string="Email Preferences">
<group name="preference_email">
<field name="email" widget="email" readonly="0"/>
</group>
<group name="preference_contact"></group>
</group>
<group>
<field name="signature" readonly="0"/>
</group>
<footer>
<button name="preference_save" type="object" string="Save" class="btn-primary"/>
<button name="preference_cancel" string="Cancel" special="cancel" class="btn-default"/>
</footer>
</form>
</field>
</record>
<record id="action_res_users_my" model="ir.actions.act_window">
<field name="name">Change My Preferences</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="target">new</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<record id="action_res_users_my_view2" model="ir.actions.act_window.view">
<field eval="10" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_users_form_simple_modif"/>
<field name="act_window_id" ref="action_res_users_my"/>
</record>
</data>
</odoo>