洗澡基本参数回显
This commit is contained in:
@@ -125,6 +125,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
|
|
||||||
def _json_integral_tool_basic_param(self, obj):
|
def _json_integral_tool_basic_param(self, obj):
|
||||||
integral_tool_basic_param_str = (0, '', {
|
integral_tool_basic_param_str = (0, '', {
|
||||||
|
'standard_library_id': 1,
|
||||||
'code': obj['code'],
|
'code': obj['code'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'total_length': obj['total_length'],
|
'total_length': obj['total_length'],
|
||||||
|
|||||||
@@ -43,6 +43,33 @@ class Cutting_toolSpecificationWizard(models.TransientModel):
|
|||||||
feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
|
feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
|
||||||
domain=[('machining_method', '!=', False)])
|
domain=[('machining_method', '!=', False)])
|
||||||
|
|
||||||
|
def choose_basic_param(self):
|
||||||
|
self.product_id.brand_id = self.brand_id.id
|
||||||
|
self.product_id.cutting_tool_type_id = self.cutting_tool_type_id.id
|
||||||
|
record = self.integral_tool_basic_parameters_ids.browse(id)
|
||||||
|
|
||||||
|
# selected_record = self.integral_tool_basic_parameters_ids.browse(self._context.get('active_id'))
|
||||||
|
if self.cutting_tool_type == '整体式刀具':
|
||||||
|
for record in self.integral_tool_basic_parameters_ids:
|
||||||
|
selected_record1 = self.env['sf.tool.materials.basic.parameters'].browse(self._context.get('active_id'))
|
||||||
|
# 获取选中记录的字段值
|
||||||
|
self.product_id.cutting_tool_total_length = selected_record1.total_length
|
||||||
|
|
||||||
|
|
||||||
|
# self.product_id.blade_diameter = self.integral_tool_basic_parameters_ids[0].blade_diameter
|
||||||
|
# self.product_id.blade_length = self.integral_tool_basic_parameters_ids[0].blade_length
|
||||||
|
# self.product_id.blade = self.integral_tool_basic_parameters_ids[0].shank_diameter
|
||||||
|
# self.product_id.shank_length = self.integral_tool_basic_parameters_ids[0].shank_length
|
||||||
|
|
||||||
|
|
||||||
|
# elif self.cutting_tool_type == '刀片':
|
||||||
|
#
|
||||||
|
# elif self.cutting_tool_type == '刀杆':
|
||||||
|
#
|
||||||
|
# elif self.cutting_tool_type == '刀盘':
|
||||||
|
#
|
||||||
|
# elif self.cutting_tool_type == '刀柄':
|
||||||
|
|
||||||
@api.depends('cutting_tool_library_id', 'cutting_tool_type')
|
@api.depends('cutting_tool_library_id', 'cutting_tool_type')
|
||||||
def set_specification(self):
|
def set_specification(self):
|
||||||
self.integral_tool_basic_parameters_ids = False
|
self.integral_tool_basic_parameters_ids = False
|
||||||
@@ -96,17 +123,3 @@ class Cutting_toolSpecificationWizard(models.TransientModel):
|
|||||||
item.chuck_basic_parameters_ids = chuck_basic_parameters
|
item.chuck_basic_parameters_ids = chuck_basic_parameters
|
||||||
|
|
||||||
|
|
||||||
def choose_basic_param(self):
|
|
||||||
self.product_id.brand_id = self.brand_id.id
|
|
||||||
# self.product_id.brand_id = self.brand_id.id
|
|
||||||
# if self.cutting_tool_type == '整体式刀具':
|
|
||||||
# self.product_id.brand_id = self.brand_id.id
|
|
||||||
#
|
|
||||||
# elif self.cutting_tool_type == '刀片':
|
|
||||||
#
|
|
||||||
# elif self.cutting_tool_type == '刀杆':
|
|
||||||
#
|
|
||||||
# elif self.cutting_tool_type == '刀盘':
|
|
||||||
#
|
|
||||||
# elif self.cutting_tool_type == '刀柄':
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<page string="基本参数">
|
<page string="基本参数">
|
||||||
<field name="integral_tool_basic_parameters_ids"
|
<field name="integral_tool_basic_parameters_ids"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||||
<tree class="center">
|
<tree sample="1" multi_edit="1">
|
||||||
<field name="cutting_tool_type" invisible="1"/>
|
<field name="cutting_tool_type" invisible="1"/>
|
||||||
<field name="specification_id" invisible="1"/>
|
<field name="specification_id" invisible="1"/>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo import fields, models, api
|
from odoo import fields, models, api
|
||||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
#from quatotion import readSql, feature_recognize, auto_quatotion
|
||||||
|
|
||||||
__author__ = 'jinling.yang'
|
__author__ = 'jinling.yang'
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@@ -24,14 +24,14 @@ class AutoQuatotion(models.Model):
|
|||||||
def get_process_time_db_path(self):
|
def get_process_time_db_path(self):
|
||||||
return get_resource_path('sf_sale', 'models', 'process_time.db')
|
return get_resource_path('sf_sale', 'models', 'process_time.db')
|
||||||
|
|
||||||
def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
|
# def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
|
||||||
'''
|
# '''
|
||||||
通过打包好的.so库,
|
# 通过打包好的.so库,
|
||||||
以调用autoQuatotion库中Quatotion类,
|
# 以调用autoQuatotion库中Quatotion类,
|
||||||
初始化后调用类的analyseShape方法对模型文件进行价格预测
|
# 初始化后调用类的analyseShape方法对模型文件进行价格预测
|
||||||
'''
|
# '''
|
||||||
# 初始化自动报价类(输入特征数据库和加工时间数据库)
|
# # 初始化自动报价类(输入特征数据库和加工时间数据库)
|
||||||
reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
|
# reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
|
||||||
# 获取价格、加工时间、尺寸、XYZ、翻面次数
|
# # 获取价格、加工时间、尺寸、XYZ、翻面次数
|
||||||
feature_info = reader.analyseShape(stp_url, InfoJson={})
|
# feature_info = reader.analyseShape(stp_url, InfoJson={})
|
||||||
return feature_info
|
# return feature_info
|
||||||
|
|||||||
Reference in New Issue
Block a user