[MERGE] Sync with trunk
[odoo/odoo.git] / addons / auth_signup / res_users_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4
5         <!-- add context in action to enable automatic reset password -->
6         <record id="base.action_res_users" model="ir.actions.act_window">
7             <field name="context">{'reset_password': True}</field>
8         </record>
9
10         <record id="res_users_form_view" model="ir.ui.view">
11             <field name="name">user.form.state</field>
12             <field name="model">res.users</field>
13             <field name="inherit_id" ref="base.view_users_form"/>
14             <field name="arch" type="xml">
15                 <!-- add state field in header -->
16                 <xpath expr="//sheet" position="before">
17                     <header>
18                         <field name="state" widget="statusbar"/>
19                     </header>
20                     <div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('signup_valid', '!=', True)]}">
21                         <p attrs="{'invisible': [('state', '!=', 'active')]}">
22                             <b>A password reset has been requested for this user. An email containing the following link has been sent:</b>
23                         </p>
24                         <p attrs="{'invisible': [('state', '!=', 'new')]}">
25                             <b>An invitation email containing the following subscription link has been sent:</b>
26                         </p>
27                         <p><field class="oe_inline" name="signup_url" widget="url"/></p>
28                         <field name="signup_valid" invisible="1"/>
29                     </div>
30                 </xpath>
31                 <!-- add Reset Password button -->
32                 <xpath expr="//div[@class='oe_right oe_button_box']//button" position="replace">
33                         <button string="Send Reset Password Instructions"
34                                 class="oe_link"
35                                 type="object" name="action_reset_password"
36                                 attrs="{'invisible': [('state', '!=', 'active')]}"/>
37                         <button string="Send an Invitation Email"
38                                 class="oe_link"
39                                 type="object" name="action_reset_password" context="{'create_user': 1}"
40                                 attrs="{'invisible': [('state', '!=', 'new')]}"/>
41                 </xpath>
42             </field>
43         </record>
44
45     </data>
46 </openerp>