处理冲突

This commit is contained in:
qihao.gong@jikimo.com
2023-06-16 10:02:33 +08:00
parent e9ad452c43
commit 018fecfc59
25 changed files with 2855 additions and 905 deletions

View File

@@ -1,5 +1,6 @@
from . import base
from . import common
from . import tool_base
from . import fixture_base

View File

@@ -304,33 +304,6 @@ class MachineToolType(models.Model):
code = fields.Char('编码')
# 刀具
class CuttingTool(models.Model):
_name = 'sf.cutting_tool.category'
_description = '刀具类别'
code = fields.Char('编码')
name = fields.Char('名称')
remark = fields.Text('备注')
active = fields.Boolean('有效', default=True)
class CuttingToolType(models.Model):
_name = 'sf.cutting_tool.type'
_description = '刀具型号'
code = fields.Char('编码')
name = fields.Char('名称')
diameter = fields.Integer('直径')
long_blade = fields.Integer('避空长/刃长')
cone_angle_pitch = fields.Integer('锥角/节距')
shank_diameter = fields.Integer('柄径')
taper_shank_length = fields.Integer('锥柄长')
tool_length = fields.Integer('刀具总长')
blade_number = fields.Integer('刃数')
category_id = fields.Many2one('sf.cutting_tool.category', string='刀具类别')
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
remark = fields.Text('备注')
active = fields.Boolean('有效', default=True)
class MachineToolCategory(models.Model):
_name = 'sf.machine_tool.category'
_description = '机床类型'

View File

@@ -0,0 +1,240 @@
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)

View File

@@ -7,6 +7,16 @@ from odoo.exceptions import UserError
from datetime import datetime
# 功能刀具物料
class CuttingToolMaterial(models.Model):
_name = 'sf.cutting.tool.material'
_description = '刀具物料'
code = fields.Char('编码')
name = fields.Char('名称')
remark = fields.Char('备注')
# 功能刀具
class FunctionalCuttingTool(models.Model):
_name = 'sf.functional.cutting.tool'
@@ -53,6 +63,8 @@ class IntegralCuttingTool(models.Model):
code = fields.Char('编码')
name = fields.Char('型号名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 整体式刀具类型字段,关联整体式刀具类型对象
integral_model_number = fields.Many2one('sf.integral.cutting.tool.model', '整体式刀具类型')
# 增加品牌、总长度(mm)、柄部长度(mm)、刃部长度(mm)、直径(mm)、刃数、前角(°)、后角(°)、主偏角(°)、材料型号、配对螺母(mm)、适用夹头型号、适用范围、图片、创建人、创建时间等字段
@@ -80,6 +92,8 @@ class IntegralCuttingToolModel(models.Model):
code = fields.Char('编码')
name = fields.Char('名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
remark = fields.Text('备注')
@@ -90,10 +104,12 @@ class Blade(models.Model):
code = fields.Char('编码')
name = fields.Char('型号名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 刀片类型字段,关联刀片类型对象
blade_model_number = fields.Many2one('sf.blade.model', '刀片类型')
# 编码、型号名称、刀片类型、品牌、长度L(mm)、宽度D(mm)、高度T(mm)、顶角(°)、前角(°)、后角(°)、主偏角(°)、R角(°)、材料型号、加工硬度、配对螺母(mm)、适用刀杆/刀盘型号、刀尖半径(mm)、图片、创建人、创建时间字段
brand = fields.Many2one('sf.machine.brand', '品牌',)
brand = fields.Many2one('sf.machine.brand', '品牌', )
length = fields.Float('长度L(mm)')
width = fields.Float('宽度D(mm)')
height = fields.Float('高度T(mm)')
@@ -120,6 +136,8 @@ class BladeModel(models.Model):
code = fields.Char('编码')
name = fields.Char('名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 刀片类型字段,关联刀片对象
blade_ids = fields.One2many('sf.blade', 'blade_model_number', '刀片类型')
remark = fields.Text('备注')
@@ -132,6 +150,8 @@ class CutterBar(models.Model):
code = fields.Char('编码')
name = fields.Char('型号名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 刀杆类型字段,关联刀杆类型对象
cutter_bar_model_number = fields.Many2one('sf.cutter.bar.model', '刀杆类型')
# 品牌、C柄径(mm)、L总长(mm)、材料型号、刃数、D刃径(mm)、适用刀片型号、配对扳手(mm)、配备螺丝(mm)、刀尖圆角半径、精度等级、硬度(°)、适用范围、图片、创建人、创建时间
@@ -158,6 +178,8 @@ class CutterBarModel(models.Model):
code = fields.Char('编码')
name = fields.Char('名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
remark = fields.Text('备注')
@@ -168,6 +190,8 @@ class CutterPad(models.Model):
code = fields.Char('编码')
name = fields.Char('型号名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 刀盘类型字段,关联刀盘类型对象
cutter_pad_model_number = fields.Many2one('sf.cutter.pad.model', '刀盘类型')
# 增加品牌、C柄径(mm)、L总长(mm)、材料型号、刃数、D刃径(mm)、适用刀片型号、配对扳手(mm)、配备螺丝(mm)、刀尖圆角半径、精度等级、硬度(°)、适用范围、图片、创建人、创建时间
@@ -194,6 +218,8 @@ class CutterPadModel(models.Model):
code = fields.Char('编码')
name = fields.Char('名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
remark = fields.Text('备注')
@@ -204,6 +230,8 @@ class Handle(models.Model):
code = fields.Char('编码')
name = fields.Char('型号名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 刀柄类型字段,关联刀柄类型对象
handle_model_number = fields.Many2one('sf.handle.model', '刀柄类型')
# 增加、刀柄类型、品牌、L(mm)、L1(mm)、D1(mm)、重量(kg)、材料型号、本体精度(mm)、配对螺母(mm)、适用夹头型号、夹持范围(mm)、检测精度、检测硬度、标准转速、图片、创建人、创建时间
@@ -230,6 +258,8 @@ class HandleModel(models.Model):
code = fields.Char('编码')
name = fields.Char('名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
remark = fields.Text('备注')
@@ -237,9 +267,12 @@ class HandleModel(models.Model):
class Chuck(models.Model):
_name = 'sf.chuck'
_description = '夹头'
_rec_name = 'code'
code = fields.Char('编码')
name = fields.Char('型号名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
# 夹头类型字段,关联夹头类型对象
chuck_model_number = fields.Many2one('sf.chuck.model', '夹头类型')
# 增加品牌、精度(mm)、外径(mm)、内径(mm)、高度(mm)、材料型号、配对螺母(mm)、适用刀柄型号、夹持范围(mm)、特性、图片、创建人、创建时间
@@ -263,5 +296,6 @@ class ChuckModel(models.Model):
code = fields.Char('编码')
name = fields.Char('名称')
# 关联刀具物料
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
remark = fields.Text('备注')