产品模板的型号手动输入时型号对象的编码,联装类型,夹具物料字段的值显示
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
'views/common_view.xml',
|
'views/common_view.xml',
|
||||||
'views/fixture_view.xml',
|
'views/fixture_view.xml',
|
||||||
'views/functional_fixture_view.xml',
|
'views/functional_fixture_view.xml',
|
||||||
# 'views/quick_easy_order_view.xml',
|
|
||||||
'views/menu_view.xml',
|
'views/menu_view.xml',
|
||||||
"views/tool_views.xml",
|
"views/tool_views.xml",
|
||||||
"views/tool_menu.xml",
|
"views/tool_menu.xml",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from . import common
|
|||||||
from . import tool_base_new
|
from . import tool_base_new
|
||||||
from . import fixture
|
from . import fixture
|
||||||
from . import functional_fixture
|
from . import functional_fixture
|
||||||
# from . import quick_easy_order
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ class FixtureModel(models.Model):
|
|||||||
_name = 'sf.fixture.model'
|
_name = 'sf.fixture.model'
|
||||||
_description = "夹具型号"
|
_description = "夹具型号"
|
||||||
|
|
||||||
code = fields.Char(string='编码')
|
|
||||||
name = fields.Char(string="名称", size=15)
|
name = fields.Char(string="名称", size=15)
|
||||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", )
|
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", )
|
||||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True)
|
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True)
|
||||||
@@ -53,10 +52,38 @@ class FixtureModel(models.Model):
|
|||||||
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
|
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
# @api.model
|
def _get_code(self, fixture_model_type_code):
|
||||||
# def create(self, vals):
|
fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||||
# obj = super(FixtureModel, self).create(vals)
|
[('code', 'ilike', fixture_model_type_code)],
|
||||||
# return obj
|
limit=1,
|
||||||
|
order="id desc")
|
||||||
|
if not fixture_model:
|
||||||
|
num = "%03d" % 1
|
||||||
|
else:
|
||||||
|
m = int(fixture_model.code[-3:]) + 1
|
||||||
|
num = "%03d" % m
|
||||||
|
return "%s%s" % (fixture_model_type_code, num)
|
||||||
|
|
||||||
|
code = fields.Char(string='编码', readonly=True)
|
||||||
|
|
||||||
|
def _onchange_fixture_material_id(self, fixture_material_id):
|
||||||
|
if fixture_material_id:
|
||||||
|
if fixture_material_id.name == "气动夹具":
|
||||||
|
code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||||
|
elif fixture_material_id.name == "转接板(锁板)夹具":
|
||||||
|
code = self._get_code("JKM-C-JJWL-ZJBJJ-")
|
||||||
|
elif fixture_material_id.name == "磁吸夹具":
|
||||||
|
code = self._get_code("JKM-C-JJWL-CXJJ-")
|
||||||
|
elif fixture_material_id.name == "虎钳夹具":
|
||||||
|
code = self._get_code("JKM-C-JJWL-HQJJ-")
|
||||||
|
else:
|
||||||
|
code = self._get_code("JKM-C-JJWL-LDKP-")
|
||||||
|
return code
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def create(self, vals):
|
||||||
|
obj = super(FixtureModel, self).create(vals)
|
||||||
|
if obj.fixture_material_id:
|
||||||
|
code = self._onchange_fixture_material_id(obj.fixture_material_id)
|
||||||
|
obj.code = code
|
||||||
|
return obj
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
from odoo import models, fields
|
|
||||||
import datetime
|
|
||||||
import base64
|
|
||||||
|
|
||||||
|
|
||||||
class QuickEasyOrder(models.Model):
|
|
||||||
_name = 'quick.easy.order'
|
|
||||||
_description = '简易下单'
|
|
||||||
|
|
||||||
name = fields.Char('订单编号', default=lambda self: self.env['ir.sequence'].next_by_code('quick.easy.order'))
|
|
||||||
machining_precision = fields.Selection([
|
|
||||||
('0.10', '±0.10mm'),
|
|
||||||
('0.05', '±0.05mm'),
|
|
||||||
('0.03', '±0.03mm'),
|
|
||||||
('0.02', '±0.02mm'),
|
|
||||||
('0.01', '±0.01mm')], string='加工精度')
|
|
||||||
material_id = fields.Many2one('sf.production.materials', '材料')
|
|
||||||
material_model_id = fields.Many2one('sf.materials.model', '型号')
|
|
||||||
process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
|
||||||
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
|
|
||||||
quantity = fields.Integer('数量')
|
|
||||||
price = fields.Float('总价')
|
|
||||||
model_file = fields.Binary('模型文件')
|
|
||||||
upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='上传模型文件')
|
|
||||||
delivery_time = fields.Date('交货日期')
|
|
||||||
customer_id = fields.Many2one('res.partner', string='客户', default=lambda self: self.env.user.partner_id.id)
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from odoo import fields, models, api
|
from odoo import fields, models, api
|
||||||
|
|
||||||
|
|
||||||
# from datetime import datetime
|
# from datetime import datetime
|
||||||
# from odoo.exceptions import ValidationError
|
# from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
@@ -95,7 +97,6 @@ class CuttingToolModel(models.Model):
|
|||||||
_description = '刀具型号'
|
_description = '刀具型号'
|
||||||
|
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
code = fields.Char('编码')
|
|
||||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', string='刀具物料')
|
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', string='刀具物料')
|
||||||
cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
|
cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
|
||||||
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='刀具类型',
|
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='刀具类型',
|
||||||
@@ -177,12 +178,43 @@ class CuttingToolModel(models.Model):
|
|||||||
)
|
)
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
# @api.model
|
def _get_code(self, cutting_tool_type_code):
|
||||||
# def create(self, vals):
|
cutting_tool_model = self.search(
|
||||||
# if vals.get('name', '/') == '/' or vals.get('name', '/') is False:
|
[('code', 'ilike', cutting_tool_type_code)],
|
||||||
# vals['name'] = '/'
|
limit=1,
|
||||||
# obj = super(CuttingToolModel, self).create(vals)
|
order="id desc")
|
||||||
# return obj
|
if not cutting_tool_model:
|
||||||
|
num = "%03d" % 1
|
||||||
|
else:
|
||||||
|
m = int(cutting_tool_model.code[-3:]) + 1
|
||||||
|
num = "%03d" % m
|
||||||
|
return "%s%s" % (cutting_tool_type_code, num)
|
||||||
|
|
||||||
|
code = fields.Char(string='编码', readonly=True)
|
||||||
|
|
||||||
|
def _onchange_cutting_tool_material_id(self, cutting_tool_material_id):
|
||||||
|
if cutting_tool_material_id:
|
||||||
|
if cutting_tool_material_id.name == "整体式刀具":
|
||||||
|
code = self._get_code("JKM-T-DJWL-ZTDJ-")
|
||||||
|
elif cutting_tool_material_id.name == "刀片":
|
||||||
|
code = self._get_code("JKM-T-DJWL-DPIA-")
|
||||||
|
elif cutting_tool_material_id.name == "刀杆":
|
||||||
|
code = self._get_code("JKM-T-DJWL-DGAN-")
|
||||||
|
elif cutting_tool_material_id.name == "刀盘":
|
||||||
|
code = self._get_code("JKM-T-DJWL-DPAN-")
|
||||||
|
elif cutting_tool_material_id.name == "夹头":
|
||||||
|
code = self._get_code("JKM-T-DJWL-DJIA-")
|
||||||
|
else:
|
||||||
|
code = self._get_code("JKM-T-DJWL-DBIN-")
|
||||||
|
return code
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def create(self, vals):
|
||||||
|
obj = super(CuttingToolModel, self).create(vals)
|
||||||
|
if obj.cutting_tool_material_id:
|
||||||
|
code = self._onchange_cutting_tool_material_id(obj.cutting_tool_material_id)
|
||||||
|
obj.code = code
|
||||||
|
return obj
|
||||||
|
|
||||||
|
|
||||||
# 刀具类型
|
# 刀具类型
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
<field name="name">夹具型号</field>
|
<field name="name">夹具型号</field>
|
||||||
<field name="model">sf.fixture.model</field>
|
<field name="model">sf.fixture.model</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="夹具型号" create="0" edit="0" delete="1">
|
<tree string="夹具型号" create="0" edit="0" delete="1">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="name" string="名称"/>
|
<field name="name" string="名称"/>
|
||||||
<field name="brand_id"/>
|
<field name="brand_id"/>
|
||||||
@@ -177,11 +177,11 @@
|
|||||||
<field name="name">夹具型号</field>
|
<field name="name">夹具型号</field>
|
||||||
<field name="model">sf.fixture.model</field>
|
<field name="model">sf.fixture.model</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="夹具型号" create="0" edit="0" delete="1" >
|
<form string="夹具型号" create="0" edit="0" delete="1">
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" />
|
<field name="name"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
@@ -229,7 +229,8 @@
|
|||||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||||
<field name="driving_way"
|
<field name="driving_way"
|
||||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘"))]}'/>
|
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘"))]}'/>
|
||||||
<field name="apply_machine_tool_type_ids" widget="many2many_tags" options="{'no_create': True}"
|
<field name="apply_machine_tool_type_ids" widget="many2many_tags"
|
||||||
|
options="{'no_create': True}"
|
||||||
attrs='{"invisible": [("fixture_material_type","!=",("零点卡盘"))]}'/>
|
attrs='{"invisible": [("fixture_material_type","!=",("零点卡盘"))]}'/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
|
|||||||
@@ -32,10 +32,10 @@
|
|||||||
name="功能夹具类型"
|
name="功能夹具类型"
|
||||||
sequence="3"
|
sequence="3"
|
||||||
/>
|
/>
|
||||||
<menuitem id="menu_sf_functional_fixture"
|
<!-- <menuitem id="menu_sf_functional_fixture"-->
|
||||||
parent="menu_sf_fixture"
|
<!-- parent="menu_sf_fixture"-->
|
||||||
action="sf_functional_fixture_view_act"
|
<!-- action="sf_functional_fixture_view_act"-->
|
||||||
name="功能夹具"
|
<!-- name="功能夹具"-->
|
||||||
sequence="4"
|
sequence="4"
|
||||||
/>
|
/>
|
||||||
</odoo>
|
</odoo>
|
||||||
File diff suppressed because one or more lines are too long
@@ -109,13 +109,13 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 功能刀具 -->
|
<!-- 功能刀具 -->
|
||||||
<menuitem
|
<!-- <menuitem-->
|
||||||
id="menu_sf_functional_cutting_tool"
|
<!-- id="menu_sf_functional_cutting_tool"-->
|
||||||
parent="menu_sf_base"
|
<!-- parent="menu_sf_base"-->
|
||||||
name="功能刀具"
|
<!-- name="功能刀具"-->
|
||||||
sequence="3"
|
<!-- sequence="3"-->
|
||||||
action="action_sf_functional_cutting_tool"
|
<!-- action="action_sf_functional_cutting_tool"-->
|
||||||
/>
|
<!-- />-->
|
||||||
<!-- 刀具物料 -->
|
<!-- 刀具物料 -->
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_sf_cutting_tool_material"
|
id="menu_sf_cutting_tool_material"
|
||||||
|
|||||||
@@ -70,13 +70,13 @@
|
|||||||
action="action_sf_cutting_tool"
|
action="action_sf_cutting_tool"
|
||||||
/>
|
/>
|
||||||
<!-- 功能刀具 -->
|
<!-- 功能刀具 -->
|
||||||
<menuitem
|
<!-- <menuitem-->
|
||||||
id="menu_sf_functional_cutting_tool"
|
<!-- id="menu_sf_functional_cutting_tool"-->
|
||||||
parent="menu_sf_cutting_tool"
|
<!-- parent="menu_sf_cutting_tool"-->
|
||||||
name="功能刀具"
|
<!-- name="功能刀具"-->
|
||||||
sequence="5"
|
<!-- sequence="5"-->
|
||||||
action="action_sf_functional_cutting_tool"
|
<!-- action="action_sf_functional_cutting_tool"-->
|
||||||
/>
|
<!-- />-->
|
||||||
<!-- 功能刀具类型 -->
|
<!-- 功能刀具类型 -->
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_sf_functional_cutting_tool_model_type"
|
id="menu_sf_functional_cutting_tool_model_type"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="inherit_id" ref="sale.product_template_form_view"/>
|
<field name="inherit_id" ref="sale.product_template_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="detailed_type" position="before">
|
<field name="list_price" position="before">
|
||||||
<field name='categ_type' invisible="1"/>
|
<field name='categ_type' invisible="1"/>
|
||||||
<field name="upload_model_file"
|
<field name="upload_model_file"
|
||||||
widget="many2many_binary"
|
widget="many2many_binary"
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
|
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
|
||||||
</field>
|
</field>
|
||||||
<field name="invoice_policy" position="after">
|
<field name="invoice_policy" position="after">
|
||||||
|
<!-- <field name='categ_id'/>-->
|
||||||
<field name='cutting_tool_type' invisible="1"/>
|
<field name='cutting_tool_type' invisible="1"/>
|
||||||
<field name="fixture_material_type" invisible="1"/>
|
<field name="fixture_material_type" invisible="1"/>
|
||||||
<field name="embryo_model_type_id" string="模型类型"
|
<field name="embryo_model_type_id" string="模型类型"
|
||||||
@@ -29,13 +30,18 @@
|
|||||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
||||||
<field name="cutting_tool_material_id" attrs="{'invisible': [('categ_type', '!=', '刀具')]}"/>
|
<field name="cutting_tool_material_id" attrs="{'invisible': [('categ_type', '!=', '刀具')]}"/>
|
||||||
<field name="cutting_tool_model_id"
|
<field name="cutting_tool_model_id"
|
||||||
|
context="{'default_cutting_tool_material_id': cutting_tool_material_id,'default_cutting_tool_type_id': cutting_tool_type_id}"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"/>
|
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"/>
|
||||||
<field name="fixture_model_id" string="型号"
|
<field name="fixture_model_id" string="型号"
|
||||||
|
context="{'default_fixture_material_id': fixture_material_id,'default_multi_mounting_type_id': fixture_multi_mounting_type_id}"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||||
</field>
|
</field>
|
||||||
|
<!-- <field name="categ_id" position="replace">-->
|
||||||
|
<!-- <field name='categ_id' invisible="1"/>-->
|
||||||
|
<!-- </field>-->
|
||||||
<xpath expr="//label[@for='volume']" position="before">
|
<xpath expr="//label[@for='volume']" position="before">
|
||||||
<label for="length" string="尺寸"
|
<label for="length" string="尺寸"
|
||||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from. import sale_order
|
from . import sale_order
|
||||||
from. import quick_easy_order
|
from . import quick_easy_order
|
||||||
|
from . import auto_quatotion_common
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,13 +82,13 @@ class QuickEasyOrder(models.Model):
|
|||||||
# 将attach的datas内容转为glb文件
|
# 将attach的datas内容转为glb文件
|
||||||
def transition_glb_file(self, report_path, model_code):
|
def transition_glb_file(self, report_path, model_code):
|
||||||
shapes = read_step_file(report_path)
|
shapes = read_step_file(report_path)
|
||||||
output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
#output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
||||||
# output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
||||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||||
# 转化为glb
|
# 转化为glb
|
||||||
output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
#output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
||||||
# output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
||||||
util_path = get_resource_path('mrs_base', 'static/util')
|
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||||
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
|
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
# 转base64
|
# 转base64
|
||||||
@@ -138,7 +138,7 @@ class QuickEasyOrder(models.Model):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
web_base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', default='')
|
web_base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', default='')
|
||||||
logging.info("自动报价返回值: %s" % ret)
|
logging.info("web_base_url: %s" % web_base_url)
|
||||||
url = '/api/bfm_process_order/list'
|
url = '/api/bfm_process_order/list'
|
||||||
res = {'order_number': obj.name, 'delivery_end_date': str(datetime.now()),
|
res = {'order_number': obj.name, 'delivery_end_date': str(datetime.now()),
|
||||||
'delivery_name': 'XXXXX', 'delivery_telephone': 'XXXXX',
|
'delivery_name': 'XXXXX', 'delivery_telephone': 'XXXXX',
|
||||||
@@ -153,10 +153,10 @@ class QuickEasyOrder(models.Model):
|
|||||||
barcode = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
barcode = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||||
logging.info('model_file-size: %s' % len(item.model_file))
|
logging.info('model_file-size: %s' % len(item.model_file))
|
||||||
val = {
|
val = {
|
||||||
'model_long': 100,
|
'model_long': item.model_length,
|
||||||
'model_width': 100,
|
'model_width': item.model_width,
|
||||||
'model_height': 100,
|
'model_height': item.model_height,
|
||||||
'model_volume': 300,
|
'model_volume': item.model_volume,
|
||||||
'model_machining_precision': item.machining_precision,
|
'model_machining_precision': item.machining_precision,
|
||||||
'model_name': attachment.name,
|
'model_name': attachment.name,
|
||||||
'model_data': base64_datas,
|
'model_data': base64_datas,
|
||||||
@@ -203,7 +203,7 @@ class QuickEasyOrder(models.Model):
|
|||||||
def model_coloring(self):
|
def model_coloring(self):
|
||||||
url = '/api/library_of_models/create'
|
url = '/api/library_of_models/create'
|
||||||
config = self.env['res.config.settings'].get_values()
|
config = self.env['res.config.settings'].get_values()
|
||||||
config_header = Common.get_headers(self, config['sf_token'], config['sf_key_secret'])
|
config_header = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||||
order = self.search([('id', '=', self.id)])
|
order = self.search([('id', '=', self.id)])
|
||||||
logging.info('order: %s' % order.name)
|
logging.info('order: %s' % order.name)
|
||||||
if order:
|
if order:
|
||||||
@@ -240,16 +240,15 @@ class QuickEasyOrder(models.Model):
|
|||||||
|
|
||||||
# 自动报价
|
# 自动报价
|
||||||
def _get_price(self, order):
|
def _get_price(self, order):
|
||||||
|
|
||||||
url = '/api/automatic_quotes'
|
url = '/api/automatic_quotes'
|
||||||
config = self.env['res.config.settings'].sudo().get_values()
|
config = self.env['res.config.settings'].sudo().get_values()
|
||||||
config_header = Common.get_headers(self, config['sf_token'], config['sf_key_secret'])
|
config_header = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||||
logging.info("报价接口..........% s" % order.name)
|
logging.info("报价接口..........% s" % order.name)
|
||||||
try:
|
try:
|
||||||
if order:
|
if order:
|
||||||
vals = {}
|
vals = {}
|
||||||
# mrs合作伙伴token
|
# mrs合作伙伴token
|
||||||
vals['token'] = config['sf_token']
|
vals['token'] = config['token']
|
||||||
vals['accuracy'] = order.machining_precision
|
vals['accuracy'] = order.machining_precision
|
||||||
vals['number'] = order.quantity
|
vals['number'] = order.quantity
|
||||||
vals['process_code'] = 0
|
vals['process_code'] = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user