[FIX] Fixed infobox attrs
bzr revid: fme@openerp.com-20130314115028-f2x6is15jmicaumc
This commit is contained in:
@@ -161,7 +161,7 @@ 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 else
|
||||
res[user.id] = ('reset' if user.signup_valid and user.login_date else
|
||||
'active' if user.login_date else
|
||||
'new')
|
||||
return res
|
||||
@@ -169,7 +169,6 @@ class res_users(osv.Model):
|
||||
_columns = {
|
||||
'state': fields.function(_get_state, string='Status', type='selection',
|
||||
selection=[('new', 'New'), ('active', 'Active'), ('reset', 'Resetting Password')]),
|
||||
'signup_url': fields.related('partner_id', 'signup_url', type='char', string='Reset password', readonly=True),
|
||||
}
|
||||
|
||||
def signup(self, cr, uid, values, token=None, context=None):
|
||||
|
||||
@@ -17,9 +17,15 @@
|
||||
<header>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('state', '!=', 'reset')]}">
|
||||
<p><b>This user received a link in order to reset his password.</b></p>
|
||||
<p><field class="oe_inline" name="signup_url" widget="url" text="Click here to change the password by yourself."/> (this will log you out)</p>
|
||||
<div class="oe_form_box_info oe_text_center" attrs="{'invisible': ['|', ('state', '!=', 'reset'), ('state', '!=', 'new'), ('signup_valid', '!=', True)]}">
|
||||
<p attrs="{'invisible': [('state', '!=', 'reset')]}">
|
||||
<b>This user received the following link in order to reset his password.</b>
|
||||
</p>
|
||||
<p attrs="{'invisible': ['|', ('state', '!=', 'new'), ('signup_valid', '!=', True)]}">
|
||||
<b>This user has been invited with the following link.</b>
|
||||
</p>
|
||||
<p><field class="oe_inline" name="signup_url" widget="url"/> (this link will log you out)</p>
|
||||
<field name="signup_valid" invisible="1"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<!-- add Reset Password button -->
|
||||
|
||||
Reference in New Issue
Block a user