更新sf
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'YZ',
|
||||
'website': 'https://www.sf.cs.jikimo.com',
|
||||
'depends': ['sf_base', 'sale'],
|
||||
'depends': ['account', 'sf_base', 'base', 'sale'],
|
||||
'data': [
|
||||
'views/sale_process_order_view.xml'
|
||||
],
|
||||
|
||||
@@ -4,6 +4,8 @@ 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):
|
||||
@@ -12,30 +14,19 @@ class Sf_Bf_Connect(http.Controller):
|
||||
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({
|
||||
result = json.loads('bfm_process_order_list')
|
||||
for item in result:
|
||||
self.env['mrs.production.process'].create({
|
||||
"id": item['id'],
|
||||
"model_file": item['model_file'],
|
||||
"model_name": item['model_name'],
|
||||
"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'],
|
||||
"type": item['type'],
|
||||
"surface_technics": item['surface_technics'],
|
||||
"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
|
||||
})
|
||||
|
||||
@@ -1,52 +1,25 @@
|
||||
from odoo import models, fields
|
||||
from odoo import models,fields
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class bfmOrder(models.Model):
|
||||
_name = 'sf.bfm.order'
|
||||
_description = '业务平台订单'
|
||||
|
||||
order_number = fields.Char('订单号')
|
||||
deadline_of_delivery = fields.Date('交货截止日期')
|
||||
order_line_ids = fields.One2many('sf.bfm.order.line', 'order_id', string='订单明细')
|
||||
|
||||
|
||||
class bfmOrderLine(models.Model):
|
||||
_name = 'sf.bfm.order.line'
|
||||
_description = '业务平台订单明细'
|
||||
_description = '业务平台订单'
|
||||
|
||||
# model_file = fields.Binary('模型文件')
|
||||
model_name = fields.Char('模型名称')
|
||||
model_length = fields.Float('长[mm]', digits=(16, 3))
|
||||
model_width = fields.Float('宽[mm]', digits=(16, 3))
|
||||
model_height = fields.Float('高[mm]', digits=(16, 3))
|
||||
model_volume = fields.Float('体积[mm³]', digits=(16, 3))
|
||||
materials_id = fields.Many2one('mrs.production.materials', string='材料')
|
||||
materials_type_id = fields.Many2one('mrs.materials.model', string='型号')
|
||||
surface_technics_id = fields.Many2one('mrs.production.process', string='表面工艺')
|
||||
technological_parameter_id = fields.Many2one('sf.surface.process.item', string='工艺参数')
|
||||
model_file = fields.Binary('模型文件', attachment=False)
|
||||
model_name = fields.char('模型名称')
|
||||
type = fields.Many2one('mrs.materials.model', '型号')
|
||||
surface_technics = fields.Many2one('mrs.production.process', string='表面工艺')
|
||||
# technological_parameter = fields.Many2one('',string='工艺参数')
|
||||
unit_price = fields.Float('单价')
|
||||
amount = fields.Integer('数量')
|
||||
money = fields.Float('金额')
|
||||
order_id = fields.Many2one('sf.bfm.order', string='业务平台订单')
|
||||
# sale_order_id = fields.Many2one('sale.order')
|
||||
|
||||
|
||||
class SurfaceProcessItem(models.Model):
|
||||
_name = 'sf.surface.process.item'
|
||||
_description = '表面工艺参数'
|
||||
|
||||
sequence = fields.Integer('排序', default=99)
|
||||
name = fields.Char('名称', index=True)
|
||||
surface_id = fields.Many2one('mrs.production.process', string='表面工艺')
|
||||
remark = fields.Text('说明')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class sale(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
bfm_process_order_ids = fields.One2many('sf.bfm.order', 'sale_order_id', string='业务平台订单')
|
||||
bfm_process_order_ids = fields.Many2one('sf.bfm.order.line', string='业务平台订单')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_sf_form_inherit">
|
||||
<field name="name">sale.order.form.inherit.bfm.item</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='customer_signature']" position="before">
|
||||
<page string="业务平台订单">
|
||||
<xpath expr="//page[@name='Customer Signature']" position="before">
|
||||
<page string="Bfm Line">
|
||||
<group>
|
||||
<field name="bfm_process_order_ids" />
|
||||
<field name="bfm_process_order_ids"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
Reference in New Issue
Block a user