智能工厂接口新增相关字段
This commit is contained in:
32
sf_bpm_api/controllers/controllers.py
Normal file
32
sf_bpm_api/controllers/controllers.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import logging
|
||||
from datetime import date, timedelta
|
||||
from odoo import http
|
||||
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,
|
||||
cors="*")
|
||||
def get_bfm_process_order_list(self, **kw):
|
||||
"""
|
||||
获取业务平台传送来的订单
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
result = json.loads('result')
|
||||
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'])
|
||||
|
||||
Reference in New Issue
Block a user