修复刀具产品及同步刀具标准库
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
'views/functional_fixture_view.xml',
|
'views/functional_fixture_view.xml',
|
||||||
'views/menu_view.xml',
|
'views/menu_view.xml',
|
||||||
'views/tool_views.xml',
|
'views/tool_views.xml',
|
||||||
|
'views/tool_basic_param.xml',
|
||||||
'views/tool_menu.xml',
|
'views/tool_menu.xml',
|
||||||
'views/menu_fixture_view.xml',
|
'views/menu_fixture_view.xml',
|
||||||
|
|
||||||
|
|||||||
@@ -140,12 +140,12 @@ class CuttingToolModel(models.Model):
|
|||||||
integral_run_out_accuracy_max = fields.Char('整体式刀具端跳精度max')
|
integral_run_out_accuracy_max = fields.Char('整体式刀具端跳精度max')
|
||||||
integral_run_out_accuracy_min = fields.Char('整体式刀具端跳精度min')
|
integral_run_out_accuracy_min = fields.Char('整体式刀具端跳精度min')
|
||||||
|
|
||||||
fit_blade_shape_ids = fields.Many2many('maintenance.equipment.image', 'fit_blade_shape_library_rel',
|
fit_blade_shape_id = fields.Many2many('maintenance.equipment.image', 'fit_blade_shape_library_rel',
|
||||||
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
||||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||||
'suitable_machining_method_library_rel',
|
'suitable_machining_method_library_rel',
|
||||||
'适合加工方式', domain=[('type', '=', '加工能力')])
|
'适合加工方式', domain=[('type', '=', '加工能力')])
|
||||||
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
|
blade_tip_characteristics_id = fields.Many2many('maintenance.equipment.image',
|
||||||
'blade_tip_character_library_rel',
|
'blade_tip_character_library_rel',
|
||||||
'刀尖特征', domain=[('type', '=', '刀尖特征')])
|
'刀尖特征', domain=[('type', '=', '刀尖特征')])
|
||||||
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'handle_type_library_rel',
|
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'handle_type_library_rel',
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
store=True)
|
store=True)
|
||||||
|
|
||||||
# 整体式刀具参数
|
# 整体式刀具参数
|
||||||
# code = fields.Char('物料号', size=50)
|
|
||||||
total_length = fields.Char('总长度(mm)', size=20)
|
total_length = fields.Char('总长度(mm)', size=20)
|
||||||
blade_number = fields.Selection(
|
blade_number = fields.Selection(
|
||||||
[('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')],
|
[('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')],
|
||||||
@@ -124,15 +123,9 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
string='适用刀柄型号'
|
string='适用刀柄型号'
|
||||||
)
|
)
|
||||||
|
|
||||||
def name_get(self):
|
|
||||||
res = []
|
|
||||||
for obj in self:
|
|
||||||
res.append((obj.id, obj.blade_diameter))
|
|
||||||
return res
|
|
||||||
|
|
||||||
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, '', {
|
||||||
'name': obj['code'],
|
'name': obj['name'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'total_length': obj['total_length'],
|
'total_length': obj['total_length'],
|
||||||
'blade_diameter': obj['blade_diameter'],
|
'blade_diameter': obj['blade_diameter'],
|
||||||
@@ -155,7 +148,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
|
|
||||||
def _json_blade_basic_param(self, obj):
|
def _json_blade_basic_param(self, obj):
|
||||||
blade_basic_param_str = (0, '', {
|
blade_basic_param_str = (0, '', {
|
||||||
'name': obj['code'],
|
'name': obj['name'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'length': obj['length'],
|
'length': obj['length'],
|
||||||
'thickness': obj['thickness'],
|
'thickness': obj['thickness'],
|
||||||
@@ -185,7 +178,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
|
|
||||||
def _json_cutter_arbor_basic_param(self, obj):
|
def _json_cutter_arbor_basic_param(self, obj):
|
||||||
cutter_arbor_basic_param_str = (0, '', {
|
cutter_arbor_basic_param_str = (0, '', {
|
||||||
'name': obj['code'],
|
'name': obj['name'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'height': obj['height'],
|
'height': obj['height'],
|
||||||
'width': obj['width'],
|
'width': obj['width'],
|
||||||
@@ -216,7 +209,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
|
|
||||||
def _json_cutter_head_basic_param(self, obj):
|
def _json_cutter_head_basic_param(self, obj):
|
||||||
cutter_head_basic_param_str = (0, '', {
|
cutter_head_basic_param_str = (0, '', {
|
||||||
'name': obj['code'],
|
'name': obj['name'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'install_blade_tip_num': obj['install_blade_tip_num'],
|
'install_blade_tip_num': obj['install_blade_tip_num'],
|
||||||
'blade_diameter': obj['blade_diameter'],
|
'blade_diameter': obj['blade_diameter'],
|
||||||
@@ -239,7 +232,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
|
|
||||||
def _json_knife_handle_basic_param(self, obj):
|
def _json_knife_handle_basic_param(self, obj):
|
||||||
knife_handle_basic_param_str = (0, '', {
|
knife_handle_basic_param_str = (0, '', {
|
||||||
'name': obj['code'],
|
'name': obj['name'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'total_length': obj['total_length'],
|
'total_length': obj['total_length'],
|
||||||
'flange_shank_length': obj['flange_shank_length'],
|
'flange_shank_length': obj['flange_shank_length'],
|
||||||
@@ -267,7 +260,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
|
|
||||||
def _json_chuck_basic_param(self, obj):
|
def _json_chuck_basic_param(self, obj):
|
||||||
chuck_basic_param_str = (0, '', {
|
chuck_basic_param_str = (0, '', {
|
||||||
'name': obj['code'],
|
'name': obj['name'],
|
||||||
'cutting_tool_type': obj['cutting_tool_type'],
|
'cutting_tool_type': obj['cutting_tool_type'],
|
||||||
'er_size_model': obj['er_size_model'],
|
'er_size_model': obj['er_size_model'],
|
||||||
'min_clamping_diameter': obj['min_clamping_diameter'],
|
'min_clamping_diameter': obj['min_clamping_diameter'],
|
||||||
|
|||||||
134
sf_base/views/tool_basic_param.xml
Normal file
134
sf_base/views/tool_basic_param.xml
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<!-- ================================================刀具基础参数================================================ -->
|
||||||
|
<record id="view_sf_tool_materials_basic_parameters_integral_tree" model="ir.ui.view">
|
||||||
|
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||||
|
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="基础参数" delete="0" create="0" edit="0" sample="1">
|
||||||
|
<field name="total_length" />
|
||||||
|
<field name="blade_number" />
|
||||||
|
<field name="neck_diameter"/>
|
||||||
|
<field name="neck_length"/>
|
||||||
|
<field name="handle_diameter" />
|
||||||
|
<field name="handle_length" />
|
||||||
|
<field name="blade_tip_diameter"/>
|
||||||
|
<field name="blade_tip_working_size"/>
|
||||||
|
<field name="blade_tip_taper" />
|
||||||
|
<field name="blade_diameter" />
|
||||||
|
<field name="blade_length"/>
|
||||||
|
<field name="blade_helix_angle"/>
|
||||||
|
<field name="blade_width" />
|
||||||
|
<field name="blade_width" />
|
||||||
|
<field name="pitch"/>
|
||||||
|
<field name="cutting_depth"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_sf_tool_materials_basic_parameters_blade_tree" model="ir.ui.view">
|
||||||
|
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||||
|
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="基础参数" delete="0" create="0">
|
||||||
|
<field name="total_length" />
|
||||||
|
<field name="length" />
|
||||||
|
<field name="thickness"/>
|
||||||
|
<field name="width"/>
|
||||||
|
<field name="cutting_blade_length" />
|
||||||
|
<field name="relief_angle" />
|
||||||
|
<field name="blade_tip_circular_arc_radius"/>
|
||||||
|
<field name="inscribed_circle_diameter"/>
|
||||||
|
<field name="install_aperture_diameter" />
|
||||||
|
<field name="chip_breaker_groove" />
|
||||||
|
<field name="blade_teeth_model"/>
|
||||||
|
<field name="blade_blade_number"/>
|
||||||
|
<field name="main_included_angle" />
|
||||||
|
<field name="top_angle" />
|
||||||
|
<field name="blade_tip_dip_angle"/>
|
||||||
|
<field name="side_cutting_edge_angle"/>
|
||||||
|
<field name="thread_model"/>
|
||||||
|
<field name="thread_num" />
|
||||||
|
<field name="blade_tip_height_tolerance" />
|
||||||
|
<field name="inscribed_circle_tolerance"/>
|
||||||
|
<field name="thickness_tolerance"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_sf_tool_materials_basic_parameters_cutter_bar_tree" model="ir.ui.view">
|
||||||
|
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||||
|
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="基础参数" delete="0" create="0">
|
||||||
|
<field name="total_length" />
|
||||||
|
<field name="height" />
|
||||||
|
<field name="blade_height"/>
|
||||||
|
<field name="cut_depth_max"/>
|
||||||
|
<field name="cutter_arbor_diameter" />
|
||||||
|
<field name="min_machining_aperture" />
|
||||||
|
<field name="install_blade_tip_num"/>
|
||||||
|
<field name="cutting_blade_model"/>
|
||||||
|
<field name="cooling_hole" />
|
||||||
|
<field name="locating_slot_code" />
|
||||||
|
<field name="installing_structure"/>
|
||||||
|
<field name="blade_ids"/>
|
||||||
|
<field name="tool_shim" />
|
||||||
|
<field name="cotter_pin" />
|
||||||
|
<field name="pressing_plate"/>
|
||||||
|
<field name="screw"/>
|
||||||
|
<field name="spanner" />
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_sf_tool_materials_basic_parameters_tree" model="ir.ui.view">
|
||||||
|
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||||
|
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="基础参数" delete="0" create="0">
|
||||||
|
<field name="total_length" />
|
||||||
|
<field name="blade_number" />
|
||||||
|
<field name="neck_diameter"/>
|
||||||
|
<field name="neck_length"/>
|
||||||
|
<field name="handle_diameter" />
|
||||||
|
<field name="handle_length" />
|
||||||
|
<field name="blade_tip_diameter"/>
|
||||||
|
<field name="blade_tip_working_size"/>
|
||||||
|
<field name="blade_tip_taper" />
|
||||||
|
<field name="blade_diameter" />
|
||||||
|
<field name="blade_length"/>
|
||||||
|
<field name="blade_helix_angle"/>
|
||||||
|
<field name="blade_width" />
|
||||||
|
<field name="blade_width" />
|
||||||
|
<field name="pitch"/>
|
||||||
|
<field name="cutting_depth"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_sf_tool_materials_basic_parameters_search">
|
||||||
|
<field name="name">sf.tool.materials.basic.parameters.search</field>
|
||||||
|
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<search>
|
||||||
|
<field name="name"/>
|
||||||
|
</search>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_sf_tool_materials_basic_parameters" model="ir.actions.act_window">
|
||||||
|
<field name="name">基础参数</field>
|
||||||
|
<field name="res_model">sf.tool.materials.basic.parameters</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
|
||||||
|
<!-- <field name="context">{'selection_mode': 'single'}</field>-->
|
||||||
|
<field name="domain">[]</field>
|
||||||
|
<!-- <field name="multi">false</field>-->
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -35,13 +35,6 @@
|
|||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="name" string="名称"/>
|
<field name="name" string="名称"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
<!-- <field name="mrs_cutting_tool_integral_model_ids" optional="hide"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_blade_model_ids" optional="hide"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterbar_model_ids" optional="hide"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterpad_model_ids" optional="hide"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterhandle_model_ids" optional="hide"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterhead_model_ids" optional="hide"/>-->
|
|
||||||
<!-- <field name="image" widget='image'/>-->
|
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -60,52 +53,9 @@
|
|||||||
<field name="mrs_cutting_tool_type_id"
|
<field name="mrs_cutting_tool_type_id"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||||
<field name="mrs_cutting_tool_model_id"
|
<field name="mrs_cutting_tool_model_id"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"
|
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||||
attrs="{'invisible': True}"/>
|
|
||||||
<!-- <field name="mrs_cutting_tool_integral_model_ids"-->
|
|
||||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
|
||||||
<!-- widget="many2many_tags"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_blade_model_ids"-->
|
|
||||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
|
||||||
<!-- widget="many2many_tags"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterbar_model_ids"-->
|
|
||||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
|
||||||
<!-- widget="many2many_tags"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterpad_model_ids"-->
|
|
||||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
|
||||||
<!-- widget="many2many_tags"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterhandle_model_ids"-->
|
|
||||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
|
||||||
<!-- widget="many2many_tags"/>-->
|
|
||||||
<!-- <field name="mrs_cutting_tool_cutterhead_model_ids"-->
|
|
||||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
|
||||||
<!-- widget="many2many_tags"/>-->
|
|
||||||
</group>
|
</group>
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="image" nolabel="1" widget="image"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
<!-- <group string='参数信息'>-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="diameter"/>-->
|
|
||||||
<!-- <field name="tool_grade"/>-->
|
|
||||||
<!-- <field name="machining_accuracy"/>-->
|
|
||||||
<!-- <field name="tool_length"/>-->
|
|
||||||
<!-- <field name="blade_number"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="integral_blade_length"/>-->
|
|
||||||
<!-- <field name="effective_blade_length"/>-->
|
|
||||||
<!-- <field name="max_life"/>-->
|
|
||||||
<!-- <field name="is_standard"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- <group string='其他信息'>-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="applicable_range"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
@@ -220,7 +170,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group string="适配刀片形状"
|
<group string="适配刀片形状"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
||||||
<field name="fit_blade_shape_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="fit_blade_shape_id" string="" widget="custom_many2many_checkboxes"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="适合加工方式"
|
<group string="适合加工方式"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
@@ -229,7 +179,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group string="刀尖特征"
|
<group string="刀尖特征"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
<field name="blade_tip_characteristics_ids" string=""
|
<field name="blade_tip_characteristics_id" string=""
|
||||||
widget="custom_many2many_checkboxes"/>
|
widget="custom_many2many_checkboxes"/>
|
||||||
</group>
|
</group>
|
||||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
@@ -558,5 +508,34 @@
|
|||||||
<field name="domain">[]</field>
|
<field name="domain">[]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- ================================================刀具基础参数================================================ -->
|
||||||
|
<!-- <record id="view_sf_tool_materials_basic_parameters_tree" model="ir.ui.view">-->
|
||||||
|
<!-- <field name="name">sf.tool.materials.basic.parameters.tree</field>-->
|
||||||
|
<!-- <field name="model">sf.tool.materials.basic.parameters</field>-->
|
||||||
|
<!-- <field name="arch" type="xml">-->
|
||||||
|
<!-- <tree string="基础参数" delete="0" create="0">-->
|
||||||
|
<!-- <field name="total_length" />-->
|
||||||
|
<!-- <field name="blade_number" />-->
|
||||||
|
<!-- <field name="neck_diameter"/>-->
|
||||||
|
<!-- <field name="neck_length"/>-->
|
||||||
|
<!-- <field name="handle_diameter" />-->
|
||||||
|
<!-- <field name="handle_length" />-->
|
||||||
|
<!-- <field name="blade_tip_diameter"/>-->
|
||||||
|
<!-- <field name="blade_tip_working_size"/>-->
|
||||||
|
<!-- <field name="blade_tip_taper" />-->
|
||||||
|
<!-- <field name="blade_diameter" />-->
|
||||||
|
<!-- <field name="blade_length"/>-->
|
||||||
|
<!-- <field name="blade_helix_angle"/>-->
|
||||||
|
<!-- <field name="blade_width" />-->
|
||||||
|
<!-- <field name="blade_width" />-->
|
||||||
|
<!-- <field name="pitch"/>-->
|
||||||
|
<!-- <field name="cutting_depth"/>-->
|
||||||
|
<!-- </tree>-->
|
||||||
|
<!-- </field>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -54,9 +54,13 @@
|
|||||||
<field name="cutting_tool_model_id" placeholder="请选择"
|
<field name="cutting_tool_model_id" placeholder="请选择"
|
||||||
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="specification_id" placeholder="请选择" class="diameter"
|
<!-- <lable for="specification_id" class="type_label">规格</lable>-->
|
||||||
|
<!-- <div class="button_width">-->
|
||||||
|
<field name="specification_id" placeholder="请选择"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||||
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
||||||
|
<!-- <button name="choice" type="object" class="oe_highlight">选择</button>-->
|
||||||
|
<!-- </div>-->
|
||||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
placeholder="请选择"/>
|
placeholder="请选择"/>
|
||||||
<!-- <field name="fixture_model_id" string="型号" placeholder="请选择"-->
|
<!-- <field name="fixture_model_id" string="型号" placeholder="请选择"-->
|
||||||
@@ -415,7 +419,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group string="适配刀片形状"
|
<group string="适配刀片形状"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
||||||
<field name="fit_blade_shape_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="fit_blade_shape_id" string="" widget="custom_many2many_checkboxes"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="适合加工方式"
|
<group string="适合加工方式"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
@@ -424,7 +428,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group string="刀尖特征"
|
<group string="刀尖特征"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
<field name="blade_tip_characteristics_ids" string=""
|
<field name="blade_tip_characteristics_id" string=""
|
||||||
widget="custom_many2many_checkboxes"/>
|
widget="custom_many2many_checkboxes"/>
|
||||||
</group>
|
</group>
|
||||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
@@ -445,7 +449,8 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="切削速度Vc">
|
<page string="切削速度Vc"
|
||||||
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||||
<field name="cutting_speed_ids" string="" widget="one2many">
|
<field name="cutting_speed_ids" string="" widget="one2many">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<!-- <field name="order"/>-->
|
<!-- <field name="order"/>-->
|
||||||
@@ -466,7 +471,8 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page string="每齿走刀量fz">
|
<page string="每齿走刀量fz"
|
||||||
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||||
<field name="feed_per_tooth_ids" string="" widget="one2many">
|
<field name="feed_per_tooth_ids" string="" widget="one2many">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="cutting_speed"
|
<field name="cutting_speed"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from odoo import models, fields, api
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
@@ -101,12 +101,12 @@ class ResProductMo(models.Model):
|
|||||||
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
|
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
|
||||||
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
|
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
|
||||||
cutting_tool_blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
|
cutting_tool_blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
|
||||||
fit_blade_shape_ids = fields.Many2many('maintenance.equipment.image', 'rel_fit_blade_shape_product_template',
|
fit_blade_shape_id = fields.Many2many('maintenance.equipment.image', 'rel_fit_blade_shape_product_template',
|
||||||
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
||||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||||
'rel_machining_product_template', '适合加工方式',
|
'rel_machining_product_template', '适合加工方式',
|
||||||
domain=[('type', '=', '加工能力')])
|
domain=[('type', '=', '加工能力')])
|
||||||
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
|
blade_tip_characteristics_id = fields.Many2many('maintenance.equipment.image',
|
||||||
'rel_blade_tip_product_template', '刀尖特征',
|
'rel_blade_tip_product_template', '刀尖特征',
|
||||||
domain=[('type', '=', '刀尖特征')])
|
domain=[('type', '=', '刀尖特征')])
|
||||||
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'rel_handle_product_template', '柄部类型',
|
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'rel_handle_product_template', '柄部类型',
|
||||||
@@ -116,52 +116,75 @@ class ResProductMo(models.Model):
|
|||||||
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
|
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
|
||||||
'适合冷却液', domain=[('type', '=', '冷却液')])
|
'适合冷却液', domain=[('type', '=', '冷却液')])
|
||||||
compaction_way_ids = fields.Many2many('maintenance.equipment.image', 'rel_compaction_product_template',
|
compaction_way_ids = fields.Many2many('maintenance.equipment.image', 'rel_compaction_product_template',
|
||||||
'压紧方式', domain=[('type', '=', '压紧方式')])\
|
'压紧方式', domain=[('type', '=', '压紧方式')]) \
|
||||||
|
|
||||||
|
|
||||||
# @api.onchange('cutting_tool_material_id')
|
|
||||||
# def _onchange_cutting_tool_material_id(self):
|
|
||||||
# for item in self:
|
|
||||||
# if item.cutting_tool_material_id.id != item.cutting_tool_model_id.cutting_tool_material_id.id:
|
|
||||||
# item.cutting_tool_model_id = False
|
|
||||||
# item.specification_id = False
|
|
||||||
# item.cutting_tool_type_id = False
|
|
||||||
# item.brand_id = False
|
|
||||||
# item.tool_hardness = False
|
|
||||||
# item.cutting_tool_run_out_accuracy_max = False
|
|
||||||
# item.cutting_tool_run_out_accuracy_min = False
|
|
||||||
# item.materials_type_id = False
|
|
||||||
# item.cutting_tool_blade_type = False
|
|
||||||
# item.cutting_tool_total_length = False
|
|
||||||
# item.cutting_tool_shank_length = False
|
|
||||||
# item.cutting_tool_blade_length = False
|
|
||||||
# item.cutting_tool_blade_number = False
|
|
||||||
# item.cutting_tool_neck_length = False
|
|
||||||
# item.cutting_tool_neck_diameter = False
|
|
||||||
# item.cutting_tool_shank_diameter = False
|
|
||||||
# item.cutting_tool_blade_tip_diameter = False
|
|
||||||
# item.cutting_tool_blade_tip_taper = False
|
|
||||||
# item.cutting_tool_blade_helix_angle = False
|
|
||||||
# item.cutting_tool_blade_type = False
|
|
||||||
# item.cutting_tool_pitch = False
|
|
||||||
# item.cutting_tool_blade_width = False
|
|
||||||
# item.cutting_tool_blade_depth = False
|
|
||||||
# item.cutting_tool_cut_depth = False
|
|
||||||
# item.cutting_tool_coarse_medium_fine = False
|
|
||||||
# item.cutting_tool_run_out_accuracy_max = False
|
|
||||||
# item.cutting_tool_run_out_accuracy_min = False
|
|
||||||
# item.cutting_tool_blade_tip_working_size = False
|
|
||||||
# item.fit_blade_shape_ids = False
|
|
||||||
# item.suitable_machining_method_ids = False
|
|
||||||
# item.blade_tip_characteristics_ids = False
|
|
||||||
# item.handle_type_ids = False
|
|
||||||
# item.cutting_direction_ids = False
|
|
||||||
# item.suitable_coolant_ids = False
|
|
||||||
# item.compaction_way_ids = False
|
|
||||||
# item.cutting_speed_ids = False
|
|
||||||
# item.feed_per_tooth_ids = False
|
|
||||||
|
|
||||||
|
@api.onchange('cutting_tool_material_id')
|
||||||
|
def _onchange_cutting_tool_material_id(self):
|
||||||
|
for item in self:
|
||||||
|
if item.cutting_tool_material_id.id != item.cutting_tool_model_id.cutting_tool_material_id.id:
|
||||||
|
item.cutting_tool_model_id = False
|
||||||
|
item.specification_id = False
|
||||||
|
item.cutting_tool_type_id = False
|
||||||
|
item.brand_id = False
|
||||||
|
item.tool_hardness = False
|
||||||
|
item.cutting_tool_run_out_accuracy_max = False
|
||||||
|
item.cutting_tool_run_out_accuracy_min = False
|
||||||
|
item.materials_type_id = False
|
||||||
|
item.cutting_tool_blade_type = False
|
||||||
|
item.cutting_tool_total_length = False
|
||||||
|
item.cutting_tool_clamping_way = False
|
||||||
|
item.cutting_tool_blade_diameter = False
|
||||||
|
item.cutting_tool_shank_length = False
|
||||||
|
item.cutting_tool_blade_length = False
|
||||||
|
item.cutting_tool_blade_number = False
|
||||||
|
item.cutting_tool_neck_length = False
|
||||||
|
item.cutting_tool_neck_diameter = False
|
||||||
|
item.cutting_tool_shank_diameter = False
|
||||||
|
item.cutting_tool_blade_tip_diameter = False
|
||||||
|
item.cutting_tool_blade_tip_taper = False
|
||||||
|
item.cutting_tool_blade_helix_angle = False
|
||||||
|
item.cutting_tool_blade_type = False
|
||||||
|
item.cutting_tool_pitch = False
|
||||||
|
item.cutting_tool_blade_width = False
|
||||||
|
item.cutting_tool_blade_depth = False
|
||||||
|
item.cutting_tool_cut_depth = False
|
||||||
|
item.cutting_tool_coarse_medium_fine = False
|
||||||
|
item.cutting_tool_run_out_accuracy_max = False
|
||||||
|
item.cutting_tool_run_out_accuracy_min = False
|
||||||
|
item.cutting_tool_blade_tip_working_size = False
|
||||||
|
item.fit_blade_shape_id = False
|
||||||
|
item.suitable_machining_method_ids = False
|
||||||
|
item.blade_tip_characteristics_id = False
|
||||||
|
item.handle_type_ids = False
|
||||||
|
item.cutting_direction_ids = False
|
||||||
|
item.suitable_coolant_ids = False
|
||||||
|
item.compaction_way_ids = False
|
||||||
|
item.cutting_speed_ids = False
|
||||||
|
item.feed_per_tooth_ids = False
|
||||||
|
|
||||||
|
# def choice(self):
|
||||||
|
# if self.cutting_tool_type == '整体式刀具':
|
||||||
|
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_integral_tree')
|
||||||
|
# elif self.cutting_tool_type == '刀片':
|
||||||
|
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_blade_tree')
|
||||||
|
# elif self.cutting_tool_type == '刀杆':
|
||||||
|
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_cutter_bar_tree')
|
||||||
|
# elif self.cutting_tool_type == '刀盘':
|
||||||
|
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_tree')
|
||||||
|
# elif self.cutting_tool_type == '刀柄':
|
||||||
|
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_tree')
|
||||||
|
# else :
|
||||||
|
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_tree')
|
||||||
|
# return {
|
||||||
|
# 'name': _('规格'),
|
||||||
|
# 'view_mode': 'list',
|
||||||
|
# 'view_id': tree_view.id,
|
||||||
|
# 'type': 'ir.actions.act_window',
|
||||||
|
# 'res_model': 'sf.tool.materials.basic.parameters',
|
||||||
|
# 'target': 'new',
|
||||||
|
# 'domain': [('cutting_tool_type', '=', self.cutting_tool_type),
|
||||||
|
# ('standard_library_id', '=', self.cutting_tool_model_id.id)],
|
||||||
|
# }
|
||||||
|
|
||||||
@api.onchange('specification_id')
|
@api.onchange('specification_id')
|
||||||
def _onchange_specification(self):
|
def _onchange_specification(self):
|
||||||
@@ -189,30 +212,30 @@ class ResProductMo(models.Model):
|
|||||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||||
self.cutting_tool_blade_depth = self.specification_id.blade_depth
|
self.cutting_tool_blade_depth = self.specification_id.blade_depth
|
||||||
self.cutting_tool_cut_depth = self.specification_id.cutting_depth
|
self.cutting_tool_cut_depth = self.specification_id.cutting_depth
|
||||||
elif self.cutting_tool_type == '刀杆1':
|
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||||
self.cutting_tool_total_length = self.specification_id.total_length
|
self.feed_per_tooth_ids = [(0, 0, {'product_template_id': product_template.id,
|
||||||
self.tool_height = self.specification_id.height
|
'cutting_speed': product_template.cutting_speed,
|
||||||
self.tool_width = self.specification_id.width
|
'machining_method': product_template.machining_method,
|
||||||
self.cutting_tool_knife_head_length = self.specification_id.cutting_blade_length
|
'blade_diameter': product_template.blade_diameter,
|
||||||
self.cutting_tool_knife_head_width = self.specification_id.blade_tip_circular_arc_radius
|
'materials_type_id': product_template.materials_type_id.id}) for
|
||||||
self.cutting_tool_knife_head_height = self.cutting_tool_model_id.blade_tip_height_tolerance
|
product_template in
|
||||||
self.cutting_tool_blade_diameter = self.specification_id.inscribed_circle_diameter
|
self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
||||||
self.cutting_tool_cutter_arbor_diameter = self.specification_id.cutter_arbor_diameter
|
lambda r: r.blade_diameter == self.specification_id.blade_diameter)]
|
||||||
self.cutting_tool_cut_blade_length = self.specification_id.install_aperture_diameter
|
elif self.cutting_tool_type == '夹头':
|
||||||
self.cutting_tool_cut_depth_max = self.specification_id.cut_depth_max
|
self.cutting_tool_clamping_length = self.specification_id.clamping_length
|
||||||
self.cutting_tool_min_machining_aperture = self.specification_id.min_machining_aperture
|
self.cutting_tool_clamping_tolerance = self.specification_id.clamping_tolerance
|
||||||
self.cutting_tool_install_blade_tip_num = self.specification_id.install_blade_tip_num
|
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
|
||||||
self.cutting_tool_main_included_angle = self.specification_id.main_included_angle
|
self.cutting_tool_clamping_diameter_min = self.specification_id.max_clamping_diameter
|
||||||
self.cutting_tool_rear_angle = self.specification_id.main_included_angle
|
self.cutting_tool_clamping_way = self.specification_id.clamping_mode
|
||||||
self.cutting_tool_installing_structure = self.specification_id.installing_structure
|
self.cutting_tool_top_diameter = self.cutting_tool_model_id.top_diameter
|
||||||
self.cutting_tool_cooling_hole = self.specification_id.cooling_hole
|
self.cutting_tool_outer_diameter = self.specification_id.outer_diameter
|
||||||
self.cutting_tool_locating_slot_code = self.specification_id.locating_slot_code
|
self.cutting_tool_inner_diameter = self.specification_id.inner_diameter
|
||||||
self.cutting_tool_blade_ids = self.cutting_tool_model_id.blade_ids
|
self.tool_weight = self.specification_id.weight
|
||||||
self.cutting_tool_tool_shim = self.specification_id.tool_shim
|
self.cutting_tool_jump_accuracy = self.specification_id.run_out_accuracy
|
||||||
self.cutting_tool_cotter_pin = self.specification_id.cotter_pin
|
self.cutting_tool_max_load_capacity = self.specification_id.max_load_capacity
|
||||||
self.cutting_tool_pressing_plate = self.specification_id.pressing_plate
|
self.cutting_tool_er_size_model = self.specification_id.er_size_model
|
||||||
self.cutting_tool_screw = self.specification_id.screw
|
self.cutting_tool_handle_ids = self.cutting_tool_model_id.handle_ids
|
||||||
self.cutting_tool_wrench = self.specification_id.wrench
|
self.cooling_suit_type_ids = self.specification_id.cooling_jacket
|
||||||
elif self.cutting_tool_type == '刀片':
|
elif self.cutting_tool_type == '刀片':
|
||||||
self.cutting_tool_total_length = self.specification_id.total_length
|
self.cutting_tool_total_length = self.specification_id.total_length
|
||||||
self.tool_length = self.specification_id.length
|
self.tool_length = self.specification_id.length
|
||||||
@@ -220,7 +243,7 @@ class ResProductMo(models.Model):
|
|||||||
self.tool_width = self.specification_id.width
|
self.tool_width = self.specification_id.width
|
||||||
self.cutting_tool_cut_blade_length = self.specification_id.cutting_blade_length
|
self.cutting_tool_cut_blade_length = self.specification_id.cutting_blade_length
|
||||||
self.cutting_tool_blade_tip_circular_arc_radius = self.specification_id.blade_tip_circular_arc_radius
|
self.cutting_tool_blade_tip_circular_arc_radius = self.specification_id.blade_tip_circular_arc_radius
|
||||||
self.cutting_tool_blade_tip_height_tolerance = self.cutting_tool_model_id.blade_tip_height_tolerance
|
self.cutting_tool_blade_tip_height_tolerance = self.specification_id.blade_tip_height_tolerance
|
||||||
self.cutting_tool_inscribed_circle_diameter = self.specification_id.inscribed_circle_diameter
|
self.cutting_tool_inscribed_circle_diameter = self.specification_id.inscribed_circle_diameter
|
||||||
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
||||||
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
||||||
@@ -233,21 +256,23 @@ class ResProductMo(models.Model):
|
|||||||
self.cutting_tool_top_angle = self.specification_id.top_angle
|
self.cutting_tool_top_angle = self.specification_id.top_angle
|
||||||
self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle
|
self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle
|
||||||
self.cutting_tool_side_cutting_edge_angle = self.specification_id.side_cutting_edge_angle
|
self.cutting_tool_side_cutting_edge_angle = self.specification_id.side_cutting_edge_angle
|
||||||
self.cutting_tool_pitch = self.cutting_tool_model_id.pitch
|
self.cutting_tool_pitch = self.specification_id.pitch
|
||||||
self.cutting_tool_bladed_teeth_model = self.specification_id.blade_teeth_model
|
self.cutting_tool_bladed_teeth_model = self.specification_id.blade_teeth_model
|
||||||
self.cutting_tool_thickness_tolerance = self.specification_id.thickness_tolerance
|
self.cutting_tool_thickness_tolerance = self.specification_id.thickness_tolerance
|
||||||
self.cutting_tool_thread_model = self.specification_id.thread_model
|
self.cutting_tool_thread_model = self.specification_id.thread_model
|
||||||
self.cutting_tool_thread_num = self.specification_id.thread_num
|
self.cutting_tool_thread_num = self.specification_id.thread_num
|
||||||
self.cutting_tool_cutter_bar_ids = self.cutting_tool_model_id.cutting_tool_cutter_bar_ids.ids
|
self.cutting_tool_cutter_bar_ids = self.cutting_tool_model_id.cutter_bar_ids.ids
|
||||||
self.cutting_tool_cutter_pad_ids = self.cutting_tool_model_id.cutting_tool_cutter_pad_ids.ids
|
self.cutting_tool_cutter_pad_ids = self.cutting_tool_model_id.cutter_pad_ids.ids
|
||||||
elif self.cutting_tool_type in ('刀盘','刀杆'):
|
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||||
|
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids
|
||||||
|
elif self.cutting_tool_type in ('刀盘', '刀杆'):
|
||||||
self.cutting_tool_total_length = self.specification_id.total_length
|
self.cutting_tool_total_length = self.specification_id.total_length
|
||||||
self.tool_length = self.specification_id.length
|
self.tool_length = self.specification_id.length
|
||||||
self.tool_thickness = self.specification_id.thickness
|
self.tool_thickness = self.specification_id.thickness
|
||||||
self.tool_width = self.specification_id.width
|
self.tool_width = self.specification_id.width
|
||||||
self.cutting_tool_cut_blade_length = self.specification_id.cutting_blade_length
|
self.cutting_tool_cut_blade_length = self.specification_id.cutting_blade_length
|
||||||
self.cutting_tool_blade_tip_circular_arc_radius = self.specification_id.blade_tip_circular_arc_radius
|
self.cutting_tool_blade_tip_circular_arc_radius = self.specification_id.blade_tip_circular_arc_radius
|
||||||
self.cutting_tool_blade_tip_height_tolerance = self.cutting_tool_model_id.blade_tip_height_tolerance
|
self.cutting_tool_blade_tip_height_tolerance = self.specification_id.blade_tip_height_tolerance
|
||||||
self.cutting_tool_inscribed_circle_diameter = self.specification_id.inscribed_circle_diameter
|
self.cutting_tool_inscribed_circle_diameter = self.specification_id.inscribed_circle_diameter
|
||||||
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
||||||
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
||||||
@@ -274,14 +299,12 @@ class ResProductMo(models.Model):
|
|||||||
self.cutting_tool_flange_length = self.specification_id.flange_shank_length
|
self.cutting_tool_flange_length = self.specification_id.flange_shank_length
|
||||||
self.cutting_tool_shank_outer_diameter = self.specification_id.handle_external_diameter
|
self.cutting_tool_shank_outer_diameter = self.specification_id.handle_external_diameter
|
||||||
self.cutting_tool_shank_inner_diameter = self.specification_id.handle_inside_diameter
|
self.cutting_tool_shank_inner_diameter = self.specification_id.handle_inside_diameter
|
||||||
|
|
||||||
|
|
||||||
self.suitable_machining_method_ids = [(6, 0,
|
self.suitable_machining_method_ids = [(6, 0,
|
||||||
[])] if not self.cutting_tool_model_id.suitable_machining_method_ids else [
|
[])] if not self.cutting_tool_model_id.suitable_machining_method_ids else [
|
||||||
(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
||||||
self.blade_tip_characteristics_ids = [(6, 0,
|
self.blade_tip_characteristics_id = [(6, 0,
|
||||||
[])] if not self.cutting_tool_model_id.blade_tip_characteristics_ids else [
|
[])] if not self.cutting_tool_model_id.blade_tip_characteristics_id else [
|
||||||
(6, 0, self.cutting_tool_model_id.blade_tip_characteristics_ids.ids)]
|
(6, 0, self.cutting_tool_model_id.blade_tip_characteristics_id.ids)]
|
||||||
|
|
||||||
self.handle_type_ids = [(6, 0,
|
self.handle_type_ids = [(6, 0,
|
||||||
[])] if not self.cutting_tool_model_id.handle_type_ids else [
|
[])] if not self.cutting_tool_model_id.handle_type_ids else [
|
||||||
@@ -297,17 +320,6 @@ class ResProductMo(models.Model):
|
|||||||
self.compaction_way_ids = [(6, 0,
|
self.compaction_way_ids = [(6, 0,
|
||||||
[])] if not self.cutting_tool_model_id.compaction_way_ids else [
|
[])] if not self.cutting_tool_model_id.compaction_way_ids else [
|
||||||
(6, 0, self.cutting_tool_model_id.compaction_way_ids.ids)]
|
(6, 0, self.cutting_tool_model_id.compaction_way_ids.ids)]
|
||||||
if self.cutting_tool_type == '整体式刀具':
|
|
||||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
|
||||||
self.feed_per_tooth_ids = [(0, 0, {'product_template_id': product_template.id,
|
|
||||||
'cutting_speed': product_template.cutting_speed,
|
|
||||||
'machining_method': product_template.machining_method,
|
|
||||||
'blade_diameter': product_template.blade_diameter,
|
|
||||||
'materials_type_id': product_template.materials_type_id.id}) for
|
|
||||||
product_template in
|
|
||||||
self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
|
||||||
lambda r: r.blade_diameter == self.specification_id.blade_diameter)]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# @api.constrains('suitable_machining_method_ids')
|
# @api.constrains('suitable_machining_method_ids')
|
||||||
@@ -413,7 +425,7 @@ class ResProductMo(models.Model):
|
|||||||
cutting_tool_inscribed_circle_diameter = fields.Char('内接圆直径(mm)', size=20)
|
cutting_tool_inscribed_circle_diameter = fields.Char('内接圆直径(mm)', size=20)
|
||||||
cutting_tool_install_aperture_diameter = fields.Char('安装孔直径(mm)', size=20)
|
cutting_tool_install_aperture_diameter = fields.Char('安装孔直径(mm)', size=20)
|
||||||
cutting_tool_chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
cutting_tool_chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
||||||
string='有无断屑槽')
|
string='有无断屑槽')
|
||||||
cutting_tool_bladed_teeth_model = fields.Selection(
|
cutting_tool_bladed_teeth_model = fields.Selection(
|
||||||
[('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'),
|
[('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'),
|
||||||
('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'),
|
('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'),
|
||||||
@@ -427,7 +439,8 @@ class ResProductMo(models.Model):
|
|||||||
|
|
||||||
cutting_tool_blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
cutting_tool_blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
||||||
cutting_tool_side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
cutting_tool_side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
||||||
cutting_tool_thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型')
|
cutting_tool_thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')],
|
||||||
|
string='螺纹类型')
|
||||||
cutting_tool_thread_num = fields.Char('每英寸螺纹数(tpi)', size=20)
|
cutting_tool_thread_num = fields.Char('每英寸螺纹数(tpi)', size=20)
|
||||||
cutting_tool_blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
cutting_tool_blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
||||||
cutting_tool_inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
cutting_tool_inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
||||||
@@ -516,7 +529,6 @@ class ResProductMo(models.Model):
|
|||||||
string='适用刀柄型号'
|
string='适用刀柄型号'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# 夹具参数
|
# 夹具参数
|
||||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
|
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
|
||||||
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
|
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
|
||||||
@@ -645,7 +657,6 @@ class ResProductMo(models.Model):
|
|||||||
self.detailed_type = 'product'
|
self.detailed_type = 'product'
|
||||||
self.sale_ok = False
|
self.sale_ok = False
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('fixture_material_id')
|
@api.onchange('fixture_material_id')
|
||||||
def _onchange_fixture_material_id(self):
|
def _onchange_fixture_material_id(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
@@ -682,16 +693,6 @@ class ResProductMo(models.Model):
|
|||||||
item.fixture_apply_machine_tool_type_ids = self._get_ids(
|
item.fixture_apply_machine_tool_type_ids = self._get_ids(
|
||||||
item.fixture_model_id.apply_machine_tool_type_ids)
|
item.fixture_model_id.apply_machine_tool_type_ids)
|
||||||
|
|
||||||
@api.onchange('cutting_tool_model_id')
|
|
||||||
def _onchange_cutting_tool_model_id(self):
|
|
||||||
if self.cutting_tool_model_id:
|
|
||||||
if self.cutting_tool_type == '刀片':
|
|
||||||
self.env['sf.tool.materials.basic.parameters'].search([('standard_library_id',=)])
|
|
||||||
self.specification_id = self.cutting_tool_model_id.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_volume_uom_id_from_ir_config_parameter(self):
|
def _get_volume_uom_id_from_ir_config_parameter(self):
|
||||||
product_length_in_feet_param = self.env['ir.config_parameter'].sudo().get_param('product.volume_in_cubic_feet')
|
product_length_in_feet_param = self.env['ir.config_parameter'].sudo().get_param('product.volume_in_cubic_feet')
|
||||||
|
|||||||
@@ -1818,12 +1818,12 @@ class Cutting_tool_standard_library(models.Model):
|
|||||||
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
||||||
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
||||||
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
||||||
"fit_blade_shape_ids": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
"fit_blade_shape_id": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
||||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||||
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
||||||
item['suitable_machining_methods']),
|
item['suitable_machining_methods']),
|
||||||
"blade_tip_characteristics_ids": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
"blade_tip_characteristics_id": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
||||||
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
||||||
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
||||||
@@ -1864,12 +1864,12 @@ class Cutting_tool_standard_library(models.Model):
|
|||||||
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
||||||
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
||||||
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
||||||
"fit_blade_shape_ids": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
"fit_blade_shape_id": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
||||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||||
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
||||||
item['suitable_machining_methods']),
|
item['suitable_machining_methods']),
|
||||||
"blade_tip_characteristics_ids": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
"blade_tip_characteristics_id": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
||||||
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
||||||
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
||||||
@@ -1979,12 +1979,12 @@ class Cutting_tool_standard_library(models.Model):
|
|||||||
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
||||||
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
||||||
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
||||||
"fit_blade_shape_ids": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
"fit_blade_shape_id": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
||||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||||
'suitable_machining_method') else self.env['maintenance.equipment.image']._get_ids(
|
'suitable_machining_method') else self.env['maintenance.equipment.image']._get_ids(
|
||||||
item['suitable_machining_method']),
|
item['suitable_machining_method']),
|
||||||
"blade_tip_characteristics_ids": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
"blade_tip_characteristics_id": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
||||||
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
||||||
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
||||||
@@ -2025,12 +2025,12 @@ class Cutting_tool_standard_library(models.Model):
|
|||||||
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_bar_codes']),
|
||||||
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
"cutter_pad_ids": [(6, 0, [])] if not item.get('cutter_pad_codes') else self.env[
|
||||||
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
'sf.cutting.tool.type']._get_ids(item['cutter_pad_codes']),
|
||||||
"fit_blade_shape_ids": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
"fit_blade_shape_id": [(6, 0, [])] if not item.get('fit_blade_shape') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
'maintenance.equipment.image']._get_ids(item['fit_blade_shape']),
|
||||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||||
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
||||||
item['suitable_machining_methods']),
|
item['suitable_machining_methods']),
|
||||||
"blade_tip_characteristics_ids": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
"blade_tip_characteristics_id": [(6, 0, [])] if not item.get('blade_tip_characteristics') else
|
||||||
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
self.env['maintenance.equipment.image']._get_ids(item['blade_tip_characteristics']),
|
||||||
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
"handle_type_ids": [(6, 0, [])] if not item.get('handle_type') else self.env[
|
||||||
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
'maintenance.equipment.image']._get_ids(item['handle_type']),
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
domain=[('type', '=', '加工能力')],
|
domain=[('type', '=', '加工能力')],
|
||||||
related='cutting_tool_integral_model_id.suitable_machining_method_ids')
|
related='cutting_tool_integral_model_id.suitable_machining_method_ids')
|
||||||
|
|
||||||
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
|
blade_tip_characteristics_id = fields.Many2many('maintenance.equipment.image',
|
||||||
'rel_blade_tip_product_template_tool_entity', '刀尖特征',
|
'rel_blade_tip_product_template_tool_entity', '刀尖特征',
|
||||||
domain=[('type', '=', '刀尖特征')],
|
domain=[('type', '=', '刀尖特征')],
|
||||||
related='cutting_tool_integral_model_id.blade_tip_characteristics_ids')
|
related='cutting_tool_integral_model_id.blade_tip_characteristics_id')
|
||||||
|
|
||||||
handle_type_ids = fields.Many2many('maintenance.equipment.image',
|
handle_type_ids = fields.Many2many('maintenance.equipment.image',
|
||||||
'rel_handle_product_template_tool_entity', '柄部类型',
|
'rel_handle_product_template_tool_entity', '柄部类型',
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class SfToolMaterialSearch(models.Model):
|
|||||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||||
'rel_machining_product_template_material_search', '适合加工方式',
|
'rel_machining_product_template_material_search', '适合加工方式',
|
||||||
domain=[('type', '=', '加工能力')])
|
domain=[('type', '=', '加工能力')])
|
||||||
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
|
blade_tip_characteristics_id = fields.Many2many('maintenance.equipment.image',
|
||||||
'rel_blade_tip_product_template_material_search', '刀尖特征',
|
'rel_blade_tip_product_template_material_search', '刀尖特征',
|
||||||
domain=[('type', '=', '刀尖特征')])
|
domain=[('type', '=', '刀尖特征')])
|
||||||
handle_type_ids = fields.Many2many('maintenance.equipment.image',
|
handle_type_ids = fields.Many2many('maintenance.equipment.image',
|
||||||
|
|||||||
@@ -100,8 +100,8 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group string="刀尖特征">
|
<group string="刀尖特征">
|
||||||
<field name="blade_tip_characteristics_ids" string="" widget="custom_many2many_checkboxes"
|
<field name="blade_tip_characteristics_id" string="" widget="custom_many2many_checkboxes"
|
||||||
domain="[('id','in',blade_tip_characteristics_ids)]"/>
|
domain="[('id','in',blade_tip_characteristics_id)]"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="柄部类型">
|
<group string="柄部类型">
|
||||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"
|
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"
|
||||||
|
|||||||
@@ -231,7 +231,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group string="刀尖特征">
|
<group string="刀尖特征">
|
||||||
<field name="blade_tip_characteristics_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="blade_tip_characteristics_id" string="" widget="custom_many2many_checkboxes"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="柄部类型">
|
<group string="柄部类型">
|
||||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user