智能工厂API接口创建销售订单
This commit is contained in:
@@ -8,7 +8,7 @@ from odoo.http import request
|
||||
|
||||
class Sf_Bf_Connect(http.Controller):
|
||||
|
||||
@http.route('/api/bfm_process_order/list', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
@http.route('/api/bfm_process_order/list', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def get_bfm_process_order_list(self, **kw):
|
||||
"""
|
||||
@@ -16,17 +16,10 @@ class Sf_Bf_Connect(http.Controller):
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
result = json.loads('result')
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
ret = json.loads(ret['result'])
|
||||
request.env['sale.order'].sudo().sale_order_create(ret['delivery_end_date'])
|
||||
order_line_ids = []
|
||||
for item in result['bfm_process_order_list']:
|
||||
order_line_ids.append({
|
||||
"long": item['model_length'],
|
||||
"width": item['model_width'],
|
||||
"height": item['model_height'],
|
||||
"volume": item['model_volume'],
|
||||
"materials_id": item['texture_id'],
|
||||
"unit_price": item['unit_price']
|
||||
# "barcode": item['barcode']
|
||||
})
|
||||
self.env['sale.order'].sudo().sale_order_create(result['result'])
|
||||
|
||||
# for item in ret['bfm_process_order_list']:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user