diff --git a/sf_bf_connect/controllers/controllers.py b/sf_bf_connect/controllers/controllers.py index aa31b8b6..83a9bac5 100644 --- a/sf_bf_connect/controllers/controllers.py +++ b/sf_bf_connect/controllers/controllers.py @@ -143,3 +143,18 @@ class jdElcp(http.Controller): aa.bill_url = kw['bill'] logging.info('get_jd_bill================:%s' % aa.bill_url) + + @http.route('/api/update/order/status', type='http', auth='none', methods=['GET', 'POST'], csrf=False, + cors="*") + def update_order_status(self, **kw): + """ + 根据拿到的商家单号,修改订单状态 + """ + logging.info('change_sale_order_state================:%s', kw) + if not kw.get('orderNo'): + return json.dumps({'statusCode': 415, 'statusMessage': '订单号不能为空'}, ensure_ascii=False) + aa = request.env['sale.order'].sudo().search([('name', '=', kw['orderNo'])]) + if aa: + aa.schedule_status = 'received' + return json.dumps({'statusCode': 200, 'statusMessage': '修改成功'}, ensure_ascii=False) + diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py index 45fae2d8..c740869a 100644 --- a/sf_bf_connect/models/jd_eclp.py +++ b/sf_bf_connect/models/jd_eclp.py @@ -164,6 +164,9 @@ class JdEclp(models.Model): self.is_bill = True self.logistics_status = '1' + # 京东物流下单后,销售订单状态改为待收货 + self.env['sale.order'].search([('name', '=', self.origin)]).write({'scheduled_status': 'to receive'}) + # else: # raise UserError("选择京东物流才能下单呦")