修改智能工厂接收业务平台订单接口
This commit is contained in:
@@ -4,8 +4,6 @@ import logging
|
||||
from datetime import date, timedelta
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
from odoo.addons.mrs_gateway_api.models.common import Common
|
||||
from odoo.addons.mrs_gateway_api.models.basicdata_str import BasicDataStr
|
||||
|
||||
|
||||
class Sf_Bf_Connect(http.Controller):
|
||||
@@ -14,19 +12,30 @@ class Sf_Bf_Connect(http.Controller):
|
||||
cors="*")
|
||||
def get_bfm_process_order_list(self, **kw):
|
||||
"""
|
||||
获取业务平台传送来的业务平台订单
|
||||
获取业务平台传送来的订单
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
result = json.loads('bfm_process_order_list')
|
||||
for item in result:
|
||||
self.env['mrs.production.process'].create({
|
||||
"id": item['id'],
|
||||
result = json.loads('result')
|
||||
order_line_ids = []
|
||||
for item in result['bfm_process_order_list']:
|
||||
order_line_ids.append({
|
||||
"model_file": item['model_file'],
|
||||
"model_name": item['model_name'],
|
||||
"type": item['type'],
|
||||
"surface_technics": item['surface_technics'],
|
||||
"model_length": item['model_length'],
|
||||
"model_width": item['model_width'],
|
||||
"model_height": item['model_height'],
|
||||
"model_volume": item['model_volume'],
|
||||
"materials_id": item['texture_id'],
|
||||
"materials_type_id": item['texture_item_id'],
|
||||
"surface_technics_id": item['surface_id'],
|
||||
"technological_parameter_id": item['surface_item_id'],
|
||||
"unit_price": item['unit_price'],
|
||||
"amount": item['amount'],
|
||||
"money": item['money']
|
||||
})
|
||||
self.env['sf.bfm.order'].create({
|
||||
'order_number': result['order_number'],
|
||||
'deadline_of_delivery': result['delivery_end_date'],
|
||||
'order_line_ids': order_line_ids
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user