1.新增刀具物料参数的同步接口及方法
2.修改刀具物料参数的适配刀片型号及适配刀柄型号字段类型及新增刀柄长度,刀柄直径,法兰直径,动平衡等级,适配夹头型号,适用锁紧螺母型号,编码字段
This commit is contained in:
@@ -6,6 +6,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
_description = '刀具物料基本参数'
|
||||
|
||||
name = fields.Char('物料号', size=50)
|
||||
code = fields.Char('编码', size=50)
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具标准库')
|
||||
cutting_tool_type = fields.Char(related='standard_library_id.cutting_tool_type', string='刀具物料类型',
|
||||
store=True)
|
||||
@@ -73,11 +74,8 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
is_cooling_hole = fields.Boolean('有无冷却孔')
|
||||
locating_slot_code = fields.Char('定位槽代号', size=20)
|
||||
installing_structure = fields.Char('安装结构', size=20)
|
||||
blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.type',
|
||||
relation='basic_param_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
blade_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀片')]",
|
||||
string='适配刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
@@ -91,13 +89,17 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
interface_diameter = fields.Float('接口直径(mm)')
|
||||
# 刀柄参数
|
||||
flange_shank_length = fields.Float('法兰柄长(mm)')
|
||||
flange_diameter = fields.Float('法兰直径(mm)')
|
||||
handle_external_diameter = fields.Float('柄部外径(mm)')
|
||||
handle_inside_diameter = fields.Float('柄部内径(mm)')
|
||||
dynamic_balance_class = fields.Char('动平衡等级')
|
||||
min_clamping_diameter = fields.Float('最小夹持直径(mm)')
|
||||
max_clamping_diameter = fields.Float('最大夹持直径(mm)')
|
||||
clamping_mode = fields.Char('夹持方式', size=20)
|
||||
max_load_capacity = fields.Float('最大负载能力(kg)')
|
||||
taper = fields.Integer('锥度(°)')
|
||||
shank_length = fields.Float('刀柄长度(mm)', digits=(3, 2))
|
||||
shank_diameter = fields.Float('刀柄直径(mm)')
|
||||
tool_changing_time = fields.Integer('换刀时间(s)')
|
||||
standard_rotate_speed = fields.Integer('标准转速(n/min)')
|
||||
max_rotate_speed = fields.Integer('最大转速(n/min)')
|
||||
@@ -108,6 +110,13 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
is_quick_cutting = fields.Boolean('可高速切削', default=False)
|
||||
is_drill_hole = fields.Boolean('可钻孔', default=False)
|
||||
is_safe_lock = fields.Boolean('有无安全锁', default=False)
|
||||
chuck_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
domain="[('cutting_tool_material_id.name', '=', '夹头')]",
|
||||
string='适配夹头型号' # 使用空列表作为默认值
|
||||
)
|
||||
nut = fields.Char('适用锁紧螺母型号')
|
||||
|
||||
# 夹头参数
|
||||
er_size_model = fields.Char('ER尺寸型号', size=20)
|
||||
outer_diameter = fields.Float('外径(mm)')
|
||||
@@ -118,11 +127,8 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
clamping_length = fields.Float('夹持长度(mm)')
|
||||
clamping_tolerance = fields.Char('夹持公差(mm)', size=20)
|
||||
cooling_jacket = fields.Char('适用冷却套型号', size=50)
|
||||
handle_ids = fields.Many2many(
|
||||
'sf.cutting.tool.type',
|
||||
relation='basic_param_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
handle_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
<field name="is_cooling_hole" />
|
||||
<field name="locating_slot_code"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="blade_id" placeholder="请选择"/>
|
||||
<field name="tool_shim"/>
|
||||
<field name="cotter_pin"/>
|
||||
<field name="pressing_plate"/>
|
||||
@@ -300,7 +300,7 @@
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="main_included_angle" class="du"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="blade_id" placeholder="请选择"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
@@ -356,7 +356,7 @@
|
||||
<field name="clamping_length"/>
|
||||
<field name="clamping_tolerance"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="handle_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="handle_id" placeholder="请选择"/>
|
||||
<field name="cooling_jacket"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['sf_sale', 'sf_dlm', 'sf_manufacturing'],
|
||||
'data': [
|
||||
'data/stock_data.xml',
|
||||
# 'data/stock_data.xml',
|
||||
'views/product_template_management_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
||||
<field name="cutting_tool_material_id"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('create_uid', '!=', False)]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="cutting_tool_model_id" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('create_uid', '!=', False)]}"
|
||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||
<field name="specification_id" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('create_uid', '!=', False)]}"
|
||||
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
placeholder="请选择"/>
|
||||
@@ -42,7 +42,7 @@
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('categ_id', '!=', False)]}</attribute>
|
||||
<attribute name="attrs">{'readonly': [('create_uid', '!=', False)]}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -140,23 +140,6 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||
<field name="cutting_tool_shank_inner_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀具材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"-->
|
||||
<!-- placeholder="请选择"/>-->
|
||||
<!-- <field name="tool_hardness" string="刀具硬度(hrc)"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>-->
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="夹头材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"-->
|
||||
<!-- placeholder="请选择"/>-->
|
||||
<!-- <field name="tool_hardness" string="夹头硬度(hrc)"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>-->
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀柄材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"-->
|
||||
<!-- placeholder="请选择"/>-->
|
||||
<!-- <field name="tool_hardness" string="刀柄硬度(hrc)"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>-->
|
||||
|
||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||
<field name="cutting_tool_blade_length"
|
||||
|
||||
@@ -6,8 +6,8 @@ import os
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
|
||||
@@ -65,6 +65,8 @@ class ResConfigSettings(models.TransientModel):
|
||||
_logger.info("同步能力特征库完成")
|
||||
self.env['sf.cutting_tool.standard.library'].sync_all_cutting_tool_standard_library()
|
||||
_logger.info("同步刀具标准库完成")
|
||||
self.env['sf.tool.materials.basic.parameters'].sync_all_cutting_tool_basic_parameters()
|
||||
_logger.info("同步刀具物料基本参数完成")
|
||||
except Exception as e:
|
||||
_logger.info("捕获错误信息:%s" % e)
|
||||
raise ValidationError("数据错误导致同步失败,请联系管理员")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
import logging
|
||||
from odoo.modules import get_resource_path
|
||||
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'
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -5,8 +5,8 @@ import os
|
||||
import json
|
||||
from datetime import datetime
|
||||
import requests
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
Reference in New Issue
Block a user