月结取消订单
This commit is contained in:
@@ -132,6 +132,26 @@ class Sf_Bf_Connect(http.Controller):
|
||||
request.cr.rollback()
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
@http.route('/api/bfm_cancel_order', type='http', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def get_bfm_cancel_order(self, **kw):
|
||||
"""
|
||||
业务平台取消销售订单
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
res = {'status': 1, 'message': '工厂取消销售订单成功'}
|
||||
logging.info('get_bfm_cancel_order:%s' % kw['order_number'])
|
||||
try:
|
||||
sale_order_info = request.env['sale.order'].sudo().search([('name', '=', kw['order_number'])])
|
||||
sale_order_info._action_cancel()
|
||||
return json.JSONEncoder().encode(res)
|
||||
except Exception as e:
|
||||
logging.error('get_bfm_cancel_order error: %s' % e)
|
||||
res['status'] = -1
|
||||
res['message'] = '工厂取消销售订单失败,请联系管理员'
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
|
||||
class jdElcp(http.Controller):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user