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