diff --git a/sf_base/models/tool_other_features.py b/sf_base/models/tool_other_features.py index e4376d63..f365b4f3 100644 --- a/sf_base/models/tool_other_features.py +++ b/sf_base/models/tool_other_features.py @@ -295,7 +295,6 @@ class CuttingSpeed(models.Model): _description = '切削速度Vc' product_template_id = fields.Many2one('product.template') - specification_id = fields.Many2one('sf.cutting_tool.specification.wizard', string='刀具规格') standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库') execution_standard_id = fields.Many2one('sf.international.standards', string='执行标准', store=True) material_code = fields.Char('材料代号') @@ -342,7 +341,6 @@ class FeedPerTooth(models.Model): product_template_id = fields.Many2one('product.template') standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库') - specification_id = fields.Many2one('sf.cutting_tool.specification.wizard', string='刀具规格') cutting_speed = fields.Char('径向切宽 ae(mm)') machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式') materials_type_id = fields.Many2one('sf.materials.model', string='材料型号') diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss index d8761b94..a2992e1a 100644 --- a/sf_base/static/src/scss/test.scss +++ b/sf_base/static/src/scss/test.scss @@ -179,4 +179,7 @@ td.o_required_modifier { .button_width{ display: flex; } +.o_field_widget.o_field_many2one { + flex-direction: row !important; +} diff --git a/sf_dlm/views/product_template_view.xml b/sf_dlm/views/product_template_view.xml index 267775a2..9c81ee0c 100644 --- a/sf_dlm/views/product_template_view.xml +++ b/sf_dlm/views/product_template_view.xml @@ -1,19 +1,19 @@ - - product.template.only.form.inherit.sf - product.template - - - - - - - - - - + + + + + + + + + + + + + product.template.form.inherit.sf @@ -59,10 +59,10 @@ domain="[('standard_library_id','=',cutting_tool_model_id)]"/> - + + + + @@ -104,47 +104,83 @@ - + + + + + + + + + + product.template.only.form.inherit.sf + product.template + + + + + + + + + - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 857e1cfd..e6fd1c39 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -68,7 +68,6 @@ class ResProductMo(models.Model): cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='类型', domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]") - brand_id = fields.Many2one('sf.machine.brand', '品牌') tool_length = fields.Float('长度(mm)') @@ -93,9 +92,16 @@ class ResProductMo(models.Model): cutting_tool_blade_tip_taper = fields.Integer('刀尖锥度(°)') cutting_tool_blade_helix_angle = fields.Integer('刃部螺旋角(°)') cutting_tool_blade_type = fields.Char('刃部类型') + cutting_tool_pitch = fields.Char('牙距(mm)', size=20) + cutting_tool_blade_width = fields.Char('刃部宽度(mm)', size=20) + cutting_tool_blade_depth = fields.Char('刃部深度(mm)', size=20) + cutting_tool_cut_depth = fields.Char('切削深度(mm)', size=20) cutting_tool_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精') 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_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', + '适配刀片形状', domain=[('type', '=', '刀片形状')]) suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image', 'rel_machining_product_template', '适合加工方式', domain=[('type', '=', '加工能力')]) @@ -108,6 +114,46 @@ class ResProductMo(models.Model): '走刀方向', domain=[('type', '=', '走刀方向')]) suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template', '适合冷却液', domain=[('type', '=', '冷却液')]) + compaction_way_ids = fields.Many2many('maintenance.equipment.image', 'rel_compaction_product_template', + '压紧方式', domain=[('type', '=', '压紧方式')]) + + @api.onchange('specification_id') + def _onchange_specification(self): + if self.specification_id: + self.cutting_tool_type_id = self.cutting_tool_model_id.cutting_tool_type_id.id + self.brand_id = self.cutting_tool_model_id.brand_id.id + self.tool_hardness = self.cutting_tool_model_id.tool_hardness + self.cutting_tool_run_out_accuracy_max = self.cutting_tool_model_id.integral_run_out_accuracy_max + self.cutting_tool_run_out_accuracy_min = self.cutting_tool_model_id.integral_run_out_accuracy_min + self.materials_type_id = self.cutting_tool_model_id.material_model_id.id + self.cutting_tool_blade_type = self.cutting_tool_model_id.blade_type + self.cutting_tool_coarse_medium_fine = self.cutting_tool_model_id.integral_coarse_medium_fine + self.coating_material = self.cutting_tool_model_id.coating_material + self.suitable_machining_method_ids = [(6, 0, + [])] if not self.cutting_tool_model_id.suitable_machining_method_ids else [ + (6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)] + self.blade_tip_characteristics_ids = [(6, 0, + [])] if not self.cutting_tool_model_id.blade_tip_characteristics_ids else [ + (6, 0, self.cutting_tool_model_id.blade_tip_characteristics_ids.ids)] + + self.handle_type_ids = [(6, 0, + [])] if not self.cutting_tool_model_id.handle_type_ids else [ + (6, 0, self.cutting_tool_model_id.handle_type_ids.ids)] + + self.cutting_direction_ids = [(6, 0, + [])] if not self.cutting_tool_model_id.cutting_direction_ids else [ + (6, 0, self.cutting_tool_model_id.cutting_direction_ids.ids)] + + self.suitable_coolant_ids = [(6, 0, + [])] if not self.cutting_tool_model_id.suitable_coolant_ids else [ + (6, 0, self.cutting_tool_model_id.suitable_coolant_ids.ids)] + self.compaction_way_ids = [(6, 0, + [])] if not self.cutting_tool_model_id.compaction_way_ids else [ + (6, 0, self.cutting_tool_model_id.compaction_way_ids.ids)] + 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}) 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') # def _check_suitable_machining_method_ids(self): @@ -427,8 +473,6 @@ class ResProductMo(models.Model): # def _onchange_cutting_tool_material_id(self): # if self.cutting_tool_material_id: - - @api.onchange('fixture_material_id') def _onchange_fixture_material_id(self): for item in self: