新增按钮
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import cutting_tool_specification_wizard
|
||||
@@ -1,47 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Cutting_toolSpecificationWizard(models.TransientModel):
|
||||
_name = "sf.cutting_tool.specification.wizard"
|
||||
_description = u'刀具规格'
|
||||
|
||||
product_id = fields.Many2one('product.template', string='产品')
|
||||
cutting_tool_library_id = fields.Many2one('sf.cutting_tool.standard.library', '刀具标准库',related='product_id.cutting_tool_library_id')
|
||||
|
||||
# cutting_tool_library_id = fields.Many2one('sf.cutting_tool.standard.library', '刀具标准库')
|
||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
cutting_tool_type = fields.Char(related=cutting_tool_material_id.name)
|
||||
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', '刀具类型')
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌',related=cutting_tool_library_id.brand_id)
|
||||
integral_tool_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'specification_id', string='整体式刀具基本参数')
|
||||
blade_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'specification_id', string='刀片基本参数')
|
||||
cutter_bar_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'specification_id', string='刀杆基本参数')
|
||||
cutter_head_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'specification_id', string='刀盘基本参数')
|
||||
knife_handle_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'specification_id', string='刀柄基本参数')
|
||||
chuck_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'specification_id', string='夹头基本参数')
|
||||
cutting_speed_ids = fields.One2many('sf.cutting.speed', 'specification_id', string='切削速度Vc')
|
||||
feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
|
||||
domain=[('cutting_speed', '!=', False)])
|
||||
feed_per_tooth_ids_2 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
|
||||
domain=[('cutting_speed', '!=', False)])
|
||||
feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
|
||||
@api.depends('cutting_tool_library_id')
|
||||
def set_specification(self):
|
||||
for vals in self.cutting_tool_library_id.integral_tool_basic_parameters_ids:
|
||||
vals.write({'specification_id': self.id})
|
||||
@@ -1,266 +0,0 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="cutting_tool_specification_wizard_form_view">
|
||||
<field name="name">sf.cutting_tool.specification.wizard.form.view</field>
|
||||
<field name="model">sf.cutting_tool.specification.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀具规格">
|
||||
<group>
|
||||
<field name="cutting_tool_material_id" readonly="1"/>
|
||||
<field name="cutting_tool_type_id" readonly="1" string="刀具类型"/>
|
||||
<field name="cutting_tool_library_id" readonly="1" string="型号"/>
|
||||
<field name="brand_id" readonly="1"/>
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="基本参数">
|
||||
<field name="integral_tool_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<tree class="center">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_number" placeholder="请选择"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="neck_diameter" class="diameter"/>
|
||||
<field name="handle_diameter" class="diameter"/>
|
||||
<field name="handle_length"/>
|
||||
<field name="blade_tip_working_size" class="du"/>
|
||||
<field name="blade_tip_diameter" class="diameter"/>
|
||||
<field name="blade_tip_taper" class="du"/>
|
||||
<field name="blade_helix_angle" class="du"/>
|
||||
<field name="pitch"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_depth"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<field name="blade_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="length"/>
|
||||
<field name="thickness"/>
|
||||
<field name="width"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="blade_tip_circular_arc_radius"/>
|
||||
<field name="inscribed_circle_diameter" class="diameter"/>
|
||||
<field name="install_aperture_diameter" class="diameter"/>
|
||||
<field name="pitch"/>
|
||||
<field name="chip_breaker_groove" placeholder="请选择"/>
|
||||
<field name="blade_teeth_model" placeholder="请选择"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="blade_blade_number" string="刃数(个)"/>
|
||||
<field name="blade_width" string="刃宽(mm)"/>
|
||||
<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" placeholder="请选择"/>
|
||||
<field name="thread_num"/>
|
||||
<field name="blade_tip_height_tolerance"/>
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="cutter_bar_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_arbor_diameter" class="diameter"/>
|
||||
<field name="main_included_angle" class="du"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="min_machining_aperture" class="diameter"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="cooling_hole" placeholder="请选择"/>
|
||||
<field name="locating_slot_code"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="tool_shim"/>
|
||||
<field name="cotter_pin"/>
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<field name="cutter_head_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_head_diameter" class="diameter"/>
|
||||
<field name="interface_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_length"/>
|
||||
<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="screw"/>
|
||||
<field name="spanner"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="cooling_hole" placeholder="请选择"/>
|
||||
<field name="locating_slot_code"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<field name="knife_handle_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="total_length"/>
|
||||
<field name="flange_shank_length"/>
|
||||
<field name="handle_external_diameter" class="diameter"/>
|
||||
<field name="handle_inside_diameter" class="diameter"/>
|
||||
<field name="min_clamping_diameter" class="diameter"/>
|
||||
<field name="max_clamping_diameter" class="diameter"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="taper" class="du"/>
|
||||
<field name="tool_changing_time"/>
|
||||
<field name="standard_rotate_speed"/>
|
||||
<field name="max_rotate_speed"/>
|
||||
<field name="diameter_slip_accuracy"/>
|
||||
<field name="cooling_model"/>
|
||||
<field name="is_rough_machining" placeholder="请选择"/>
|
||||
<field name="is_finish_machining" placeholder="请选择"/>
|
||||
<field name="is_quick_cutting" placeholder="请选择"/>
|
||||
<field name="is_drill_hole" placeholder="请选择"/>
|
||||
<field name="is_safe_lock" placeholder="请选择"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="chuck_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="er_size_model"/>
|
||||
<field name="min_clamping_diameter" class="diameter" required="1"/>
|
||||
<field name="max_clamping_diameter" class="diameter"/>
|
||||
<field name="outer_diameter" class="diameter"/>
|
||||
<field name="inner_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="taper" class="du"/>
|
||||
<field name="run_out_accuracy"/>
|
||||
<field name="top_diameter" class="diameter"/>
|
||||
<field name="weight"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="clamping_length"/>
|
||||
<field name="clamping_tolerance"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="handle_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="cooling_jacket"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="切削速度Vc"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="cutting_speed_ids">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="execution_standard_id" placeholder="请选择" required="1"/>
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="material_code" readonly="1"/>
|
||||
<field name="material_id" placeholder="请选择"
|
||||
attrs="{'readonly': [('execution_standard_id', '=', False)], 'required': [('execution_standard_id', '!=', False)]}"/>
|
||||
<field name="material_grade" readonly="1"/>
|
||||
<field name="tensile_strength" readonly="1"/>
|
||||
<field name="hardness" readonly="1"/>
|
||||
<field name="slope_milling_angle" widget="du"/>
|
||||
<field name="cutting_speed_n1"/>
|
||||
<field name="cutting_speed_n2"/>
|
||||
<field name="cutting_speed_n3"/>
|
||||
<field name="cutting_speed_n4"/>
|
||||
<field name="cutting_speed_n5"/>
|
||||
<field name="rough_machining"/>
|
||||
<field name="precision_machining"/>
|
||||
<field name="application" placeholder="请选择" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="每齿走刀量fz"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="feed_per_tooth_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具'))]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="cutting_speed"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="feed_per_tooth_ids_2"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具'))]}">
|
||||
<tree editable="bottom" class="center" create="0" delete="0">
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="machining_method"/>
|
||||
<field name="materials_type_id"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="feed_per_tooth_ids_3"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="cutting_speed"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="feed_per_tooth_ids_4"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}">
|
||||
<tree editable="bottom" class="center">
|
||||
<field name="specification_id" invisible="1"/>
|
||||
<field name="machining_method"/>
|
||||
<field name="materials_type_id"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<footer>
|
||||
<!-- <button string="确认" name="submit" type="object" class="oe_highlight"/>-->
|
||||
<!-- <button string="取消" class="btn btn-secondary" special="cancel"/>-->
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_cutting_tool_specification_wizard" model="ir.actions.act_window">
|
||||
<field name="name">刀具规格</field>
|
||||
<field name="res_model">sf.cutting_tool.specification.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="cutting_tool_specification_wizard_form_view"/>
|
||||
<field name="target">new</field>
|
||||
<!-- <field name="context">{-->
|
||||
<!-- 'default_cutting_tool_model_id' : cutting_tool_model_id,-->
|
||||
<!-- }</field>-->
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user