From 8332c5d1411f8aee568d8ee6e82a0c6123c9f489 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Tue, 9 Jan 2024 11:15:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1=E3=80=81=E5=88=A0=E9=99=A4=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=B8=AD=E5=92=8C=E5=A4=B9=E5=85=B7=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81=EF=BC=9B2?= =?UTF-8?q?=E3=80=81=E6=B7=BB=E5=8A=A0=E5=A4=B9=E5=85=B7=E5=9E=8B=E5=8F=B7?= =?UTF-8?q?=E5=92=8C=E8=81=94=E8=A3=85=E7=B1=BB=E5=9E=8B=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product_template_management_view.xml | 7 +- sf_manufacturing/models/product_template.py | 103 +----------------- 2 files changed, 6 insertions(+), 104 deletions(-) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 94cb4b7f..7b42320e 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -39,7 +39,7 @@ - - + diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 1361a821..eeb9bd0d 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -515,36 +515,6 @@ class ResProductMo(models.Model): if self.tool_thickness > 1000000: raise ValidationError("厚度不能超过1000000") - @api.constrains('fixture_clamp_workpiece_length_max') - def _check_fixture_clamp_workpiece_length_max_size(self): - if self.fixture_clamp_workpiece_length_max > 1000000: - raise ValidationError("夹持工件长度MAX不能超过1000000") - - @api.constrains('fixture_clamp_workpiece_width_max') - def _check_fixture_clamp_workpiece_width_max_size(self): - if self.fixture_clamp_workpiece_width_max > 1000000: - raise ValidationError("夹持工件宽度MAX不能超过1000000") - - @api.constrains('fixture_clamp_workpiece_height_max') - def _check_fixture_clamp_workpiece_height_max_size(self): - if self.fixture_clamp_workpiece_height_max > 1000000: - raise ValidationError("夹持工件高度MAX不能超过1000000") - - @api.constrains('fixture_maximum_clamping_force') - def _check_fixture_maximum_clamping_force_size(self): - if self.fixture_maximum_clamping_force > 100000000: - raise ValidationError("最大夹持力不能超过100000000") - - @api.constrains('fixture_through_hole_size') - def _check_fixture_through_hole_size_size(self): - if self.fixture_through_hole_size > 1000000: - raise ValidationError("过孔大小不能超过1000000") - - @api.constrains('fixture_screw_size') - def _check_fixture_through_hole_size_size(self): - if self.fixture_screw_size > 1000000: - raise ValidationError("螺牙大小不能超过1000000") - def _json_apply_machine_tool_type_item_code(self, item): code_arr = [] for i in item.product_id.fixture_apply_machine_tool_type_ids: @@ -584,72 +554,6 @@ class ResProductMo(models.Model): self.detailed_type = 'product' self.sale_ok = False - @api.onchange('fixture_material_id') - def _onchange_fixture_material_id(self): - for item in self: - if item.fixture_material_id.id != item.fixture_model_id.fixture_material_id.id: - item.fixture_model_id = False - - # - # @api.onchange('fixture_model_id') - # def _onchange_fixture_model_id(self): - # for item in self: - # if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']: - # item.brand_id = item.fixture_model_id.brand_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 - # item.tool_height = item.fixture_model_id.height - # item.tool_weight = item.fixture_model_id.weight - # item.materials_type_id = item.fixture_model_id.materials_model_id.id - # item.fixture_maximum_carrying_weight = item.fixture_model_id.maximum_carrying_weight - # item.fixture_maximum_clamping_force = item.fixture_model_id.maximum_clamping_force - # if self.fixture_material_type in ['零点卡盘', '转接板(锁板)夹具']: - # item.fixture_clamping_way = item.fixture_model_id.clamping_way - # item.fixture_port_type = item.fixture_model_id.port_type - # if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具']: - # item.fixture_driving_way = item.fixture_model_id.driving_way - # if self.fixture_material_type in ['气动夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']: - # item.fixture_through_hole_size = item.fixture_model_id.through_hole_size - # item.fixture_screw_size = item.fixture_model_id.screw_size - # if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具']: - # item.fixture_clamp_workpiece_length_max = item.fixture_model_id.clamp_workpiece_length_max - # item.fixture_clamp_workpiece_width_max = item.fixture_model_id.clamp_workpiece_width_max - # item.fixture_clamp_workpiece_height_max = item.fixture_model_id.clamp_workpiece_height_max - # item.fixture_clamp_workpiece_diameter_max = item.fixture_model_id.clamp_workpiece_diameter_max - # item.fixture_apply_machine_tool_type_ids = self._get_ids( - # item.fixture_model_id.apply_machine_tool_type_ids) - - # @api.onchange('fixture_model_id') - # def _onchange_fixture_model_id(self): - # 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 - # item.tool_height = item.fixture_model_id.height - # item.tool_weight = item.fixture_model_id.weight - # item.materials_type_id = item.fixture_model_id.materials_model_id.id - # item.fixture_maximum_carrying_weight = item.fixture_model_id.maximum_carrying_weight - # item.fixture_maximum_clamping_force = item.fixture_model_id.maximum_clamping_force - # if self.fixture_material_type in ['零点卡盘', '转接板(锁板)夹具']: - # item.fixture_clamping_way = item.fixture_model_id.clamping_way - # item.fixture_port_type = item.fixture_model_id.port_type - # if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具']: - # item.fixture_driving_way = item.fixture_model_id.driving_way - # if self.fixture_material_type in ['气动夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']: - # item.fixture_through_hole_size = item.fixture_model_id.through_hole_size - # item.fixture_screw_size = item.fixture_model_id.screw_size - # if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具']: - # item.fixture_clamp_workpiece_length_max = item.fixture_model_id.clamp_workpiece_length_max - # item.fixture_clamp_workpiece_width_max = item.fixture_model_id.clamp_workpiece_width_max - # item.fixture_clamp_workpiece_height_max = item.fixture_model_id.clamp_workpiece_height_max - # item.fixture_clamp_workpiece_diameter_max = item.fixture_model_id.clamp_workpiece_diameter_max - # item.fixture_apply_machine_tool_type_ids = self._get_ids( - # item.fixture_model_id.apply_machine_tool_type_ids) - def _get_volume_uom_id_from_ir_config_parameter(self): product_length_in_feet_param = self.env['ir.config_parameter'].sudo().get_param('product.volume_in_cubic_feet') if product_length_in_feet_param == '1': @@ -833,15 +737,12 @@ 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模型图") # 夹具物料基本参数 - # 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)) # '零点卡盘' 字段 From 3c3ffa1ebc0c84457642aa1f42a4dea3447ef737 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Tue, 9 Jan 2024 12:01:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=A1=AE=E8=AE=A4=E6=8C=89=E9=92=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=982.=E4=BF=AE=E5=A4=8D=E6=B6=89?= =?UTF-8?q?=E5=8F=8A=E9=80=82=E5=90=88=E5=86=B7=E5=8D=B4=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84=E7=9B=B8=E5=85=B3=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=86=85=E8=AF=A5=E5=AD=97=E6=AE=B5=E7=9A=84=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B63.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E7=9A=84=E9=80=82=E5=90=88=E5=88=80=E6=9F=84?= =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B4.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/tool_base_new.py | 4 +-- .../product_template_management_view.xml | 2 +- sf_manufacturing/models/product_template.py | 27 +++++++++---------- sf_sale/models/sale_order.py | 2 +- sf_sale/views/purchase_order_view.xml | 5 ++-- sf_sale/views/sale_order_view.xml | 2 +- sf_tool_management/models/base.py | 4 +-- .../models/tool_material_search.py | 4 +-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sf_base/models/tool_base_new.py b/sf_base/models/tool_base_new.py index 1c7219bc..33d23ecb 100644 --- a/sf_base/models/tool_base_new.py +++ b/sf_base/models/tool_base_new.py @@ -89,8 +89,8 @@ class CuttingToolModel(models.Model): '柄部类型', domain=[('type', '=', '柄部类型')]) cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'cutting_direction_library_rel', '走刀方向', domain=[('type', '=', '走刀方向')]) - suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'suitable_coolant_library_rel', - '适合冷却液', domain=[('type', '=', '冷却液')]) + suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'suitable_coolants_library_rel', + '适合冷却方式', domain=[('type', '=', '冷却方式')]) compaction_way_id = fields.Many2one('maintenance.equipment.image', '压紧方式', domain=[('type', '=', '压紧方式')]) integral_tool_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters', diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 94cb4b7f..9ffd7462 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -338,7 +338,7 @@ attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/> - - + @@ -25,9 +25,10 @@