[REM] Removed one state
authorFabien Meghazi <fme@openerp.com>
Thu, 14 Mar 2013 16:01:41 +0000 (17:01 +0100)
committerFabien Meghazi <fme@openerp.com>
Thu, 14 Mar 2013 16:01:41 +0000 (17:01 +0100)
bzr revid: fme@openerp.com-20130314160141-5hrurkcy4w3wc4ca

addons/auth_signup/res_users.py
addons/auth_signup/res_users_view.xml

index 74bda08..8d717ec 100644 (file)
@@ -161,14 +161,12 @@ class res_users(osv.Model):
     def _get_state(self, cr, uid, ids, name, arg, context=None):
         res = {}
         for user in self.browse(cr, uid, ids, context):
-            res[user.id] = ('reset' if user.signup_valid and user.login_date else
-                            'active' if user.login_date else
-                            'new')
+            res[user.id] = ('active' if user.login_date else 'new')
         return res
 
     _columns = {
         'state': fields.function(_get_state, string='Status', type='selection',
-                    selection=[('new', 'Never Connected'), ('active', 'Activated'), ('reset', 'Invitation Pending')]),
+                    selection=[('new', 'Never Connected'), ('active', 'Activated')]),
     }
 
     def signup(self, cr, uid, values, token=None, context=None):
index ea2efc7..156d9f2 100644 (file)
                     <header>
                         <field name="state" widget="statusbar"/>
                     </header>
-                    <div class="oe_form_box_info oe_text_center" attrs="{'invisible': ['|', ('state', '!=', 'reset'), ('state', '!=', 'new'), ('signup_valid', '!=', True)]}">
-                        <p attrs="{'invisible': [('state', '!=', 'reset')]}">
+                    <div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('signup_valid', '!=', True)]}">
+                        <p attrs="{'invisible': [('state', '!=', 'active')]}">
                             <b>A password reset has been requested for this user. An email containing the following link has been sent:</b>
                         </p>
-                        <p attrs="{'invisible': ['|', ('state', '!=', 'new'), ('signup_valid', '!=', True)]}">
-                            <b>This user has not logged in yet. An invitation email has been sent with the following subscription link:</b>
+                        <p attrs="{'invisible': [('state', '!=', 'new')]}">
+                            <b>An invitation email has been sent to this user with the following subscription link:</b>
                         </p>
                         <p><field class="oe_inline" name="signup_url" widget="url"/></p>
                         <field name="signup_valid" invisible="1"/>
                 <xpath expr="//div[@class='oe_right oe_button_box']" position="replace">
                     <div class="oe_right oe_button_box">
                         <button string="Send reset password instructions by email"
-                                type="object" name="action_reset_password" />
-                        <!-- TODO: Send an invitation email -->
+                                type="object" name="action_reset_password"
+                                attrs="{'invisible': [('state', '!=', 'active')]}"/>
+                        <button string="Send an invitation email"
+                                type="object" name="action_reset_password"
+                                attrs="{'invisible': [('state', '!=', 'new')]}"/>
                     </div>
                 </xpath>
             </field>