From ce53afe1b09f96a4f477d7de3ff18439805bf27d Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Mon, 8 Jan 2024 15:29:48 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BB=84=E8=AE=BF=E9=97=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_maintenance/security/ir.model.access.csv | 17 +++++++++++------ sf_maintenance/views/maintenance_views.xml | 2 +- sf_manufacturing/security/ir.model.access.csv | 7 ++++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sf_maintenance/security/ir.model.access.csv b/sf_maintenance/security/ir.model.access.csv index 4f693af2..d772d54c 100644 --- a/sf_maintenance/security/ir.model.access.csv +++ b/sf_maintenance/security/ir.model.access.csv @@ -1,10 +1,15 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_group_equipment_user,1,1,1,1 -access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_group_equipment_user,1,1,1,1 -access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_group_equipment_user,1,1,1,1 -access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_user,1,1,1,1 -access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_user,1,1,1,1 -access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,1,1,1 +access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_group_equipment_user,1,1,1,0 +access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_group_equipment_user,1,0,0,0 +access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_group_equipment_manager,1,1,1,0 +access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_group_equipment_user,1,0,0,0 +access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_group_equipment_manager,1,1,1,0 +access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_user,1,0,0,0 +access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_manager,1,1,1,0 +access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_user,1,0,0,0 +access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_manager,1,1,1,0 +access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,0,0,0 +access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_manager,1,1,1,0 access_maintenance_request,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0 diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml index 5266bced..0dc18355 100644 --- a/sf_maintenance/views/maintenance_views.xml +++ b/sf_maintenance/views/maintenance_views.xml @@ -48,7 +48,7 @@ - + diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index 313c4567..d71f7f4b 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -6,10 +6,10 @@ access_sf_model_type_manager,sf_model_type,model_sf_model_type,sf_base.group_sf_ access_sf_product_model_type_routing_sort,sf_product_model_type_routing_sort,model_sf_product_model_type_routing_sort,sf_base.group_sf_mrp_user,1,0,0,0 access_sf_product_model_type_routing_sort_manager,sf_product_model_type_routing_sort,model_sf_product_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,0 access_sf_embryo_model_type_routing_sort,sf_embryo_model_type_routing_sort,model_sf_embryo_model_type_routing_sort,sf_base.group_sf_mrp_user,1,0,0,0 -access_sf_embryo_model_type_routing_sort_manager,sf_embryo_model_type_routing_sort,model_sf_embryo_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,1 +access_sf_embryo_model_type_routing_sort_manager,sf_embryo_model_type_routing_sort,model_sf_embryo_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,0 access_sf_surface_technics_model_type_routing_sort,sf_surface_technics_model_type_routing_sort,model_sf_surface_technics_model_type_routing_sort,sf_base.group_sf_mrp_user,1,0,0,0 access_sf_surface_technics_model_type_routing_sort_manager,sf_surface_technics_model_type_routing_sort,model_sf_surface_technics_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,0 -access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_sf_mrp_user,1,0,0,0 +access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_sf_mrp_user,1,1,1,0 access_sf_production_line_manager,sf.production.line,model_sf_production_line,sf_base.group_sf_mrp_manager,1,1,1,0 access_maintenance_equipment_tool,maintenance_equipment_tool,model_maintenance_equipment_tool,sf_base.group_sf_mrp_user,1,0,0,0 access_maintenance_equipment_tool_manager,maintenance_equipment_tool,model_maintenance_equipment_tool,sf_base.group_sf_mrp_manager,1,1,1,0 @@ -42,7 +42,7 @@ access_mrp_production_stock_worker,mrp.production stock_worker,mrp.model_mrp_pro access_product_product_user,product.product user,product.model_product_product,sf_base.group_sf_mrp_user,1,0,0,0 access_product_template_user,product.template user,product.model_product_template,sf_base.group_sf_mrp_user,1,0,0,0 access_uom_uom_user,uom.uom user,uom.model_uom_uom,sf_base.group_sf_mrp_user,1,0,0,0 -access_product_supplierinfo_user,product.supplierinfo user,product.model_product_supplierinfo,sf_base.group_sf_mrp_user,1,1,1,0 +access_product_supplierinfo_user,product.supplierinfo user,product.model_product_supplierinfo,sf_base.group_sf_mrp_user,1,0,0,0 access_res_partner,res.partner,base.model_res_partner,sf_base.group_sf_mrp_user,1,0,0,0 access_mrp_workorder_mrp_user,mrp.workorder.user,mrp.model_mrp_workorder,sf_base.group_sf_mrp_user,1,1,1,0 access_mrp_workorder_mrp_manager,mrp.workorder,mrp.model_mrp_workorder,sf_base.group_sf_mrp_user,1,1,1,0 @@ -90,6 +90,7 @@ access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model access_mrp_production,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0 access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,1,1,0 +access_sf_production_line,sf.production.line,model_sf_production_line,sf_maintenance.sf_group_equipment_user,1,1,1,0 access_mrp_workcenter,mrp_workcenter,model_mrp_workcenter,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_bom,mrp.bom,mrp.model_mrp_bom,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_bom_line,mrp.bom.line,mrp.model_mrp_bom_line,sf_base.group_plan_dispatch,1,0,0,0 From 631d59f95ebe28e6b4ff18cdbe1189de38bb41ff Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Mon, 8 Jan 2024 16:18:15 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/tool_base_new.py | 6 +- sf_base/models/tool_base_new.py.rej | 10 + sf_manufacturing/models/product_template.py | 217 ++++++-------------- 3 files changed, 78 insertions(+), 155 deletions(-) create mode 100644 sf_base/models/tool_base_new.py.rej diff --git a/sf_base/models/tool_base_new.py b/sf_base/models/tool_base_new.py index 1c7219bc..8f216f49 100644 --- a/sf_base/models/tool_base_new.py +++ b/sf_base/models/tool_base_new.py @@ -106,8 +106,10 @@ class CuttingToolModel(models.Model): chuck_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters', 'standard_library_id', string='夹头基本参数') cutting_speed_ids = fields.One2many('sf.cutting.speed', 'standard_library_id', string='切削速度Vc') - feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz') - feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz') + feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz', + domain=[('cutting_speed', '!=', False)]) + feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz', + domain=[('cutting_speed', '!=', False)]) material_model_id = fields.Many2one('sf.materials.model', '材料型号') # 适用夹头型号可以多选 diff --git a/sf_base/models/tool_base_new.py.rej b/sf_base/models/tool_base_new.py.rej new file mode 100644 index 00000000..6db1f28a --- /dev/null +++ b/sf_base/models/tool_base_new.py.rej @@ -0,0 +1,10 @@ +diff a/sf_base/models/tool_base_new.py b/sf_base/models/tool_base_new.py (rejected hunks) +@@ -108,6 +108,4 @@ + cutting_speed_ids = fields.One2many('sf.cutting.speed', 'standard_library_id', string='切削速度Vc') +- feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz', +- domain=[('cutting_speed', '!=', False)]) +- feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz', +- domain=[('cutting_speed', '!=', False)]) ++ feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz') ++ feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz') + diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 23c659f5..285d43f0 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -202,6 +202,7 @@ class ResProductMo(models.Model): self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids.filtered( lambda r: int(r.blade_diameter) == int(self.specification_id.blade_diameter)) elif self.cutting_tool_type == '夹头': + self.cutting_tool_clamping_length = self.specification_id.clamping_length self.cutting_tool_clamping_tolerance = self.specification_id.clamping_tolerance self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter self.cutting_tool_clamping_diameter_min = self.specification_id.max_clamping_diameter @@ -227,12 +228,14 @@ class ResProductMo(models.Model): 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_chip_breaker_groove = self.specification_id.chip_breaker_groove - self.cutting_tool_chip_breaker_type_code = self.specification_id.chip_breaker_type_code + # self.cutting_tool_cut_depth_max = self.specification_id.blade_blade_number self.cutting_tool_blade_blade_number = self.specification_id.blade_blade_number self.cutting_tool_blade_width = self.specification_id.blade_width self.cutting_tool_rear_angle = self.specification_id.relief_angle self.cutting_tool_main_included_angle = self.specification_id.main_included_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_side_cutting_edge_angle = self.specification_id.side_cutting_edge_angle self.cutting_tool_pitch = self.specification_id.pitch self.cutting_tool_bladed_teeth_model = self.specification_id.blade_teeth_model self.cutting_tool_thickness_tolerance = self.specification_id.thickness_tolerance @@ -254,20 +257,13 @@ class ResProductMo(models.Model): 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_chip_breaker_groove = self.specification_id.chip_breaker_groove - self.cutting_tool_chip_breaker_type_code = self.specification_id.chip_breaker_type_code + # self.cutting_tool_cut_depth_max = self.specification_id.blade_blade_number self.cutting_tool_blade_blade_number = self.specification_id.blade_blade_number self.cutting_tool_blade_width = self.specification_id.blade_width self.cutting_tool_rear_angle = self.specification_id.relief_angle self.cutting_tool_main_included_angle = self.specification_id.main_included_angle self.cutting_tool_top_angle = self.specification_id.top_angle - self.cutting_tool_screw = self.specification_id.screw - self.cutting_tool_wrench = self.specification_id.wrench - self.cutting_tool_blade_id = self.specification_id.blade_id - self.cutting_tool_is_cooling_hole = self.specification_id.is_cooling_hole - self.cutting_tool_locating_slot_code = self.specification_id.locating_slot_code - self.cutting_tool_install_blade_tip_num = self.specification_id.install_blade_tip_num - self.cutting_tool_installing_structure = self.specification_id.installing_structure - self.cutting_tool_cut_depth_max = self.specification_id.cut_depth_max + self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle if self.cutting_tool_type == '刀盘': self.cutting_tool_blade_length = self.specification_id.blade_length self.cutting_tool_cutter_head_diameter = self.specification_id.cutter_head_diameter @@ -276,27 +272,17 @@ class ResProductMo(models.Model): self.cutting_tool_knife_head_height = self.specification_id.knife_head_height self.cutting_tool_knife_head_width = self.specification_id.knife_head_width self.cutting_tool_knife_head_length = self.specification_id.knife_head_length - self.cutting_tool_tool_shim = self.specification_id.tool_shim - self.cutting_tool_cotter_pin = self.specification_id.cotter_pin - self.cutting_tool_pressing_plate = self.specification_id.pressing_plate elif self.cutting_tool_type == '刀柄': self.cutting_tool_total_length = self.specification_id.total_length + self.cutting_tool_standard_speed = self.specification_id.standard_rotate_speed self.cutting_tool_speed_max = self.specification_id.max_rotate_speed self.cutting_tool_change_time = self.specification_id.tool_changing_time self.cutting_tool_total_length = self.specification_id.total_length self.cutting_tool_clamping_diameter_max = self.specification_id.max_clamping_diameter self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter self.cutting_tool_flange_length = self.specification_id.flange_shank_length - self.cutting_tool_flange_diameter = self.specification_id.flange_diameter - self.cutting_tool_fit_chuck_size = self.specification_id.fit_chuck_size - self.cutting_tool_dynamic_balance_class = self.specification_id.dynamic_balance_class - self.cutting_tool_is_high_speed_cutting = self.specification_id.is_quick_cutting - self.cutting_tool_is_safety_lock = self.specification_id.is_safe_lock - self.cutting_tool_fit_nut_model = self.specification_id.nut - self.cutting_tool_wrench = self.specification_id.spanner - self.cutting_tool_chuck_id = self.specification_id.chuck_id.id - self.cutting_tool_jump_accuracy = self.specification_id.diameter_slip_accuracy - self.cutting_tool_taper_shank_model = self.specification_id.taper_shank_model + 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.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)] @@ -364,12 +350,12 @@ class ResProductMo(models.Model): raise ValidationError("请选择压紧方式") if self.cutting_tool_type == '刀片': if not self.suitable_coolant_ids: - raise ValidationError("请选择适合冷却方式") + raise ValidationError("请选择适合冷却液") elif self.cutting_tool_type == '整体式刀具': if not self.handle_type_id: raise ValidationError("请选择柄部类型") if not self.suitable_coolant_ids: - raise ValidationError("请选择适合冷却方式") + raise ValidationError("请选择适合冷却液") if not self.suitable_machining_method_ids: raise ValidationError("请选择适合加工方式") if not self.blade_tip_characteristics_id: @@ -383,8 +369,11 @@ class ResProductMo(models.Model): cutting_tool_rear_angle = fields.Integer('后角(°)') cutting_tool_main_included_angle = fields.Integer('主偏角(°)') # 适用夹头型号可以多选 - cutting_tool_chuck_id = fields.Many2one( + cutting_tool_chuck_ids = fields.Many2many( 'sf.cutting_tool.standard.library', + relation='product_cutting_tool_library_handle_chuck_rel', + column1='model_id_1', + column2='model_id_2', domain="[('cutting_tool_type', '=', '夹头')]", string='适用夹头型号') # 刀片参数 @@ -395,7 +384,6 @@ class ResProductMo(models.Model): cutting_tool_install_aperture_diameter = fields.Float('安装孔直径(mm)') cutting_tool_chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')], string='有无断屑槽') - cutting_tool_chip_breaker_type_code = fields.Char('断屑槽型代号') cutting_tool_bladed_teeth_model = fields.Selection( [('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'), ('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'), @@ -407,6 +395,8 @@ class ResProductMo(models.Model): ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10')], string='刀片的刃数(个)') + cutting_tool_blade_tip_dip_angle = fields.Integer('刀尖倾角(°)') + cutting_tool_side_cutting_edge_angle = fields.Integer('侧切削角(°)') cutting_tool_thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型') cutting_tool_thread_num = fields.Float('每英寸螺纹数(tpi)') @@ -441,8 +431,11 @@ class ResProductMo(models.Model): cutting_tool_min_machining_aperture = fields.Integer('最小加工孔径(mm)') cutting_tool_install_blade_tip_num = fields.Integer('可装刀片数/齿数(个)', size=20) cutting_tool_installing_structure = fields.Char('安装结构', size=20) - cutting_tool_blade_id = fields.Many2one( + cutting_tool_blade_ids = fields.Many2many( 'sf.cutting_tool.standard.library', + relation='product_cutting_tool_library_pad_blade_rel', + column1='model_id_1', + column2='model_id_2', domain="[('cutting_tool_type', '=', '刀片')]", string='适用刀片型号' # 使用空列表作为默认值 ) @@ -458,23 +451,24 @@ class ResProductMo(models.Model): cutting_tool_interface_diameter = fields.Float('接口直径(mm)') # 刀柄参数 + cutting_tool_shank_outer_diameter = fields.Float('柄部外径(mm)') + cutting_tool_shank_inner_diameter = fields.Float('柄部内径(mm)') + cutting_tool_clamping_length = fields.Float('夹持长度(mm)') + cutting_tool_clamping_tolerance = fields.Float('夹持公差(mm)') cutting_tool_clamping_diameter_max = fields.Float('最大夹持直径') cutting_tool_clamping_diameter_min = fields.Float('最小夹持直径') cutting_tool_flange_length = fields.Float('法兰柄长(mm)') cutting_tool_flange_diameter = fields.Float('法兰直径(mm)') + cutting_tool_is_rough_finish = fields.Boolean('可粗加工', default=False) + cutting_tool_is_finish = fields.Boolean('可精加工', default=False) + cutting_tool_is_drill_hole = fields.Boolean('可钻孔', default=False) cutting_tool_is_safety_lock = fields.Boolean('有无安全锁', default=False) cutting_tool_is_high_speed_cutting = fields.Boolean('可高速切削', default=False) cutting_tool_change_time = fields.Integer('换刀时间(s)') cutting_tool_clamping_way = fields.Char('夹持方式') - cutting_tool_fit_chuck_size = fields.Char('适配夹头尺寸') - cutting_tool_taper_shank_model = fields.Char('锥柄型号') cutting_tool_standard_speed = fields.Integer('标准转速(n/min)') cutting_tool_speed_max = fields.Integer('最大转速(n/min)') cutting_tool_cooling_type = fields.Char('冷却类型') - cutting_tool_dynamic_balance_class = fields.Char('动平衡等级') - cutting_tool_fit_nut_model = fields.Char('适用锁紧螺母型号') - - # 夹头参数 cutting_tool_taper = fields.Integer('锥度(°)') cutting_tool_top_diameter = fields.Float('顶部直径') @@ -482,7 +476,7 @@ class ResProductMo(models.Model): cutting_tool_inner_diameter = fields.Float('内径(mm)') cooling_suit_type_ids = fields.Char('适用冷却套型号') cutting_tool_max_load_capacity = fields.Float('最大负载能力(kg)') - cutting_tool_er_size_model = fields.Char('尺寸型号') + cutting_tool_er_size_model = fields.Char('ER尺寸型号') cutting_tool_handle_ids = fields.Many2many( 'sf.cutting_tool.standard.library', relation='product_cutting_tool_library_chuck_handle_rel', @@ -492,6 +486,28 @@ class ResProductMo(models.Model): string='适用刀柄型号' ) + # 夹具参数 + fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料") + fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号") + fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name') + fixture_multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型") + fixture_clamping_way = fields.Char(string="装夹方式") + fixture_port_type = fields.Char(string="接口类型") + fixture_model_file = fields.Binary(string="3D模型图") + + fixture_clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)") + fixture_clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)") + fixture_clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)") + fixture_clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)", digits=(16, 6)) + + fixture_maximum_carrying_weight = fields.Float(string="最大承载重量(kg)", digits=(16, 4)) + fixture_maximum_clamping_force = fields.Integer(string="最大夹持力(n)") + fixture_driving_way = fields.Char(string="驱动方式") + fixture_apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_product_machine_tool_type', + string="适用机床型号") + fixture_through_hole_size = fields.Integer(string="过孔大小(mm)") + fixture_screw_size = fields.Integer(string="螺牙大小(mm)") + # 注册状态 register_state = fields.Selection([('未注册', '未注册'), ('已注册', '已注册'), ('注册失败', '注册失败')], string='注册状态', default='未注册') @@ -553,6 +569,12 @@ class ResProductMo(models.Model): code_arr.append(i.code) return code_arr + def _json_chuck_item_code(self, item): + code_arr = [] + for i in item.product_id.cutting_tool_chuck_ids: + code_arr.append(i.code) + return code_arr + def _json_cutter_bar_item_code(self, item): code_arr = [] for i in item.product_id.cutting_tool_cutter_bar_ids: @@ -565,6 +587,12 @@ class ResProductMo(models.Model): code_arr.append(i.code) return code_arr + def _json_blade_item_code(self, item): + code_arr = [] + for i in item.product_id.cutting_tool_blade_ids: + code_arr.append(i.code) + return code_arr + def _json_handle_item_code(self, item): code_arr = [] for i in item.product_id.cutting_tool_handle_ids: @@ -597,6 +625,7 @@ class ResProductMo(models.Model): for item in self: if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']: item.brand_id = item.fixture_model_id.brand_id.id + item.fixture_multi_mounting_type_id = item.fixture_model_id.multi_mounting_type_id.id item.fixture_model_file = item.fixture_model_id.model_file item.tool_length = item.fixture_model_id.length item.tool_width = item.fixture_model_id.width @@ -797,124 +826,6 @@ class ResProductMo(models.Model): return base64_data -class ResProductFixture(models.Model): - _inherit = 'product.template' - _description = '夹具产品信息' - - fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号') - specification_fixture_id = fields.Many2one('sf.fixture.materials.basic.parameters', '夹具规格') - - fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", required=True) - fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name') - multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True) - model_file = fields.Binary(string="3D模型图") - - # 夹具物料基本参数 - # length = fields.Float('长度(mm)', digits=(16, 2)) - # width = fields.Float('宽度(mm)', digits=(16, 2)) - # height = fields.Float('高度(mm)', digits=(16, 2)) - diameter = fields.Float('直径(mm)', digits=(16, 2)) - - # '零点卡盘' 字段 - weight = fields.Float('重量(mm)', digits=(16, 2)) - orientation_dish_diameter = fields.Float('定位盘直径(mm)', digits=(16, 2)) - clamping_diameter = fields.Float('装夹直径(mm)', digits=(16, 2)) - clamping_num = fields.Selection([('1', '1'), ('2', '2'), ('4', '4'), ('6', '6'), ('8', '8')], string='装夹单元数') - chucking_power_max = fields.Float('最大夹持力(KN)', digits=(16, 2)) - repeated_positioning_accuracy = fields.Char('重复定位精度(mm)', size=20) - boolean_transposing_hole = fields.Boolean('是否有转位孔') - unlocking_method = fields.Selection( - [('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')], string='解锁方式') - boolean_chip_blowing_function = fields.Boolean('是否有吹屑功能') - carrying_capacity_max = fields.Float('最大承载重量(kg)', digits=(16, 2)) - rigidity = fields.Integer('硬度HRC') - materials_model_id = fields.Many2one('sf.materials.model', '夹具材质') - machine_tool_type_id = fields.Many2one('sf.machine_tool.type', '适用机床型号') - - # ’零点托盘‘ 字段 - connector_diameter = fields.Selection([('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('8', '8')], - string='连接头直径(mm)') - way_to_install = fields.Selection( - [('接口式', '接口式'), ('螺栓固定', '螺栓固定'), ('磁吸式', '磁吸式'), ('其他', '其他')], string='安装方式') - type_of_drive = fields.Selection( - [('气动式', '气动式'), ('液压式', '液压式'), ('机械式', '机械式'), ('电动式', '电动式'), ('其他', '其他')], - string='驱动方式') - - # ’气动夹具‘ 字段 - gripper_length_min = fields.Float('夹持工件最小长度(mm)', digits=(16, 2)) - gripper_width_min = fields.Float('夹持工件最小宽度(mm)', digits=(16, 2)) - gripper_height_min = fields.Float('夹持工件最小高度(mm)', digits=(16, 2)) - gripper_diameter_min = fields.Float('夹持工件最小直径(mm)', digits=(16, 2)) - gripper_length_max = fields.Float('夹持工件最大长度(mm)', digits=(16, 2)) - gripper_width_max = fields.Float('夹持工件最大宽度(mm)', digits=(16, 2)) - gripper_height_max = fields.Float('夹持工件最大高度(mm)', digits=(16, 2)) - gripper_diameter_max = fields.Float('夹持工件最大直径(mm)', digits=(16, 2)) - rated_air_pressure = fields.Float('额定气压(Mpa)', digits=(16, 2)) - interface_materials_model_id = fields.Many2one('sf.materials.model', '接口类型') - - # ‘虎钳夹具' 字段 - transverse_groove = fields.Float('横向配合槽n(mm)', digits=(16, 2)) - longitudinal_fitting_groove = fields.Float('纵向配合槽l(mm)', digits=(16, 2)) - - # '磁吸夹具' 字段 - height_tolerance_value = fields.Char('高度公差(mm)') - rated_adsorption_force = fields.Float('额定吸附力(N/cm²)', digits=(16, 2)) - magnetic_field_height = fields.Float('磁场高度(mm)', digits=(16, 2)) - magnetic_pole_plate_grinding_allowance = fields.Float('磁极板磨削余量(mm)', digits=(16, 2)) - - # '转接板(锁板)夹具' 字段 - screw_size = fields.Float('螺牙大小(mm)', digits=(16, 2)) - via_hole_diameter = fields.Float('过孔直径(mm)', digits=(16, 2)) - - # '三爪卡盘' 字段 - mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2)) - centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2)) - - @api.onchange('specification_fixture_id') - def _onchange_specification_fixture_id(self): - if self.specification_fixture_id: - self.length = self.specification_fixture_id.length - self.width = self.specification_fixture_id.width - self.height = self.specification_fixture_id.height - self.weight = self.specification_fixture_id.weight - self.diameter = self.specification_fixture_id.diameter - self.orientation_dish_diameter = self.specification_fixture_id.orientation_dish_diameter - self.clamping_diameter = self.specification_fixture_id.clamping_diameter - self.clamping_num = self.specification_fixture_id.clamping_num - self.chucking_power_max = self.specification_fixture_id.chucking_power_max - self.repeated_positioning_accuracy = self.specification_fixture_id.repeated_positioning_accuracy - self.boolean_transposing_hole = self.specification_fixture_id.boolean_transposing_hole - self.unlocking_method = self.specification_fixture_id.unlocking_method - self.boolean_chip_blowing_function = self.specification_fixture_id.boolean_chip_blowing_function - self.carrying_capacity_max = self.specification_fixture_id.carrying_capacity_max - self.rigidity = self.specification_fixture_id.rigidity - self.materials_model_id = self.specification_fixture_id.materials_model_id - self.machine_tool_type_id = self.specification_fixture_id.machine_tool_type_id - self.connector_diameter = self.specification_fixture_id.connector_diameter - self.way_to_install = self.specification_fixture_id.way_to_install - self.type_of_drive = self.specification_fixture_id.type_of_drive - self.gripper_length_min = self.specification_fixture_id.gripper_length_min - self.gripper_width_min = self.specification_fixture_id.gripper_width_min - self.gripper_height_min = self.specification_fixture_id.gripper_height_min - self.gripper_diameter_min = self.specification_fixture_id.gripper_diameter_min - self.gripper_length_max = self.specification_fixture_id.gripper_length_max - self.gripper_width_max = self.specification_fixture_id.gripper_width_max - self.gripper_height_max = self.specification_fixture_id.gripper_height_max - self.gripper_diameter_max = self.specification_fixture_id.gripper_diameter_max - self.rated_air_pressure = self.specification_fixture_id.rated_air_pressure - self.interface_materials_model_id = self.specification_fixture_id.interface_materials_model_id - self.transverse_groove = self.specification_fixture_id.transverse_groove - self.longitudinal_fitting_groove = self.specification_fixture_id.longitudinal_fitting_groove - self.height_tolerance_value = self.specification_fixture_id.height_tolerance_value - self.rated_adsorption_force = self.specification_fixture_id.rated_adsorption_force - self.magnetic_field_height = self.specification_fixture_id.magnetic_field_height - self.magnetic_pole_plate_grinding_allowance = self.specification_fixture_id.magnetic_pole_plate_grinding_allowance - self.screw_size = self.specification_fixture_id.screw_size - self.via_hole_diameter = self.specification_fixture_id.via_hole_diameter - self.mounting_hole_depth = self.specification_fixture_id.mounting_hole_depth - self.centering_diameter = self.specification_fixture_id.centering_diameter - - class SfMaintenanceEquipmentAndProductTemplate(models.Model): _inherit = 'maintenance.equipment' _description = '设备' From 3742a3b16342e48a07bc63b1249683221e178e9a Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Mon, 8 Jan 2024 17:51:16 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E5=BE=97?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=AE=8C=E5=B7=A5=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=8D=A1=E5=8F=96=E9=9C=80=E5=8F=98=E6=88=90=E5=B0=B1=E7=BB=AA?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/tool_other_features.py | 1 + sf_manufacturing/models/mrp_production.py | 87 +++++++++++++++++++++++ sf_manufacturing/models/mrp_workorder.py | 3 +- 3 files changed, 90 insertions(+), 1 deletion(-) diff --git a/sf_base/models/tool_other_features.py b/sf_base/models/tool_other_features.py index 154bf275..ec3ad238 100644 --- a/sf_base/models/tool_other_features.py +++ b/sf_base/models/tool_other_features.py @@ -162,6 +162,7 @@ class FeedPerTooth(models.Model): _order = 'blade_diameter,cutting_width_depth_id,materials_type_id' name = fields.Char('名称') + cutting_speed = fields.Char('切削速度', required=True) product_template_id = fields.Many2one('product.template') standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库') blade_diameter = fields.Integer('刃部直径(mm)', readonly=True) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 809462a9..dd474527 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -426,3 +426,90 @@ class MrpProduction(models.Model): self._create_workorder3() self._reset_work_order_sequence() return True + + #修改标记已完成方法 + def button_mark_done1(self): + self._button_mark_done_sanity_checks() + + if not self.env.context.get('button_mark_done_production_ids'): + self = self.with_context(button_mark_done_production_ids=self.ids) + res = self._pre_button_mark_done() + if res is not True: + return res + + if self.env.context.get('mo_ids_to_backorder'): + productions_to_backorder = self.browse(self.env.context['mo_ids_to_backorder']) + productions_not_to_backorder = self - productions_to_backorder + else: + productions_not_to_backorder = self + productions_to_backorder = self.env['mrp.production'] + + + backorders = productions_to_backorder and productions_to_backorder._split_productions() + backorders = backorders - productions_to_backorder + + productions_not_to_backorder._post_inventory(cancel_backorder=True) + productions_to_backorder._post_inventory(cancel_backorder=True) + + # if completed products make other confirmed/partially_available moves available, assign them + done_move_finished_ids = (productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(lambda m: m.state == 'done') + done_move_finished_ids._trigger_assign() + + # Moves without quantity done are not posted => set them as done instead of canceling. In + # case the user edits the MO later on and sets some consumed quantity on those, we do not + # want the move lines to be canceled. + (productions_not_to_backorder.move_raw_ids | productions_not_to_backorder.move_finished_ids).filtered(lambda x: x.state not in ('done', 'cancel')).write({ + 'state': 'done', + 'product_uom_qty': 0.0, + }) + + for production in self: + production.write({ + 'date_finished': fields.Datetime.now(), + 'product_qty': production.qty_produced, + 'priority': '0', + 'is_locked': True, + 'state': 'done', + }) + + for workorder in self.workorder_ids.filtered(lambda w: w.state not in ('done', 'cancel')): + workorder.duration_expected = workorder._get_duration_expected() + + if not backorders: + if self.env.context.get('from_workorder'): + return { + 'type': 'ir.actions.act_window', + 'res_model': 'mrp.production', + 'views': [[self.env.ref('mrp.mrp_production_form_view').id, 'form']], + 'res_id': self.id, + 'target': 'main', + } + if self.user_has_groups('mrp.group_mrp_reception_report') and self.picking_type_id.auto_show_reception_report: + lines = self.move_finished_ids.filtered(lambda m: m.product_id.type == 'product' and m.state != 'cancel' and m.quantity_done and not m.move_dest_ids) + if lines: + if any(mo.show_allocation for mo in self): + action = self.action_view_reception_report() + return action + return True + context = self.env.context.copy() + context = {k: v for k, v in context.items() if not k.startswith('default_')} + for k, v in context.items(): + if k.startswith('skip_'): + context[k] = False + action = { + 'res_model': 'mrp.production', + 'type': 'ir.actions.act_window', + 'context': dict(context, mo_ids_to_backorder=None, button_mark_done_production_ids=None) + } + if len(backorders) == 1: + action.update({ + 'view_mode': 'form', + 'res_id': backorders[0].id, + }) + else: + action.update({ + 'name': _("Backorder MO"), + 'domain': [('id', 'in', backorders.ids)], + 'view_mode': 'tree,form', + }) + return action \ No newline at end of file diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 53307af7..7ecec223 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -581,7 +581,8 @@ class ResMrpWorkOrder(models.Model): if is_production_id == True and self.name == '解除装夹': for move_raw_id in self.production_id.move_raw_ids: move_raw_id.quantity_done = move_raw_id.product_uom_qty - self.production_id.state = 'done' + self.production_id.button_mark_done1() + # self.production_id.state = 'done' From 931b78ee03bdff65848443ca21e0bba4930fd566 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 8 Jan 2024 23:24:42 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=8E=92=E7=A8=8B=E7=BC=BA=E5=B0=91=E5=B7=A5=E5=85=B7=E5=8C=85?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index f6e58855..ed9375d7 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -6,6 +6,7 @@ import requests from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.addons.sf_base.commons.common import Common +from odoo.tools import float_compare, float_round, float_is_zero, format_datetime class MrpProduction(models.Model): From f5805ce6ae45d25a4893d195841ff740598d11f2 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Tue, 9 Jan 2024 10:11:13 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan_management/i18n/zh_CN.po | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sf_plan_management/i18n/zh_CN.po b/sf_plan_management/i18n/zh_CN.po index ac175e4e..086067ab 100644 --- a/sf_plan_management/i18n/zh_CN.po +++ b/sf_plan_management/i18n/zh_CN.po @@ -39704,7 +39704,7 @@ msgstr "付款中" #: model_terms:ir.ui.view,arch_db:quality.quality_alert_view_search #: model_terms:ir.ui.view,arch_db:quality_control.quality_check_view_search msgid "In Progress" -msgstr "待排程" +msgstr "进行中" #. module: stock #: model:ir.model.fields,field_description:stock.field_stock_warehouse__in_type_id @@ -55392,7 +55392,7 @@ msgstr "覆盖作者EMail" #: model_terms:ir.ui.view,arch_db:mrp.mrp_bom_form_view #: model_terms:ir.ui.view,arch_db:stock.view_stock_rules_report msgid "Overview" -msgstr "概述" +msgstr "驾驶舱" #. module: base #: model:ir.model.fields,field_description:base.field_base_language_import__overwrite @@ -114487,6 +114487,11 @@ msgstr "" msgid "径跳精度(mm)" msgstr "" +#. module: sf_manufacturing +#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress +msgid "待排程" +msgstr "待排程" + #. module: sf_base #: model:ir.model.fields,field_description:sf_base.field_sf_cutting_tool_model__jump_accuracy msgid "径跳精度(um)" @@ -116186,7 +116191,7 @@ msgstr "" #: model:ir.actions.act_window,name:sf_manufacturing.mrp_workcenter_kanban_action1 #: model:ir.ui.menu,name:sf_manufacturing.menu_mrp_dashboard msgid "生产线驾驶舱" -msgstr "" +msgstr "生产线驾驶舱" #. module: sf_warehouse #: model_terms:ir.ui.view,arch_db:sf_warehouse.view_location_form_sf_inherit From 86366cc6cbe671b0f33b4fed03eb50756011ce0d Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Tue, 9 Jan 2024 10:31:43 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=EF=BC=8C=E5=AE=8C?= =?UTF-8?q?=E5=B7=A5=E4=BA=A7=E5=93=81=E5=B0=B1=E7=BB=AA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/SfWorkOrderBarcodes.xml | 2 +- sf_manufacturing/models/mrp_production.py | 10 ++++---- .../models/mrp_routing_workcenter.py | 6 ++--- sf_manufacturing/models/mrp_workorder.py | 24 +++++++++---------- sf_manufacturing/views/mrp_workorder_view.xml | 15 ++++++------ 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/sf_machine_connect/views/SfWorkOrderBarcodes.xml b/sf_machine_connect/views/SfWorkOrderBarcodes.xml index d1ba5126..57c216cf 100644 --- a/sf_machine_connect/views/SfWorkOrderBarcodes.xml +++ b/sf_machine_connect/views/SfWorkOrderBarcodes.xml @@ -13,7 +13,7 @@ - + diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index dd474527..6c68084e 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -196,7 +196,7 @@ class MrpProduction(models.Model): ) i += 1 for route in product_routing_workcenter: - if i == 1 and route.routing_type == '获取CNC加工程序': + if i == 1 and route.routing_type == '装夹预制': workorders_values.append( self.env['mrp.workorder'].json_workorder_str('', production, route)) if route.is_repeat is True: @@ -416,10 +416,10 @@ class MrpProduction(models.Model): for work in rec.workorder_ids: work.sequence = current_sequence current_sequence += 1 - if work.name == '获取CNC加工程序': - work.button_start() - #work.fetchCNC() - work.button_finish() + # if work.name == '获取CNC加工程序': + # work.button_start() + # #work.fetchCNC() + # work.button_finish() # 创建工单并进行排序 def _create_workorder(self): diff --git a/sf_manufacturing/models/mrp_routing_workcenter.py b/sf_manufacturing/models/mrp_routing_workcenter.py index 807dfbb5..c8e7d8aa 100644 --- a/sf_manufacturing/models/mrp_routing_workcenter.py +++ b/sf_manufacturing/models/mrp_routing_workcenter.py @@ -6,9 +6,9 @@ class ResMrpRoutingWorkcenter(models.Model): _inherit = 'mrp.routing.workcenter' routing_type = fields.Selection([ - ('获取CNC加工程序', '获取CNC加工程序'), - ('装夹', '装夹'), - ('前置三元定位检测', '前置三元定位检测'), + # ('获取CNC加工程序', '获取CNC加工程序'), + ('装夹预调', '装夹预调'), + # ('前置三元定位检测', '前置三元定位检测'), ('CNC加工', 'CNC加工'), ('后置三元质量检测', '后置三元质量检测'), ('解除装夹', '解除装夹'), diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 7ecec223..2097eabe 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -31,9 +31,9 @@ class ResMrpWorkOrder(models.Model): processing_panel = fields.Char('加工面') sequence = fields.Integer(string='工序') routing_type = fields.Selection([ - ('获取CNC加工程序', '获取CNC加工程序'), - ('装夹', '装夹'), - ('前置三元定位检测', '前置三元定位检测'), + # ('获取CNC加工程序', '获取CNC加工程序'), + ('装夹预调', '装夹预调'), + # ('前置三元定位检测', '前置三元定位检测'), ('CNC加工', 'CNC加工'), ('后置三元质量检测', '后置三元质量检测'), ('解除装夹', '解除装夹'), @@ -204,15 +204,15 @@ class ResMrpWorkOrder(models.Model): if route.routing_type == '切割': duration_expected = self.env['mrp.routing.workcenter'].sudo().search( [('name', '=', '切割')]).time_cycle - elif route.routing_type == '获取CNC加工程序': + # elif route.routing_type == '获取CNC加工程序': + # duration_expected = self.env['mrp.routing.workcenter'].sudo().search( + # [('name', '=', '获取CNC加工程序')]).time_cycle + elif route.routing_type == '装夹预制': duration_expected = self.env['mrp.routing.workcenter'].sudo().search( - [('name', '=', '获取CNC加工程序')]).time_cycle - elif route.routing_type == '工件装夹': - duration_expected = self.env['mrp.routing.workcenter'].sudo().search( - [('name', '=', '工件装夹')]).time_cycle - elif route.routing_type == '前置三元定位检测': - duration_expected = self.env['mrp.routing.workcenter'].sudo().search( - [('name', '=', '前置三元定位检测')]).time_cycle + [('name', '=', '装夹预制')]).time_cycle + # elif route.routing_type == '前置三元定位检测': + # duration_expected = self.env['mrp.routing.workcenter'].sudo().search( + # [('name', '=', '前置三元定位检测')]).time_cycle elif route.routing_type == 'CNC加工': duration_expected = self.env['mrp.routing.workcenter'].sudo().search( [('name', '=', 'CNC加工')]).time_cycle @@ -495,7 +495,7 @@ class ResMrpWorkOrder(models.Model): # 重写工单开始按钮方法 def button_start(self): - if self.routing_type == '装夹' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name: + if self.routing_type == '装夹预制' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name: self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name # 外协出库单,从“正在等待”变为“就绪”状态 if self.is_subcontract is True: diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 53373c51..9bd5ef94 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -162,11 +162,11 @@ + attrs='{"invisible": [("routing_type","!=","装夹预制")]}'/> + attrs='{"invisible": [("routing_type","!=","装夹预制")]}'/> + attrs='{"invisible": [("routing_type","!=","装夹预制")]}'/>
@@ -219,7 +219,7 @@ - + @@ -241,10 +241,7 @@ placeholder="如有预调程序信息请在此处输入....."/> - - - - +
左面:
@@ -397,8 +394,10 @@ + + From 1a896a730e426f29b4fdc526b56bcaf55ca985bc Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Tue, 9 Jan 2024 14:17:38 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=8B=89=E5=8F=96=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_machine_connect/views/SfWorkOrderBarcodes.xml | 2 +- sf_manufacturing/models/mrp_production.py | 2 +- sf_manufacturing/models/mrp_workorder.py | 6 +++--- sf_manufacturing/models/product_template.py | 4 ++-- sf_manufacturing/views/mrp_workorder_view.xml | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sf_machine_connect/views/SfWorkOrderBarcodes.xml b/sf_machine_connect/views/SfWorkOrderBarcodes.xml index 57c216cf..5a24a0b7 100644 --- a/sf_machine_connect/views/SfWorkOrderBarcodes.xml +++ b/sf_machine_connect/views/SfWorkOrderBarcodes.xml @@ -13,7 +13,7 @@ - + diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 3855222d..36a37b0c 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -258,7 +258,7 @@ class MrpProduction(models.Model): ) i += 1 for route in product_routing_workcenter: - if i == 1 and route.routing_type == '装夹预制': + if i == 1 and route.routing_type == '装夹预调': workorders_values.append( self.env['mrp.workorder'].json_workorder_str('', production, route)) if route.is_repeat is True: diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 2097eabe..7b54ebde 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -207,9 +207,9 @@ class ResMrpWorkOrder(models.Model): # elif route.routing_type == '获取CNC加工程序': # duration_expected = self.env['mrp.routing.workcenter'].sudo().search( # [('name', '=', '获取CNC加工程序')]).time_cycle - elif route.routing_type == '装夹预制': + elif route.routing_type == '装夹预调': duration_expected = self.env['mrp.routing.workcenter'].sudo().search( - [('name', '=', '装夹预制')]).time_cycle + [('name', '=', '装夹预调')]).time_cycle # elif route.routing_type == '前置三元定位检测': # duration_expected = self.env['mrp.routing.workcenter'].sudo().search( # [('name', '=', '前置三元定位检测')]).time_cycle @@ -495,7 +495,7 @@ class ResMrpWorkOrder(models.Model): # 重写工单开始按钮方法 def button_start(self): - if self.routing_type == '装夹预制' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name: + if self.routing_type == '装夹预调' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name: self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name # 外协出库单,从“正在等待”变为“就绪”状态 if self.is_subcontract is True: diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 1361a821..759413d2 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -833,9 +833,9 @@ class ResProductFixture(models.Model): fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号') specification_fixture_id = fields.Many2one('sf.fixture.materials.basic.parameters', '夹具规格') - fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", required=True) + fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料") fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name') - multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True) + multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型") model_file = fields.Binary(string="3D模型图") # 夹具物料基本参数 diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 9bd5ef94..8a9214e9 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -162,11 +162,11 @@ + attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> + attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> + attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
@@ -219,7 +219,7 @@ - + @@ -241,7 +241,7 @@ placeholder="如有预调程序信息请在此处输入....."/> - +
左面:
From cac7815369e7cb690710412dd8b1358bbbbc4382 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Tue, 9 Jan 2024 14:47:06 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 36a37b0c..dd3c54e9 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -7,6 +7,8 @@ from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.addons.sf_base.commons.common import Common +from odoo.tools import float_compare, float_is_zero + class MrpProduction(models.Model): _inherit = 'mrp.production' @@ -258,9 +260,6 @@ class MrpProduction(models.Model): ) i += 1 for route in product_routing_workcenter: - if i == 1 and route.routing_type == '装夹预调': - workorders_values.append( - self.env['mrp.workorder'].json_workorder_str('', production, route)) if route.is_repeat is True: workorders_values.append( self.env['mrp.workorder'].json_workorder_str(k, production, route)) From 3f2a13448d242f1d6bfdc61f873d85727b3badb2 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Tue, 9 Jan 2024 16:02:41 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_maintenance/security/ir.model.access.csv | 2 +- sf_manufacturing/security/ir.model.access.csv | 6 ++++-- sf_warehouse/security/ir.model.access.csv | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sf_maintenance/security/ir.model.access.csv b/sf_maintenance/security/ir.model.access.csv index 8870c0ec..877d9b76 100644 --- a/sf_maintenance/security/ir.model.access.csv +++ b/sf_maintenance/security/ir.model.access.csv @@ -8,7 +8,7 @@ access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equi access_maintenance_request_group_plan_dispatch,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0 -access_maintenance_equipment_group_plan_dispatch,maintenance.equipment,maintenance.model_maintenance_equipment,sf_base.group_plan_dispatch,1,1,1,1 +access_maintenance_equipment_group_plan_dispatch,maintenance.equipment,maintenance.model_maintenance_equipment,sf_base.group_plan_dispatch,1,0,0,0 access_sf_maintenance_logs_group_plan_dispatch,sf_maintenance_logs,model_sf_maintenance_logs,sf_base.group_plan_dispatch,1,0,0,0 access_maintenance_standard_image_group_plan_dispatch,maintenance_standard_image,model_maintenance_standard_image,sf_base.group_plan_dispatch,1,0,0,0 access_equipment_maintenance_standards_group_plan_dispatch,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0 diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index 933a2c45..05064e79 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -89,12 +89,14 @@ access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model access_mrp_production,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0 -access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,1,1,0 +access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0 +access_sf_production_line_group_plan_director,sf.production.line,model_sf_production_line,sf_base.group_plan_director,1,1,1,0 access_mrp_workcenter,mrp_workcenter,model_mrp_workcenter,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_bom,mrp.bom,mrp.model_mrp_bom,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_bom_line,mrp.bom.line,mrp.model_mrp_bom_line,sf_base.group_plan_dispatch,1,0,0,0 access_mrp_unbuild,mrp.unbuild,mrp.model_mrp_unbuild,sf_base.group_plan_dispatch,1,1,1,0 -access_stock_scrap,stock.scrap,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,1,1,0 +access_stock_scrap_group_plan_dispatch,stock.scrap,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0 + access_sf_model_type,sf.model.type,model_sf_model_type,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_routing_workcenter,mrp.routing.workcenter,mrp.model_mrp_routing_workcenter,sf_base.group_plan_dispatch,1,1,1,0 access_mrp_document,mrp.document,mrp.model_mrp_document,sf_base.group_plan_dispatch,1,0,0,0 diff --git a/sf_warehouse/security/ir.model.access.csv b/sf_warehouse/security/ir.model.access.csv index b5954085..10c4e172 100644 --- a/sf_warehouse/security/ir.model.access.csv +++ b/sf_warehouse/security/ir.model.access.csv @@ -98,13 +98,11 @@ access_mrp_production,mrp.production,mrp.model_mrp_production,sf_warehouse.group access_sf_shelf_location_group_plan_dispatch,sf.shelf.location,model_sf_shelf_location,sf_base.group_plan_dispatch,1,1,0,0 access_stock_move,stock.move,stock.model_stock_move,sf_base.group_plan_dispatch,1,1,1,0 -access_stock_scrap_user,stock.scrap.user,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0 -access_stock_scrap_manager,stock.scrap.manager,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0 access_stock_picking,stock.picking,stock.model_stock_picking,sf_base.group_plan_dispatch,1,0,0,0 access_stock_lot_group_plan_dispatch,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,0,0,0 access_stock_lot_group_plan_director,stock.lot,stock.model_stock_lot,sf_base.group_plan_director,1,1,1,0 access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,sf_base.group_plan_dispatch,1,1,0,0 -access_stock_quant,stock.quant,stock.model_stock_quant,sf_base.group_plan_dispatch,1,1,1,0 + access_product_product,product.product,product.model_product_product,sf_base.group_plan_dispatch,1,0,0,0 access_product_template,product.template,product.model_product_template,sf_base.group_plan_dispatch,1,0,0,0