Skip to content

Commit

Permalink
Merge branch '13.0' of gitee.com:jone/oejia_weshop_p into 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JoneXiong committed Mar 28, 2023
2 parents 379d9f3 + 5198cde commit 5dc5031
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
14 changes: 7 additions & 7 deletions controllers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ def get_request(self, httprequest):
return HttpRequest(httprequest)
root.get_request = MethodType(get_request, root)

origin_get_response = root.get_response
def get_response(self, httprequest, result, explicit_session):
response = origin_get_response(httprequest, result, explicit_session)
if hasattr(response, 'headers') and response.headers.get('set-sid'):
response.headers.set('set-sid', httprequest.session.sid)
return response
root.get_response = MethodType(get_response, root)
origin_get_response = root.get_response
def get_response(self, httprequest, result, explicit_session):
response = origin_get_response(httprequest, result, explicit_session)
if hasattr(response, 'headers') and response.headers.get('set-sid'):
response.headers.set('set-sid', httprequest.session.sid)
return response
root.get_response = MethodType(get_response, root)

10 changes: 7 additions & 3 deletions controllers/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ def create(self, sub_domain, **kwargs):
}
order_dict.update(kwargs)
if kwargs.get('extraInfo'):
extraInfo = json.loads(kwargs.get('extraInfo'))
order_dict.update(extraInfo)
try:
extraInfo = json.loads(kwargs.get('extraInfo'))
order_dict.update(extraInfo)
except:
import traceback;traceback.print_exc()
order_dict['_params'] = {'calculate': calculate, 'isNeedLogistics': isNeedLogistics}
order_dict['_params'].update(kwargs)
_logger.info('>>> order_dict %s', order_dict)
Expand Down Expand Up @@ -138,7 +141,8 @@ def create(self, sub_domain, **kwargs):

#mail_template = request.env.ref('wechat_mall_order_create')
#mail_template.sudo().send_mail(order.id, force_send=True, raise_exception=False)
order.action_accounted(order_dict)
if hasattr(order, 'action_accounted'):
order.action_accounted(order_dict)
order.action_created(order_dict)
_data = {
"amountReal": round(order.amount_total, 2),
Expand Down
3 changes: 3 additions & 0 deletions models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def delivery_window(self):

@api.multi
def action_paid(self):
'''
将订单置为已支付(电商)
'''
self.write({'customer_status': 'pending', 'is_paid': True})

@api.multi
Expand Down
5 changes: 0 additions & 5 deletions views/wxapp_payment_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@
<field name="wechat_user_id"/>
<field name="payment_number"/>
<field name="price" sum="合计" widget="monetary"/>
<field name="cash_fee"/>
<field name="cash_fee_type"/>
<field name="coupon_count"/>
<field name="coupon_fee"/>
<field name="fee_type"/>
<field name="result_code"/>
<field name="settlement_total_fee"/>
<field name="total_fee"/>
<field name="transaction_id"/>
<field name="status"/>
</tree>
Expand Down

0 comments on commit 5dc5031

Please sign in to comment.