33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
# -*- 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'])
|
|
|