diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index 5f4c6906..bcb25c81 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -18,7 +18,6 @@ '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", diff --git a/sf_base/models/__init__.py b/sf_base/models/__init__.py index 93961162..483787eb 100644 --- a/sf_base/models/__init__.py +++ b/sf_base/models/__init__.py @@ -3,7 +3,6 @@ from . import common from . import tool_base_new from . import fixture from . import functional_fixture -from . import tool_other_features diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv index 73661ae8..fefaeb1b 100644 --- a/sf_base/security/ir.model.access.csv +++ b/sf_base/security/ir.model.access.csv @@ -24,12 +24,7 @@ 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 -access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1 + diff --git a/sf_dlm/views/product_template_view.xml b/sf_dlm/views/product_template_view.xml index de7c9ee0..f36e1816 100644 --- a/sf_dlm/views/product_template_view.xml +++ b/sf_dlm/views/product_template_view.xml @@ -335,33 +335,63 @@ - - - - - - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sf_manufacturing/__manifest__.py b/sf_manufacturing/__manifest__.py index be18f685..b7fa686a 100644 --- a/sf_manufacturing/__manifest__.py +++ b/sf_manufacturing/__manifest__.py @@ -22,6 +22,7 @@ 'views/mrp_workcenter_views.xml', 'views/mrp_workorder_view.xml', 'views/production_line_view.xml', + 'views/tool_other_features_view.xml', # 'views/tray_view.xml', 'views/model_type_view.xml', # 'views/kanban_change.xml' diff --git a/sf_manufacturing/models/__init__.py b/sf_manufacturing/models/__init__.py index 2d7d2f1e..96accf78 100644 --- a/sf_manufacturing/models/__init__.py +++ b/sf_manufacturing/models/__init__.py @@ -9,6 +9,7 @@ from . import mrp_routing_workcenter from . import stock from . import res_user from . import production_line_base +from . import tool_other_features diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 1d1ed2ba..a121ee1f 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -85,7 +85,7 @@ class ResProductMo(models.Model): cutting_tool_neck_diameter = fields.Float('颈部直径(mm)', digits=(6, 1)) cutting_tool_shank_diameter = fields.Float('柄部直径(mm)', digits=(6, 1)) cutting_tool_blade_tip_diameter = fields.Float('刀尖直径(mm)', digits=(6, 1)) - cutting_tool_blade_tip_taper = fields.Float('刀尖锥度(°)', digits=(6, 1)) + cutting_tool_blade_tip_taper = fields.Integer('刀尖锥度(°)') cutting_tool_blade_helix_angle = fields.Integer('刃部螺旋角(°)') cutting_tool_blade_type = fields.Char('刃部类型') cutting_tool_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精') @@ -170,7 +170,8 @@ class ResProductMo(models.Model): # if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具': # raise ValidationError("端跳精度最小(min)不能为0") - cutting_speed_ids = fields.Many2many('sf.cutting.speed', 'rel_sf_cutting_speed', '切削速度Vc') + cutting_speed_ids = fields.One2many('sf.cutting.speed', 'product_template_id', string='切削速度Vc') + feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'product_template_id', string='每齿走刀量fz') # @api.constrains('suitable_machining_method_ids') # def _check_suitable_machining_method_ids(self): diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 634a0afe..45b38443 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -464,12 +464,12 @@ class ReStockMove(models.Model): 'blade_tip_taper': item.product_id.cutting_tool_blade_tip_taper, 'blade_helix_angle': item.product_id.cutting_tool_blade_helix_angle, 'blade_type': item.product_id.cutting_tool_blade_type, - 'coarse_medium_fine': item.product_id.cutting_tool_coarse_medium_fine, + 'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False else item.product_id.cutting_tool_coarse_medium_fine, 'run_out_accuracy_max': item.product_id.cutting_tool_run_out_accuracy_max, 'run_out_accuracy_min': item.product_id.cutting_tool_run_out_accuracy_min, 'head_diameter': item.product_id.cutting_tool_head_diameter, 'diameter': item.product_id.cutting_tool_diameter, - 'blade_number': item.product_id.cutting_tool_blade_number, + 'blade_number': '' if item.product_id.cutting_tool_blade_number is False else item.product_id.cutting_tool_blade_number, 'front_angle': item.product_id.cutting_tool_front_angle, 'rear_angle': item.product_id.cutting_tool_rear_angle, 'main_included_angle': item.product_id.cutting_tool_main_included_angle, @@ -503,7 +503,7 @@ class ReStockMove(models.Model): 'standard_speed': item.product_id.cutting_tool_standard_speed, 'speed_max': item.product_id.cutting_tool_speed_max, 'cooling_type': item.product_id.cutting_tool_cooling_type, - 'body_accuracy ': item.product_id.cutting_tool_body_accuracy, + 'body_accuracy': item.product_id.cutting_tool_body_accuracy, 'apply_lock_nut_model': item.product_id.apply_lock_nut_model, 'apply_lock_wrench_model': item.product_id.apply_lock_wrench_model, 'tool_taper': item.product_id.cutting_tool_taper, diff --git a/sf_base/models/tool_other_features.py b/sf_manufacturing/models/tool_other_features.py similarity index 67% rename from sf_base/models/tool_other_features.py rename to sf_manufacturing/models/tool_other_features.py index 129b0199..198faa09 100644 --- a/sf_base/models/tool_other_features.py +++ b/sf_manufacturing/models/tool_other_features.py @@ -1,4 +1,4 @@ -from odoo import fields, models +from odoo import fields, models, api class SuitableMachiningMethod(models.Model): @@ -56,12 +56,14 @@ class CuttingSpeed(models.Model): # # order = fields.Char('序', default=_get_order, readonly=True) + product_template_id = fields.Many2one('product.template', string='产品') + execution_standard_id = fields.Char('执行标准') material_code = fields.Char('材料代号') material_name = fields.Char('材料名称') material_grade = fields.Char('材料牌号') - tensile_strength = fields.Char('拉伸强度 (N/mm²)') - hardness = fields.Char('硬度(HRC)') + tensile_strength = fields.Float('拉伸强度 (N/mm²)') + hardness = fields.Float('硬度(HRC)') cutting_speed_n1 = fields.Char('径向切宽 ae=100%D1 ap=1*D1 切削速度Vc') cutting_speed_n2 = fields.Char('径向切宽 ae=50%D1 ap=1.5*D1 切削速度Vc') @@ -70,4 +72,22 @@ class CuttingSpeed(models.Model): cutting_speed_n5 = fields.Char('径向切宽 ae=5%D1 ap=L1max 切削速度Vc') rough_machining = fields.Char('粗加工 Vc(m/min)') precision_machining = fields.Char('精加工 Vc(m/min)') - application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用') \ No newline at end of file + application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用') + + +class FeedPerTooth(models.Model): + _name = 'sf.feed.per.tooth' + _description = '每齿走刀量fz' + + product_template_id = fields.Many2one('product.template', string='产品') + + cutting_speed = fields.Char('径向切宽 ae(mm)') + materials_type_id = fields.Many2one('sf.materials.model', string='材料型号') + blade_diameter = fields.Float('刃部直径D1(mm)', readonly=True, compute='_compute_product_template_id') + feed_per_tooth = fields.Char('每齿走刀量 (mm/z)') + unit = fields.Char('单位', default='fz') + + @api.depends('product_template_id') + def _compute_product_template_id(self): + if self.product_template_id is not None: + self.blade_diameter = self.product_template_id.integral_blade_diameter diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index e0a78bb6..76812adb 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -7,6 +7,12 @@ access_sf_surface_technics_model_type_routing_sort,sf_surface_technics_model_typ access_sf_production_line,sf.production.line,model_sf_production_line,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 +access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1 +access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_user,1,1,1,1 diff --git a/sf_base/views/tool_other_features_view.xml b/sf_manufacturing/views/tool_other_features_view.xml similarity index 83% rename from sf_base/views/tool_other_features_view.xml rename to sf_manufacturing/views/tool_other_features_view.xml index df614171..897ff785 100644 --- a/sf_base/views/tool_other_features_view.xml +++ b/sf_manufacturing/views/tool_other_features_view.xml @@ -105,7 +105,7 @@ 切削速度Vc sf.cutting.speed - + @@ -131,4 +131,27 @@ sf.cutting.speed tree + + + + + 每齿走刀量fz + sf.feed.per.tooth + + + + + + + + + + + + + 每齿走刀量fz + ir.actions.act_window + sf.feed.per.tooth + tree + \ No newline at end of file diff --git a/sf_tool_management/models/tool_material_search.py b/sf_tool_management/models/tool_material_search.py index c58d0e6f..ab9c24f7 100644 --- a/sf_tool_management/models/tool_material_search.py +++ b/sf_tool_management/models/tool_material_search.py @@ -102,6 +102,9 @@ class SfToolMaterialSearch(models.Model): cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction', '走刀方向') suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant', '适合冷却液') + cutting_speed_ids = fields.Many2many('sf.cutting.speed', string='切削速度Vc') + feed_per_tooth_ids = fields.Many2many('sf.feed.per.tooth', 'rel_feed_per_tooth_ids', '每齿走刀量fz') + @api.constrains('suitable_machining_method_ids') def _check_suitable_machining_method_ids(self): for record in self: diff --git a/sf_tool_management/views/tool_material_search.xml b/sf_tool_management/views/tool_material_search.xml index 7ed97d1d..594073ff 100644 --- a/sf_tool_management/views/tool_material_search.xml +++ b/sf_tool_management/views/tool_material_search.xml @@ -240,6 +240,12 @@ + + + + + +