解决冲突

This commit is contained in:
mgw
2023-06-12 14:35:14 +08:00
parent e0983d0530
commit 3d04200ca7
167 changed files with 3468 additions and 7898 deletions

View File

@@ -84,7 +84,31 @@ class MachineTool(models.Model):
state = fields.Selection(
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
default='正常', string="机床状态")
#0606新增字段
machine_tool_picture = fields.Binary('机床图片')
heightened_way = fields.Selection([
('sifudianji', '伺服电机驱动'),
('youyagang', '油压缸驱动'),
('chilunjia', '齿轮架驱动')
], string="主轴加高方式", default='sifudianji')
workpiece_load = fields.Char('工件负载')
lead_screw = fields.Char('丝杆')
workbench_L = fields.Char('工作台长度(mm)')
workbench_W = fields.Char('工作台宽度(mm)')
guide_rail = fields.Char('导轨')
machine_tool_L = fields.Char('机床长度(mm)')
machine_tool_W = fields.Char('机床宽度(mm)')
machine_tool_H = fields.Char('机床高度(mm)')
feed_speed = fields.Char('进给速度(mm/min)')
tool_speed = fields.Char('刀具速度')
distance = fields.Char('主轴端面至工作台面距离(mm)')
taper = fields.Char('主轴锥度(°)')
torque = fields.Char('主轴点击扭矩(n/m)')
motor_power = fields.Char('主轴电机功率(kw)')
tool_quality_max = fields.Char('刀具最大质量')
tool_long_max = fields.Char('刀具最大长度')
tool_diameter_max = fields.Char('刀具最大刀径')
machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型')
# 一个机床对应一個加工工厂,一个加工工厂对应多个机床
factory_id = fields.Many2one('res.partner', string='所属工厂',
domain="[('is_factory', '=', True)]")
@@ -152,6 +176,26 @@ class MachineTool(models.Model):
item.z_axis = item.type_id.z_axis
item.b_axis = item.type_id.b_axis
item.c_axis = item.type_id.c_axis
item.machine_tool_picture = item.type_id.machine_tool_picture
item.heightened_way = item.type_id.heightened_way
item.workpiece_load = item.type_id.workpiece_load
item.lead_screw = item.type_id.lead_screw
item.workbench_L = item.type_id.workbench_L
item.workbench_W = item.type_id.workbench_W
item.guide_rail = item.type_id.guide_rail
item.machine_tool_L = item.type_id.machine_tool_L
item.machine_tool_W = item.type_id.machine_tool_W
item.machine_tool_H = item.type_id.machine_tool_H
item.feed_speed = item.type_id.feed_speed
item.tool_speed = item.type_id.tool_speed
item.distance = item.type_id.distance
item.taper = item.type_id.taper
item.torque = item.type_id.torque
item.motor_power = item.type_id.motor_power
item.tool_quality_max = item.type_id.tool_quality_max
item.tool_long_max = item.type_id.tool_long_max
item.tool_diameter_max = item.type_id.tool_diameter_max
item.machine_tool_category = item.type_id.machine_tool_category.id
# 注册同步机床
def enroll_machine_tool(self):
@@ -214,6 +258,33 @@ class MachineToolType(models.Model):
default="", string="刀把类型")
number_of_knife_library = fields.Integer('刀库数量')
rotate_speed = fields.Integer('转速')
#0606新增字段
created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
machine_tool_picture = fields.Binary('机床图片')
heightened_way = fields.Selection([
('sifudianji', '伺服电机驱动'),
('youyagang', '油压缸驱动'),
('chilunjia', '齿轮架驱动')
], string="主轴加高方式", default='sifudianji')
workpiece_load = fields.Char('工件负载')
lead_screw = fields.Char('丝杆')
workbench_L = fields.Char('工作台长度(mm)')
workbench_W = fields.Char('工作台宽度(mm)')
guide_rail = fields.Char('导轨')
machine_tool_L = fields.Char('机床长度(mm)')
machine_tool_W = fields.Char('机床宽度(mm)')
machine_tool_H = fields.Char('机床高度(mm)')
feed_speed = fields.Char('进给速度(mm/min)')
tool_speed = fields.Char('刀具速度')
distance = fields.Char('主轴端面至工作台面距离(mm)')
taper = fields.Char('主轴锥度(°)')
torque = fields.Char('主轴点击扭矩(n/m)')
motor_power = fields.Char('主轴电机功率(kw)')
tool_quality_max = fields.Char('刀具最大质量')
tool_long_max = fields.Char('刀具最大长度')
tool_diameter_max = fields.Char('刀具最大刀径')
machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型')
# 多个型号对应一个机床
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
number_of_axles = fields.Selection(
@@ -259,3 +330,14 @@ class CuttingToolType(models.Model):
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 = '机床类型'
code = fields.Char('编码')
name = fields.Char('名称')
remark = fields.Text('备注')
category = fields.Selection([('shukong', u'数控'), ('putong', u'普通')], string=u'机床类别',
default='shukong')