Odoo中重置密码BUG
-
开启重置密码功能后提示'NoneType' object has no attribute 'get' ,调试代码发现
def action_reset_password(self, cr, uid, ids, context=None):<br /> """ create signup token for each user, and send their signup url by email """<br /> # prepare reset password signup<br /> create_mode = bool(context.get('create_user'))<br /> res_partner = self.pool.get('res.partner')<br /> partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)]<br /><br /> # no time limit for initial invitation, only for reset password<br /> expiration = False if create_mode else now(days=+1)<br /><br /> res_partner.signup_prepare(cr, uid, partner_ids, signup_type="reset", expiration=expiration, context=context)<br /><br /> if not context:<br /> context = {}
context为空造成的,把这个代码放前面就可以了。if not context:<br /> context = {}