Accept Merge Request #360: (feature/整体式刀具能力参数补充 -> develop)
Merge Request: 新增加工方式、刀尖特征、柄部类型、走刀方向、适合冷却液五个模型对象;刀具物料查询新增上述五个关联对象;对产品的整体式刀具物料能力参数进行补充。 Created By: @禹翔辉 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/360?initial=true
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
'views/common_view.xml',
|
||||
'views/fixture_view.xml',
|
||||
'views/functional_fixture_view.xml',
|
||||
'views/tool_other_features_view.xml',
|
||||
'views/menu_view.xml',
|
||||
"views/tool_views.xml",
|
||||
"views/tool_menu.xml",
|
||||
|
||||
@@ -3,6 +3,7 @@ from . import common
|
||||
from . import tool_base_new
|
||||
from . import fixture
|
||||
from . import functional_fixture
|
||||
from . import tool_other_features
|
||||
|
||||
|
||||
|
||||
|
||||
41
sf_base/models/tool_other_features.py
Normal file
41
sf_base/models/tool_other_features.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SuitableMachiningMethod(models.Model):
|
||||
_name = 'sf.suitable.machining.method'
|
||||
_description = '适合加工方式'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class BladeTipCharacteristics(models.Model):
|
||||
_name = 'sf.blade.tip.characteristics'
|
||||
_description = '刀尖特征'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class HandleType(models.Model):
|
||||
_name = 'sf.handle.type'
|
||||
_description = '柄部类型'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class CuttingDirection(models.Model):
|
||||
_name = 'sf.cutting.direction'
|
||||
_description = '走刀方向'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class SuitableCoolant(models.Model):
|
||||
_name = 'sf.suitable.coolant'
|
||||
_description = '适合冷却液'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
@@ -24,6 +24,11 @@ access_sf_fixture_model,sf_fixture_model,model_sf_fixture_model,base.group_user,
|
||||
access_sf_functional_fixture_type,sf_functional_fixture_type,model_sf_functional_fixture_type,base.group_user,1,1,1,1
|
||||
access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,base.group_user,1,1,1,1
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1,1
|
||||
access_sf_suitable_machining_method,sf_suitable_machining_method,model_sf_suitable_machining_method,base.group_user,1,1,1,1
|
||||
access_sf_blade_tip_characteristics,sf_blade_tip_characteristics,model_sf_blade_tip_characteristics,base.group_user,1,1,1,1
|
||||
access_sf_handle_type,sf_handle_type,model_sf_handle_type,base.group_user,1,1,1,1
|
||||
access_sf_cutting_direction,sf_cutting_direction,model_sf_cutting_direction,base.group_user,1,1,1,1
|
||||
access_sf_suitable_coolant,sf_suitable_coolant,model_sf_suitable_coolant,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
101
sf_base/views/tool_other_features_view.xml
Normal file
101
sf_base/views/tool_other_features_view.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<!-- ======================================== 适合加工方式========================================-->
|
||||
<record model="ir.ui.view" id="sf_suitable_machining_method_tree">
|
||||
<field name="name">适合加工方式</field>
|
||||
<field name="model">sf.suitable.machining.method</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_suitable_machining_method_act" model="ir.actions.act_window">
|
||||
<field name="name">适合加工方式</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.suitable.machining.method</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 刀尖特征========================================-->
|
||||
<record model="ir.ui.view" id="sf_blade_tip_characteristics_tree">
|
||||
<field name="name">刀尖特征</field>
|
||||
<field name="model">sf.blade.tip.characteristics</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_blade_tip_characteristics_act" model="ir.actions.act_window">
|
||||
<field name="name">刀尖特征</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.blade.tip.characteristics</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 柄部类型========================================-->
|
||||
<record model="ir.ui.view" id="sf_handle_type_tree">
|
||||
<field name="name">柄部类型</field>
|
||||
<field name="model">sf.handle.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_handle_type_act" model="ir.actions.act_window">
|
||||
<field name="name">柄部类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.handle.type</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 走刀方向========================================-->
|
||||
<record model="ir.ui.view" id="sf_cutting_direction_tree">
|
||||
<field name="name">走刀方向</field>
|
||||
<field name="model">sf.cutting.direction</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_cutting_direction_act" model="ir.actions.act_window">
|
||||
<field name="name">走刀方向</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting.direction</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 适合冷却液========================================-->
|
||||
<record model="ir.ui.view" id="sf_suitable_coolant_tree">
|
||||
<field name="name">适合冷却液</field>
|
||||
<field name="model">sf.suitable.coolant</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_suitable_coolant_act" model="ir.actions.act_window">
|
||||
<field name="name">适合冷却液</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.suitable.coolant</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -83,18 +83,77 @@
|
||||
</xpath>
|
||||
<xpath expr="//page[last()-1]" position="after">
|
||||
<page string="刀具物料参数" attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<!--整体式刀具-->
|
||||
<group attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<group>
|
||||
<field name="brand_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_type_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_code" invisible="True"/>
|
||||
<field name="integral_total_length" string="总长度(mm)"/>
|
||||
<field name="integral_shank_length" string="柄部长度(mm)"/>
|
||||
<field name="integral_blade_length" string="刃部长度(mm)"/>
|
||||
<field name="integral_neck_length" string="颈部长度(mm)"/>
|
||||
<field name="integral_blade_tip_taper" string="刀尖锥度(°)"/>
|
||||
<field name="integral_blade_helix_angle" string="刃部螺旋角(°)"/>
|
||||
<field name="integral_blade_type" string="刃部类型"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="integral_blade_number" string="刃数(个)"/>
|
||||
<field name="integral_shank_diameter" string="柄部直径(mm)"/>
|
||||
<field name="integral_blade_diameter" string="刃部直径(mm)"/>
|
||||
<field name="integral_neck_diameter" string="颈部直径(mm)"/>
|
||||
<field name="integral_blade_tip_diameter" string="刀尖直径(mm)"/>
|
||||
<field name="integral_hardness" string="刀具硬度(HRC)"/>
|
||||
<field name="integral_coarse_medium_fine" string="粗/中/精" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<field name="integral_coating_material" string="涂层材质"/>
|
||||
<field name="integral_blade_material" string="刀具材质" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度:"/>
|
||||
<div class="test_model">
|
||||
<label for="integral_run_out_accuracy_min" string="最小(min)"/>
|
||||
<field name="integral_run_out_accuracy_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="integral_run_out_accuracy_max" string="最大(max)"/>
|
||||
<field name="integral_run_out_accuracy_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适合加工方式(多选)" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<field name="suitable_machining_method_ids" string=""/>
|
||||
</group>
|
||||
<group string="刀尖特征(单选)" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<field name="blade_tip_characteristics_ids" string=""/>
|
||||
</group>
|
||||
<group string="柄部类型(单选)" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<field name="handle_type_ids" string=""/>
|
||||
</group>
|
||||
<group string="走刀方向(多选)" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<field name="cutting_direction_ids" string=""/>
|
||||
</group>
|
||||
<group string="适合冷却液(多选)" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<field name="suitable_coolant_ids" string=""/>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<!--整体式刀具-->
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<field name="brand_id" options="{'no_create': True}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
||||
<field name="cutting_tool_type_id" options="{'no_create': True}"/>
|
||||
<field name="brand_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '整体式刀具')]}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_type_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀柄'))]}"/>
|
||||
<field name="cutting_tool_shank_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀柄'))]}"/>
|
||||
<!-- <field name="cutting_tool_shank_length"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>-->
|
||||
<!-- <field name="cutting_tool_blade_length"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>-->
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'/>
|
||||
@@ -111,11 +170,11 @@
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_number"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_diameter_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_flange_length"
|
||||
@@ -143,7 +202,7 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_chuck_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄','整体式刀具'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄'))]}"/>
|
||||
<field name="cutting_tool_handle_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头'))]}"/>
|
||||
@@ -152,24 +211,24 @@
|
||||
<field name="cutting_tool_jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_front_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_working_hardness"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄', '整体式刀具'))]}"/>
|
||||
<field name="cutting_tool_working_hardness" attrs="{'invisible': [('cutting_tool_type', '=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄','刀杆','刀盘' ))]}"/>
|
||||
<field name="cutting_tool_screw"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
<field name="cutting_tool_nut"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
@@ -94,6 +94,48 @@ class SfToolMaterialSearch(models.Model):
|
||||
integral_run_out_accuracy_max = fields.Float('整体式刀具端跳精度max', digits=(6,1))
|
||||
integral_run_out_accuracy_min = fields.Float('整体式刀具端跳精度min', digits=(6, 1))
|
||||
|
||||
suitable_machining_method_ids = fields.Many2many('sf.suitable.machining.method',
|
||||
'rel_suitable_machining_method', '适合加工方式')
|
||||
blade_tip_characteristics_ids = fields.Many2many('sf.blade.tip.characteristics',
|
||||
'rel_blade_tip_characteristics', '刀尖特征')
|
||||
handle_type_ids = fields.Many2many('sf.handle.type', 'rel_handle_type', '柄部类型')
|
||||
cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction', '走刀方向')
|
||||
suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant', '适合冷却液')
|
||||
|
||||
@api.constrains('suitable_machining_method_ids')
|
||||
def _check_suitable_machining_method_ids(self):
|
||||
for record in self:
|
||||
if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合加工方式不能为空!")
|
||||
|
||||
@api.constrains('blade_tip_characteristics_ids')
|
||||
def _check_blade_tip_characteristics_ids(self):
|
||||
for record in self:
|
||||
if len(record.blade_tip_characteristics_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征不能为空!")
|
||||
if len(record.blade_tip_characteristics_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征只能单选!")
|
||||
|
||||
@api.constrains('handle_type_ids')
|
||||
def _check_handle_type_ids(self):
|
||||
for record in self:
|
||||
if len(record.handle_type_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型不能为空!")
|
||||
if len(record.handle_type_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型只能单选!")
|
||||
|
||||
@api.constrains('cutting_direction_ids')
|
||||
def _check_cutting_direction_ids(self):
|
||||
for record in self:
|
||||
if len(record.cutting_direction_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("走刀方向不能为空!")
|
||||
|
||||
@api.constrains('suitable_coolant_ids')
|
||||
def _check_suitable_coolant_ids(self):
|
||||
for record in self:
|
||||
if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合冷却液不能为空!")
|
||||
|
||||
@api.constrains('integral_total_length')
|
||||
def _check_integral_total_length(self):
|
||||
if self.integral_total_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
|
||||
@@ -188,6 +188,7 @@
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<!-- -->
|
||||
<page string="整体式刀具信息" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<group>
|
||||
<group>
|
||||
@@ -223,6 +224,21 @@
|
||||
<field name="integral_coating_material" string="涂层材质"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""/>
|
||||
</group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string=""/>
|
||||
</group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string=""/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string=""/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀杆信息" attrs="{'invisible': [('cutting_tool_type','!=','刀杆')]}">
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user