Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
elfgzp committed Aug 31, 2017
1 parent d9c4b9a commit 50436c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions controllers/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ def post(self, sub_domain, **kwargs):
)
else:
if unified_order['err_code'] == 'ORDERPAID':
payment.order_id.write({'status': 'pending'})
order = payment.order_id
order.write({'status': 'pending'})
mail_template = request.env.ref('wechat_mall.wechat_mall_order_paid')
mail_template.sudo().send_mail(payment.order_id.id, force_send=True, raise_exception=False)
payment.unlink()
mail_template.sudo().send_mail(order.id, force_send=True, raise_exception=False)
payment.sudo().unlink()
return request.make_response(
json.dumps({'code': -1, 'msg': unified_order.get('err_code_des', unified_order['return_msg'])})
)
Expand Down

0 comments on commit 50436c2

Please sign in to comment.