Accept Merge Request #758: (feature/功能刀具新增字段 -> develop)
Merge Request: 1、删除产品中和夹具相关的无用代码;2、添加夹具型号和联装类型必填判断条件 Created By: @禹翔辉 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/758
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
placeholder="请选择"/>
|
placeholder="请选择"/>
|
||||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '夹具')],'required': [('categ_type', '=', '夹具')]}"
|
||||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||||
<field name="specification_fixture_id" string="规格" placeholder="请选择"
|
<field name="specification_fixture_id" string="规格" placeholder="请选择"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
@@ -318,7 +318,7 @@
|
|||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_thread_num"
|
<field name="cutting_tool_thread_num"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_thickness_tolerance"
|
<field name="cutting_tool_thickness_tolerance"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
||||||
options="{'no_create': True}"
|
options="{'no_create': True}"
|
||||||
@@ -453,7 +453,8 @@
|
|||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="brand_id" placeholder="请选择"/>
|
<field name="brand_id" placeholder="请选择"/>
|
||||||
<field name="multi_mounting_type_id" placeholder="请选择"/>
|
<field name="multi_mounting_type_id" placeholder="请选择"
|
||||||
|
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
||||||
<field name="length" string="长度(mm)"/>
|
<field name="length" string="长度(mm)"/>
|
||||||
<field name="width" string="宽度(mm)"/>
|
<field name="width" string="宽度(mm)"/>
|
||||||
<field name="height" string="高度(mm)"/>
|
<field name="height" string="高度(mm)"/>
|
||||||
|
|||||||
@@ -515,36 +515,6 @@ class ResProductMo(models.Model):
|
|||||||
if self.tool_thickness > 1000000:
|
if self.tool_thickness > 1000000:
|
||||||
raise ValidationError("厚度不能超过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):
|
def _json_apply_machine_tool_type_item_code(self, item):
|
||||||
code_arr = []
|
code_arr = []
|
||||||
for i in item.product_id.fixture_apply_machine_tool_type_ids:
|
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.detailed_type = 'product'
|
||||||
self.sale_ok = False
|
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):
|
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')
|
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':
|
if product_length_in_feet_param == '1':
|
||||||
@@ -833,15 +737,12 @@ class ResProductFixture(models.Model):
|
|||||||
fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号')
|
fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号')
|
||||||
specification_fixture_id = fields.Many2one('sf.fixture.materials.basic.parameters', '夹具规格')
|
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')
|
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模型图")
|
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))
|
diameter = fields.Float('直径(mm)', digits=(16, 2))
|
||||||
|
|
||||||
# '零点卡盘' 字段
|
# '零点卡盘' 字段
|
||||||
|
|||||||
Reference in New Issue
Block a user