Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/刀具物料与夹具物料的反注册
This commit is contained in:
@@ -21,7 +21,8 @@ class MachineControlSystem(models.Model):
|
||||
_description = '控制系统'
|
||||
|
||||
code = fields.Char('编码', size=10)
|
||||
name = fields.Char('名称', size=10)
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Char('备注')
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@@ -35,10 +36,10 @@ class MachineBrand(models.Model):
|
||||
name = fields.Char('名称')
|
||||
tag_ids = fields.Many2many('sf.machine.brand.tags', 'rel_machine_brand_tags', string='类别')
|
||||
image_brand = fields.Image("品牌图片")
|
||||
manufacturer_model_number = fields.Char('厂家型号', size=10)
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 机床
|
||||
class MachineTool(models.Model):
|
||||
_name = 'sf.machine_tool'
|
||||
@@ -315,6 +316,7 @@ class MachineToolCategory(models.Model):
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
category = fields.Selection([('shukong', u'数控'), ('putong', u'普通')], string=u'机床类别',
|
||||
default='shukong')
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ class FixtureModel(models.Model):
|
||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True)
|
||||
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
||||
manufacturer_model_number = fields.Char(string="厂家型号")
|
||||
clamping_way = fields.Char(string="装夹方式")
|
||||
port_type = fields.Char(string="接口类型")
|
||||
model_file = fields.Binary(string="3D模型图")
|
||||
@@ -52,5 +51,7 @@ class FixtureModel(models.Model):
|
||||
string="适用机床型号")
|
||||
through_hole_size = fields.Integer(string="过孔大小[mm]", size=6)
|
||||
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
from odoo import models, fields
|
||||
|
||||
'''============================定位元件型号====================================='''
|
||||
|
||||
|
||||
class FixtureSettingElement(models.Model):
|
||||
_name = 'sf.fixture.setting.element'
|
||||
_description = "定位元件型号"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="型号名称", readonly=True)
|
||||
setting_ele_type_id = fields.Many2one('sf.setting.element.type', string="定位元件类型", readonly=True)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", readonly=True)
|
||||
|
||||
length = fields.Char(string='长度(mm)', readonly=True)
|
||||
width = fields.Char(string='宽度(mm)', readonly=True)
|
||||
height = fields.Char(string='高度(mm)', readonly=True)
|
||||
diameter = fields.Char(string='直径(mm)', readonly=True)
|
||||
|
||||
material_type_id = fields.Many2one('sf.materials.model', string='材料型号', readonly=True)
|
||||
hardness = fields.Char(string='硬度(°)', readonly=True)
|
||||
chucking_power = fields.Char(string='夹持力', readonly=True)
|
||||
surface_treatment = fields.Char(string='表面处理', readonly=True)
|
||||
accuracy_grade = fields.Char(string='精度等级', readonly=True)
|
||||
|
||||
picture = fields.Binary(string="图片", readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''=============================定位原件类型============================================='''
|
||||
|
||||
|
||||
class SettingElementType(models.Model):
|
||||
_name = 'sf.setting.element.type'
|
||||
_description = "定位原件类型"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string='定位原件类型', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''==============================夹紧元件型号=============================================='''
|
||||
|
||||
|
||||
class FixtureClampingElement(models.Model):
|
||||
_name = 'sf.fixture.clamping.element'
|
||||
_description = "夹紧元件型号"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="型号名称", readonly=True)
|
||||
clamping_ele_type_id = fields.Many2one('sf.clamping.element.type', string="夹紧元件类型", readonly=True)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", readonly=True)
|
||||
|
||||
length = fields.Char(string='长度(mm)', readonly=True)
|
||||
width = fields.Char(string='宽度(mm)', readonly=True)
|
||||
height = fields.Char(string='高度(mm)', readonly=True)
|
||||
diameter = fields.Char(string='直径(mm)', readonly=True)
|
||||
|
||||
material_type_id = fields.Many2one('sf.materials.model', string='材料型号', readonly=True)
|
||||
hardness = fields.Char(string='硬度(°)', readonly=True)
|
||||
chucking_power = fields.Char(string='夹持力', readonly=True)
|
||||
surface_treatment = fields.Char(string='夹持方式', readonly=True)
|
||||
accuracy_grade = fields.Char(string='精度等级', readonly=True)
|
||||
|
||||
picture = fields.Binary(string="图片", readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''============================夹紧元件类型======================================='''
|
||||
|
||||
|
||||
# 夹紧元件类型
|
||||
class ClampingElementType(models.Model):
|
||||
_name = "sf.clamping.element.type"
|
||||
_description = "夹紧元件类型"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(name='夹紧元件类型', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''=========================对刀夹具型号====================================='''
|
||||
|
||||
|
||||
class FixtureToolSetting(models.Model):
|
||||
_name = 'sf.fixture.tool.setting'
|
||||
_description = "对刀夹具型号"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="型号名称", readonly=True)
|
||||
tool_setting_type_id = fields.Many2one('sf.tool.setting.type', string="对刀夹具类型", readonly=True)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", readonly=True)
|
||||
|
||||
length = fields.Char(string='长度(mm)', readonly=True)
|
||||
width = fields.Char(string='宽度(mm)', readonly=True)
|
||||
height = fields.Char(string='高度(mm)', readonly=True)
|
||||
diameter = fields.Char(string='直径(mm)', readonly=True)
|
||||
|
||||
material_type_id = fields.Many2one('sf.materials.model', string='材料型号', readonly=True)
|
||||
hardness = fields.Char(string='硬度(°)', readonly=True)
|
||||
chucking_power = fields.Char(string='夹持力', readonly=True)
|
||||
clamp_mode = fields.Char(string='夹持方式', readonly=True)
|
||||
accuracy_grade = fields.Char(string='精度等级', readonly=True)
|
||||
max_clamp_diameter = fields.Char('最大夹持直接(mm)', readonly=True)
|
||||
|
||||
picture = fields.Binary(string="图片", readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''===========================对刀夹具类型=========================================='''
|
||||
|
||||
|
||||
class ToolSettingType(models.Model):
|
||||
_name = 'sf.tool.setting.type'
|
||||
_description = "对刀夹具类型"
|
||||
|
||||
code = fields.Char('编码', readonly=True)
|
||||
name = fields.Char(string='对刀夹具类型', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''==========================定位装置型号======================================='''
|
||||
|
||||
|
||||
class FixtureLocatingDevice(models.Model):
|
||||
_name = 'sf.fixture.locating.device'
|
||||
_description = "定位装置型号"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="型号名称", readonly=True)
|
||||
locating_device_type_id = fields.Many2one('sf.locating.device.type', string="定位装置类型", readonly=True)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", readonly=True)
|
||||
|
||||
length = fields.Char(string='长度(mm)', readonly=True)
|
||||
width = fields.Char(string='宽度(mm)', readonly=True)
|
||||
height = fields.Char(string='高度(mm)', readonly=True)
|
||||
diameter = fields.Char(string='直径(mm)', readonly=True)
|
||||
|
||||
material_type_id = fields.Many2one('sf.materials.model', string='材料型号', readonly=True)
|
||||
weight = fields.Char(string='重量(kg)', readonly=True)
|
||||
accuracy_grade = fields.Char(string='精度等级', readonly=True)
|
||||
locate_mode_ids = fields.Many2many('sf.locating.device.locate.mode', string='定位装置定位方式', readonly=True)
|
||||
max_bearing_capacity = fields.Char(string='最大承载力', readonly=True)
|
||||
|
||||
picture = fields.Binary(string="图片", readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''==============================定位装置类型================================'''
|
||||
|
||||
|
||||
# 定位装置型号
|
||||
class LocatingDeviceType(models.Model):
|
||||
_name = 'sf.locating.device.type'
|
||||
_description = "定位装置类型"
|
||||
|
||||
code = fields.Char('编码', readonly=True)
|
||||
name = fields.Char(string='定位装置类型', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''============================定位装置定位方式========================================'''
|
||||
|
||||
|
||||
# 定位装置定位方式
|
||||
class LocatingDeviceLocateMode(models.Model):
|
||||
_name = 'sf.locating.device.locate.mode'
|
||||
_description = "定位装置定位方式"
|
||||
|
||||
code = fields.Char('编码', readonly=True)
|
||||
name = fields.Char('定位方式', readonly=True)
|
||||
name_id = fields.Many2many('sf.fixture.locating.device', string='定位装置', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''===========================导向元件型号===================================='''
|
||||
|
||||
|
||||
class FixtureGuideElement(models.Model):
|
||||
_name = 'sf.fixture.guide.element'
|
||||
_description = "导向元件型号"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="型号名称", readonly=True)
|
||||
guide_ele_type_id = fields.Many2one('sf.guide.element.type', string="导向元件类型", readonly=True)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", readonly=True)
|
||||
|
||||
length = fields.Char(string='长度(mm)', readonly=True)
|
||||
width = fields.Char(string='宽度(mm)', readonly=True)
|
||||
height = fields.Char(string='高度(mm)', readonly=True)
|
||||
diameter = fields.Char(string='直径(mm)', readonly=True)
|
||||
|
||||
material_type_id = fields.Many2one('sf.materials.model', string='材料型号', readonly=True)
|
||||
weight = fields.Char(string='重量', readonly=True)
|
||||
accuracy_grade = fields.Char(string='精度等级', readonly=True)
|
||||
guide_ele_guide_mode_id = fields.Many2many('sf.guide.element.guide.mode', string='导向元件导向方式', readonly=True)
|
||||
scope_of_application = fields.Char(string='适用范围', readonly=True)
|
||||
guide_ele_way_to_install_id = fields.Many2many('sf.guide.element.way.to.install', string='导向元件安装方式',
|
||||
readonly=True)
|
||||
|
||||
picture = fields.Binary(string="图片", readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''=============================导向元件类型============================================'''
|
||||
|
||||
|
||||
class GuideElementType(models.Model):
|
||||
_name = 'sf.guide.element.type'
|
||||
_description = "导向元件类型"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="导向元件类型", readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''================================导向元件导向方式=========================================='''
|
||||
|
||||
|
||||
class GuideElementGuideMode(models.Model):
|
||||
_name = 'sf.guide.element.guide.mode'
|
||||
_description = "导向元件导向方式"
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="导向元件导向方式", readonly=True)
|
||||
name_id = fields.Many2many('sf.fixture.guide.element', string='导向元件', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
|
||||
|
||||
'''=============================导向元件安装方式==========================================='''
|
||||
|
||||
|
||||
class GuideElementWayToInstall(models.Model):
|
||||
_name = 'sf.guide.element.way.to.install'
|
||||
_description = '导向元件安装方式'
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
name = fields.Char(string="导向元件安装方式", readonly=True)
|
||||
name_id = fields.Many2many('sf.fixture.guide.element', string='导向元件', readonly=True)
|
||||
comment = fields.Text(string='备注', readonly=True)
|
||||
@@ -37,7 +37,7 @@ class FunctionalFixture(models.Model):
|
||||
vice_tray_model_ids = fields.Many2many('sf.fixture.model', 'rel_fixture_model_vice_tray', string="虎钳托盘型号",
|
||||
domain=[('fixture_material_type', '=', '虎钳托盘')])
|
||||
registration_status = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册', tracking=True)
|
||||
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@api.onchange('type_id')
|
||||
def _onchange_type_id(self):
|
||||
|
||||
@@ -15,6 +15,7 @@ class CuttingToolMaterial(models.Model):
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 功能刀具
|
||||
@@ -43,6 +44,7 @@ class FunctionalCuttingTool(models.Model):
|
||||
is_standard = fields.Boolean('是否标准刀')
|
||||
applicable_range = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 功能刀具类型
|
||||
@@ -53,6 +55,7 @@ class FunctionalCuttingToolModel(models.Model):
|
||||
name = fields.Char('名称')
|
||||
code = fields.Char('编码')
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 整体式刀具
|
||||
@@ -82,6 +85,7 @@ class IntegralCuttingTool(models.Model):
|
||||
chuck_model = fields.Many2many('sf.chuck', string='适用夹头型号')
|
||||
scope = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 整体式刀具类型
|
||||
|
||||
@@ -14,6 +14,7 @@ class CuttingToolMaterial(models.Model):
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 功能刀具
|
||||
@@ -68,6 +69,7 @@ class FunctionalCuttingTool(models.Model):
|
||||
is_standard = fields.Boolean('是否标准刀')
|
||||
applicable_range = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
def _get_functional_tool_model_ids(self, functional_tool_model_code):
|
||||
functional_tool_model_ids = []
|
||||
@@ -85,6 +87,7 @@ class FunctionalCuttingToolModel(models.Model):
|
||||
name = fields.Char('名称', required=True)
|
||||
code = fields.Char('编码', required=True)
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 刀具型号
|
||||
@@ -264,6 +267,7 @@ class CuttingToolModel(models.Model):
|
||||
hide_chuck = fields.Boolean(compute='_compute_hide_model_number', default=False, string='隐藏夹头')
|
||||
hide_model = fields.Boolean(compute='_compute_hide_model_number', default=True, string='隐藏型号')
|
||||
image_is_visible = fields.Boolean(compute='_compute_image_is_visible', default=True, string='隐藏图片')
|
||||
active = fields.Boolean(default=True, string='有效')
|
||||
|
||||
@api.depends('mrs_cutting_tool_material_id')
|
||||
def _compute_image_is_visible(self):
|
||||
|
||||
Reference in New Issue
Block a user