修改设备参数以及机床型号基础参数以及同步cloud方法

This commit is contained in:
qihao.gong@jikimo.com
2023-08-07 16:00:26 +08:00
parent 0838ff417f
commit f0e1939b95
7 changed files with 198 additions and 153 deletions

View File

@@ -267,7 +267,7 @@ class MachineToolType(models.Model):
('youyagang', '油压缸驱动'), ('youyagang', '油压缸驱动'),
('chilunjia', '齿轮架驱动') ('chilunjia', '齿轮架驱动')
], string="主轴加高方式", default='sifudianji') ], string="主轴加高方式", default='sifudianji')
workpiece_load = fields.Char('工件负载') workpiece_load = fields.Char('工件最大负载(kg)')
lead_screw = fields.Char('丝杆') lead_screw = fields.Char('丝杆')
workbench_L = fields.Char('工作台长度(mm)') workbench_L = fields.Char('工作台长度(mm)')
workbench_W = fields.Char('工作台宽度(mm)') workbench_W = fields.Char('工作台宽度(mm)')
@@ -276,14 +276,16 @@ class MachineToolType(models.Model):
machine_tool_W = fields.Char('机床宽度(mm)') machine_tool_W = fields.Char('机床宽度(mm)')
machine_tool_H = fields.Char('机床高度(mm)') machine_tool_H = fields.Char('机床高度(mm)')
feed_speed = fields.Char('进给速度(mm/min)') feed_speed = fields.Char('进给速度(mm/min)')
tool_speed = fields.Char('刀具速度') tool_speed = fields.Char('刀具速度(m/min)')
distance = fields.Char('主轴端面至工作台面距离(mm)') distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)')
distance_max = fields.Char('主轴端面至工作台面距离MIN(mm)')
taper = fields.Char('主轴锥度(°)') taper = fields.Char('主轴锥度(°)')
torque = fields.Char('主轴点击扭矩(n/m)') torque = fields.Char('主轴点击扭矩(n/m)')
motor_power = fields.Char('主轴电机功率(kw)') motor_power = fields.Char('主轴电机功率(kw)')
tool_quality_max = fields.Char('刀具最大质量') tool_quality_max = fields.Char('刀具最大质量(kg)')
tool_long_max = fields.Char('刀具最大长度') tool_long_max = fields.Char('刀具最大长度(mm)')
tool_diameter_max = fields.Char('刀具最大刀径') tool_diameter_max = fields.Char('刀具刀径max(mm)')
tool_diameter_min = fields.Char('刀具刀径min(mm)')
machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型') machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型')
# 多个型号对应一个机床 # 多个型号对应一个机床
@@ -298,7 +300,8 @@ class MachineToolType(models.Model):
b_axis = fields.Integer('B轴') b_axis = fields.Integer('B轴')
c_axis = fields.Integer('C轴') c_axis = fields.Integer('C轴')
remark = fields.Char('备注') remark = fields.Char('备注')
precision = fields.Float('加工精度') precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
control_system_id = fields.Many2one('sf.machine.control_system', control_system_id = fields.Many2one('sf.machine.control_system',
string="控制系统") string="控制系统")
active = fields.Boolean('有效', default=True) active = fields.Boolean('有效', default=True)

View File

@@ -4,4 +4,5 @@
.test_model>.o_form_label { .test_model>.o_form_label {
margin-left: 20px; margin-left: 20px;
margin-right: 0px !important; margin-right: 0px !important;
white-space: nowrap;
} }

View File

@@ -116,10 +116,10 @@
<field name="machine_tool_picture" widget="image" nolabel="1"/> <field name="machine_tool_picture" widget="image" nolabel="1"/>
</group> </group>
</group> </group>
<notebook> <notebook>
<page string="基本信息"> <page string="基本信息">
<group> <group>
<group string="基参数"> <group string="基参数">
<field name="control_system_id" required="1" options="{'no_create': True}"/> <field name="control_system_id" required="1" options="{'no_create': True}"/>
<label for="workbench_L" string="工作台尺寸(mm)"/> <label for="workbench_L" string="工作台尺寸(mm)"/>
<div class="test_model"> <div class="test_model">
@@ -145,7 +145,16 @@
options="{'format': false}"/> options="{'format': false}"/>
</div> </div>
<field name="feed_speed" required="1"/> <field name="feed_speed" required="1"/>
<field name="precision" required="1" string="X轴定位精度(mm)"/> <label for="precision_min" string="X轴定位精度(mm)"/>
<div class="test_model">
<label for="precision_min" string="最小(min)"/>
<field name="precision_min" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="precision_max" string="最大(max)"/>
<field name="precision_max" class="o_address_zip" required="1"
options="{'format': false}"/>
</div>
<field name="workpiece_load" required="1"/> <field name="workpiece_load" required="1"/>
<field name="number_of_knife_library" required="1" options="{'format': false}"/> <field name="number_of_knife_library" required="1" options="{'format': false}"/>
<field name="lead_screw" required="1"/> <field name="lead_screw" required="1"/>
@@ -187,16 +196,32 @@
<field name="heightened_way" required="1"/> <field name="heightened_way" required="1"/>
<field name="torque" required="1"/> <field name="torque" required="1"/>
<field name="motor_power" required="1"/> <field name="motor_power" required="1"/>
<field name="distance" required="1"/> <label for="distance_min" string="主轴端面-工作台距离(mm)"/>
</group> <div class="test_model">
<group> <label for="distance_min" string="最小(min)"/>
<field name="distance_min" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="distance_max" string="最大(max)"/>
<field name="distance_max" class="o_address_zip" required="1"
options="{'format': false}"/>
</div>
<field name="guide_rail" required="1"/> <field name="guide_rail" required="1"/>
</group> </group>
<group string="刀具"> <group string="刀具">
<field name="knife_type" required="1"/> <field name="knife_type" required="1"/>
<field name="tool_speed" required="1"/> <field name="tool_speed" required="1"/>
<field name="tool_long_max" required="1"/> <field name="tool_long_max" required="1"/>
<field name="tool_diameter_max" required="1"/> <label for="tool_diameter_min" string="刀具刀径(mm)"/>
<div class="test_model">
<label for="tool_diameter_min" string="最小(min)"/>
<field name="tool_diameter_min" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="tool_diameter_max" string="最大(max)"/>
<field name="tool_diameter_max" class="o_address_zip" required="1"
options="{'format': false}"/>
</div>
<field name="tool_quality_max" required="1"/> <field name="tool_quality_max" required="1"/>
</group> </group>
</group> </group>

View File

@@ -85,7 +85,8 @@ class SfMaintenanceEquipment(models.Model):
c_axis = fields.Integer('C轴') c_axis = fields.Integer('C轴')
remark = fields.Char('备注') remark = fields.Char('备注')
is_binding = fields.Boolean('是否绑定机床', default=False) is_binding = fields.Boolean('是否绑定机床', default=False)
precision = fields.Float('加工精度') precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
control_system_id = fields.Many2one('sf.machine.control_system', control_system_id = fields.Many2one('sf.machine.control_system',
string="控制系统") string="控制系统")
# 多个机床型号对应一个机床 # 多个机床型号对应一个机床
@@ -102,7 +103,7 @@ class SfMaintenanceEquipment(models.Model):
('youyagang', '油压缸驱动'), ('youyagang', '油压缸驱动'),
('chilunjia', '齿轮架驱动') ('chilunjia', '齿轮架驱动')
], string="主轴加高方式", default='sifudianji') ], string="主轴加高方式", default='sifudianji')
workpiece_load = fields.Char('工件负载') workpiece_load = fields.Char('工件最大负载(kg)')
lead_screw = fields.Char('丝杆') lead_screw = fields.Char('丝杆')
workbench_L = fields.Char('工作台长度(mm)') workbench_L = fields.Char('工作台长度(mm)')
workbench_W = fields.Char('工作台宽度(mm)') workbench_W = fields.Char('工作台宽度(mm)')
@@ -111,14 +112,16 @@ class SfMaintenanceEquipment(models.Model):
machine_tool_W = fields.Char('机床宽度(mm)') machine_tool_W = fields.Char('机床宽度(mm)')
machine_tool_H = fields.Char('机床高度(mm)') machine_tool_H = fields.Char('机床高度(mm)')
feed_speed = fields.Char('进给速度(mm/min)') feed_speed = fields.Char('进给速度(mm/min)')
tool_speed = fields.Char('刀具速度') tool_speed = fields.Char('刀具速度(m/min)')
distance = fields.Char('主轴端面至工作台面距离(mm)') distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)')
distance_max = fields.Char('主轴端面至工作台面距离MIN(mm)')
taper = fields.Char('主轴锥度(°)') taper = fields.Char('主轴锥度(°)')
torque = fields.Char('主轴点击扭矩(n/m)') torque = fields.Char('主轴点击扭矩(n/m)')
motor_power = fields.Char('主轴电机功率(kw)') motor_power = fields.Char('主轴电机功率(kw)')
tool_quality_max = fields.Char('刀具最大质量') tool_quality_max = fields.Char('刀具最大质量(kg)')
tool_long_max = fields.Char('刀具最大长度') tool_long_max = fields.Char('刀具最大长度(mm)')
tool_diameter_max = fields.Char('刀具最大刀径') tool_diameter_max = fields.Char('刀具刀径max(mm)')
tool_diameter_min = fields.Char('刀具刀径min(mm)')
machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型') machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型')
# 一个机床对应一個加工工厂,一个加工工厂对应多个机床 # 一个机床对应一個加工工厂,一个加工工厂对应多个机床
factory_id = fields.Many2one('res.partner', string='所属工厂', factory_id = fields.Many2one('res.partner', string='所属工厂',
@@ -132,20 +135,7 @@ class SfMaintenanceEquipment(models.Model):
active = fields.Boolean('有效', default=True) active = fields.Boolean('有效', default=True)
# 多个型号对应一个机床 # 多个型号对应一个机床
machine_tool_id = fields.Many2one('sf.machine_tool', '机床') machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
number_of_axles = fields.Selection(
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
default="", string="轴数")
# 加工进程
x_axis = fields.Integer('X轴')
y_axis = fields.Integer('Y轴')
z_axis = fields.Integer('Z轴')
b_axis = fields.Integer('B轴')
c_axis = fields.Integer('C轴')
remark = fields.Char('备注')
precision = fields.Float('加工精度')
control_system_id = fields.Many2one('sf.machine.control_system',
string="控制系统")
active = fields.Boolean('有效', default=True)
def name_get(self): def name_get(self):
result = [] result = []
@@ -208,7 +198,8 @@ class SfMaintenanceEquipment(models.Model):
item.number_of_knife_library = item.type_id.number_of_knife_library item.number_of_knife_library = item.type_id.number_of_knife_library
item.number_of_axles = item.type_id.number_of_axles item.number_of_axles = item.type_id.number_of_axles
item.rotate_speed = item.type_id.rotate_speed item.rotate_speed = item.type_id.rotate_speed
item.precision = item.type_id.precision item.precision_min = item.type_id.precision_min
item.precision_max = item.type_id.precision_max
item.control_system_id = item.type_id.control_system_id item.control_system_id = item.type_id.control_system_id
item.x_axis = item.type_id.x_axis item.x_axis = item.type_id.x_axis
item.y_axis = item.type_id.y_axis item.y_axis = item.type_id.y_axis
@@ -227,13 +218,15 @@ class SfMaintenanceEquipment(models.Model):
item.machine_tool_H = item.type_id.machine_tool_H item.machine_tool_H = item.type_id.machine_tool_H
item.feed_speed = item.type_id.feed_speed item.feed_speed = item.type_id.feed_speed
item.tool_speed = item.type_id.tool_speed item.tool_speed = item.type_id.tool_speed
item.distance = item.type_id.distance item.distance_min = item.type_id.distance_min
item.distance_max = item.type_id.distance_max
item.taper = item.type_id.taper item.taper = item.type_id.taper
item.torque = item.type_id.torque item.torque = item.type_id.torque
item.motor_power = item.type_id.motor_power item.motor_power = item.type_id.motor_power
item.tool_quality_max = item.type_id.tool_quality_max item.tool_quality_max = item.type_id.tool_quality_max
item.tool_long_max = item.type_id.tool_long_max item.tool_long_max = item.type_id.tool_long_max
item.tool_diameter_max = item.type_id.tool_diameter_max item.tool_diameter_max = item.type_id.tool_diameter_max
item.tool_diameter_min = item.type_id.tool_diameter_min
item.machine_tool_category = item.type_id.machine_tool_category.id item.machine_tool_category = item.type_id.machine_tool_category.id
item.brand_id = item.type_id.brand_id.id item.brand_id = item.type_id.brand_id.id

View File

@@ -38,107 +38,114 @@
</xpath> </xpath>
<xpath expr="//page[@name='description']" position="before"> <xpath expr="//page[@name='description']" position="before">
<page string="设备参数" name="sf_equipment" attrs="{'invisible': [('type_id', '=', False)]}"> <page string="设备参数" name="sf_equipment" attrs="{'invisible': [('type_id', '=', False)]}">
<group string="参数"> <group>
<group> <group string="基本参数">
<field name="control_system_id" options="{'no_create': True}"/> <field name="control_system_id" required="1" options="{'no_create': True}"/>
<label for="workbench_L" string="工作台[mm]"/> <label for="workbench_L" string="工作台尺寸(mm)"/>
<div class="o_address_format"> <div class="test_model">
<label for="workbench_L" string="长"/> <label for="workbench_L" string="长"/>
<field name="workbench_L" class="o_address_zip" <field name="workbench_L" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="workbench_W" string="宽"/>
<field name="workbench_W" class="o_address_zip" required="1"
options="{'format': false}"/>
</div>
<label for="machine_tool_L" string="机床尺寸(mm)"/>
<div class="test_model">
<label for="machine_tool_L" string="长"/>
<field name="machine_tool_L" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="machine_tool_W" string="宽"/>
<field name="machine_tool_W" class="o_address_zip" required="1"
options="{'format': false}"/>
<label for="machine_tool_H" string="高"/>
<field name="machine_tool_H" class="o_address_zip" required="1"
options="{'format': false}"/>
</div>
<field name="feed_speed" required="1"/>
<label for="precision_min" string="X轴定位精度(mm)"/>
<div class="test_model">
<label for="precision_min" string="最小(min)"/>
<field name="precision_min" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="precision_max" string="最大(max)"/>
<field name="precision_max" class="o_address_zip" required="1"
options="{'format': false}"/>
</div>
<field name="workpiece_load" required="1"/>
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
<field name="lead_screw" required="1"/>
<field name="number_of_axles" required="1" widget="radio"
options="{'horizontal': true}"/>
<label for="x_axis" string="加工行程(mm)"
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
<div class="test_model"
attrs="{'invisible': [('number_of_axles', '=', False)]}">
<label for="x_axis" string="x"/>
<field name="x_axis" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="y_axis" string="y"/>
<field name="y_axis" class="o_address_zip" required="1"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="z_axis" string="z"/>
<field name="z_axis" class="o_address_zip" required="1"
options="{'format': false}"/>
<br></br>
<label for="b_axis" string="b"
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
<field name="b_axis" class="o_address_zip" required="1"
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="c_axis" string="c"
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
<field name="c_axis" class="o_address_zip" required="1"
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
options="{'format': false}"/>
</div>
</group>
<group string="主轴">
<field name="taper" required="1"/>
<field name="rotate_speed" string="主轴转速(min)" required="1"
options="{'format': false}"/> options="{'format': false}"/>
<span>&amp;nbsp;</span> <field name="heightened_way" required="1"/>
<label for="workbench_W" string=""/> <field name="torque" required="1"/>
<field name="workbench_W" class="o_address_zip" <field name="motor_power" required="1"/>
options="{'format': false}"/> <label for="distance_min" string="主轴端面-工作台距离(mm)"/>
</div> <div class="test_model">
<!-- <field name="workbench_L"/>--> <label for="distance_min" string="最小min"/>
<!-- <field name="workbench_W"/>--> <field name="distance_min" class="o_address_zip" required="1"
<label for="machine_tool_L" string="机床[mm]"/> options="{'format': false}"/>
<div class="o_address_format"> <span>&amp;nbsp;</span>
<label for="machine_tool_L" string=""/> <label for="distance_max" string="最大max"/>
<field name="machine_tool_L" class="o_address_zip" <field name="distance_max" class="o_address_zip" required="1"
options="{'format': false}"/> options="{'format': false}"/>
<span>&amp;nbsp;</span> </div>
<label for="machine_tool_W" string=""/> <field name="guide_rail" required="1"/>
<field name="machine_tool_W" class="o_address_zip" </group>
options="{'format': false}"/> <group string="刀具">
<span>&amp;nbsp;</span> <field name="knife_type" required="1"/>
<label for="machine_tool_H" string=""/> <field name="tool_speed" required="1"/>
<field name="machine_tool_H" class="o_address_zip" <field name="tool_long_max" required="1"/>
options="{'format': false}"/> <label for="tool_diameter_min" string="刀具刀径(mm)"/>
</div> <div class="test_model">
<!-- <field name="machine_tool_L"/>--> <label for="tool_diameter_min" string="最小(min)"/>
<!-- <field name="machine_tool_W"/>--> <field name="tool_diameter_min" class="o_address_zip" required="1"
<!-- <field name="machine_tool_H"/>--> options="{'format': false}"/>
<label for="taper" string="主轴"/> <span>&amp;nbsp;</span>
<div class="o_address_format"> <label for="tool_diameter_max" string="最大(max)"/>
<label for="taper" string="锥度(°)"/> <field name="tool_diameter_max" class="o_address_zip" required="1"
<field name="taper" class="o_address_zip" options="{'format': false}"/>
options="{'format': false}"/> </div>
<span>&amp;nbsp;</span> <field name="tool_quality_max" required="1"/>
<label for="torque" string="点击扭矩(n/m)"/> </group>
<field name="torque" class="o_address_zip" </group>
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="motor_power" string="电机功率(kw)"/>
<field name="motor_power" class="o_address_zip"
options="{'format': false}"/>
<label for="motor_power" string="转速(min)"/>
<field name="rotate_speed" class="o_address_zip"
options="{'format': false}"/>
</div>
<field name="number_of_axles" widget="radio"
options="{'horizontal': true}"/>
<field name="heightened_way"/>
<label for="x_axis" string="加工行程(mm)"
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
<div class="test_model"
attrs="{'invisible': [('number_of_axles', '=', False)]}">
<label for="x_axis" string="x"/>
<field name="x_axis" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="y_axis" string="y"/>
<field name="y_axis" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="z_axis" string="z"/>
<field name="z_axis" class="o_address_zip"
options="{'format': false}"/>
<br></br>
<label for="b_axis" string="b"
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
<field name="b_axis" class="o_address_zip"
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="c_axis" string="c"
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
<field name="c_axis" class="o_address_zip"
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
options="{'format': false}"/>
</div>
<field name="distance"/>
<field name="precision" string="X轴定位精度(mm)"/>
<!-- <field name="taper"/>-->
<!-- <field name="torque"/>-->
<!-- <field name="motor_power"/>-->
</group>
<group>
<field name="knife_type"/>
<field name="number_of_knife_library" options="{'format': false}"/>
<field name="tool_quality_max"/>
<field name="tool_long_max"/>
<field name="tool_diameter_max"/>
<field name="tool_speed"/>
<field name="guide_rail"/>
<field name="feed_speed"/>
<field name="workpiece_load"/>
<field name="lead_screw"/>
</group>
</group>
</page> </page>
<page string="其他" attrs="{'invisible': [('type_id', '=', False)]}"> <page string="其他" attrs="{'invisible': [('type_id', '=', False)]}">

View File

@@ -36,8 +36,7 @@ class ResConfigSettings(models.TransientModel):
_logger.info("同步资源库品牌") _logger.info("同步资源库品牌")
self.env['sf.machine.control_system'].sync_all_machine_tool_type_control_system() self.env['sf.machine.control_system'].sync_all_machine_tool_type_control_system()
_logger.info("同步资源库控制系统") _logger.info("同步资源库控制系统")
self.env['sf.machine_tool.type'].sync_all_machine_tool_type()
_logger.info("同步资源库机床型号")
self.env['sf.machine_tool.category'].sync_all_machine_tool_category() self.env['sf.machine_tool.category'].sync_all_machine_tool_category()
_logger.info("同步资源库机床类型") _logger.info("同步资源库机床类型")
# self.env['sf.production.process.parameter'].sync_all_production_process_parameter() # self.env['sf.production.process.parameter'].sync_all_production_process_parameter()
@@ -57,16 +56,19 @@ class ResConfigSettings(models.TransientModel):
_logger.info("同步所有功能刀具列表...") _logger.info("同步所有功能刀具列表...")
self.env['sf.functional.cutting.tool'].sync_all_functional_cutting_tool() self.env['sf.functional.cutting.tool'].sync_all_functional_cutting_tool()
_logger.info("同步所有功能刀具列表完成") _logger.info("同步所有功能刀具列表完成")
self.env['sf.fixture.material'].sync_all_fixture_material() self.env['sf.fixture.material'].sync_all_fixture_material()
_logger.info("同步夹具物料") _logger.info("同步夹具物料")
self.env['sf.multi_mounting.type'].sync_all_multi_mounting_type() # self.env['sf.multi_mounting.type'].sync_all_multi_mounting_type()
_logger.info("同步联装类型") # _logger.info("同步联装类型")
self.env['sf.fixture.model'].sync_all_fixture_model() # self.env['sf.fixture.model'].sync_all_fixture_model()
_logger.info("同步夹具型号") # _logger.info("同步夹具型号")
self.env['sf.functional.fixture.type'].sync_all_functional_fixture_type() # self.env['sf.functional.fixture.type'].sync_all_functional_fixture_type()
_logger.info("同步功能夹具类型") # _logger.info("同步功能夹具类型")
self.env['sf.functional.fixture'].sync_all_functional_fixture() # self.env['sf.functional.fixture'].sync_all_functional_fixture()
_logger.info("同步功能夹具") # _logger.info("同步功能夹具")
self.env['sf.machine_tool.type'].sync_all_machine_tool_type()
_logger.info("同步资源库机床型号")
except Exception as e: except Exception as e:
_logger.info("捕获错误信息:%s" % e) _logger.info("捕获错误信息:%s" % e)
raise ValidationError("数据错误导致同步失败,请联系管理员") raise ValidationError("数据错误导致同步失败,请联系管理员")

View File

@@ -708,9 +708,11 @@ class MachineToolType(models.Model):
[("code", '=', item['code'])]) [("code", '=', item['code'])])
if brand: if brand:
brand.id = item['id'], brand.id = item['id'],
brand.knife_type = item['knife_type'],
brand.name = item['name'], brand.name = item['name'],
brand.code = item['code'], brand.code = item['code'],
brand.precision = item['precision'], brand.precision_min = item['precision_min'],
brand.precision_max = item['precision_max'],
brand.number_of_knife_library = item['number_of_knife_library'], brand.number_of_knife_library = item['number_of_knife_library'],
brand.rotate_speed = item['rotate_speed'], brand.rotate_speed = item['rotate_speed'],
brand.number_of_axles = item['number_of_axles'], brand.number_of_axles = item['number_of_axles'],
@@ -734,6 +736,7 @@ class MachineToolType(models.Model):
"id": item['id'], "id": item['id'],
"name": item['name'], "name": item['name'],
"code": item['code'], "code": item['code'],
"knife_type": item['knife_type'],
"number_of_knife_library": item['number_of_knife_library'], "number_of_knife_library": item['number_of_knife_library'],
"rotate_speed": item['rotate_speed'], "rotate_speed": item['rotate_speed'],
@@ -746,7 +749,8 @@ class MachineToolType(models.Model):
"b_axis": item['b_axis'], "b_axis": item['b_axis'],
"c_axis": item['c_axis'], "c_axis": item['c_axis'],
"remark": item['remark'], "remark": item['remark'],
"precision": item['precision'], "precision_min": item['precision_min'],
"precision_max": item['precision_max'],
'control_system_id': self.env['sf.machine.control_system'].search( 'control_system_id': self.env['sf.machine.control_system'].search(
[('code', '=', item['control_system_id'])]).id, [('code', '=', item['control_system_id'])]).id,
"active": item['active'], "active": item['active'],
@@ -763,13 +767,15 @@ class MachineToolType(models.Model):
"machine_tool_H": item['machine_tool_H'], "machine_tool_H": item['machine_tool_H'],
"feed_speed": item['feed_speed'], "feed_speed": item['feed_speed'],
"tool_speed": item['tool_speed'], "tool_speed": item['tool_speed'],
"distance": item['distance'], "distance_min": item['distance_min'],
"distance_max": item['distance_max'],
"taper": item['taper'], "taper": item['taper'],
"torque": item['torque'], "torque": item['torque'],
"motor_power": item['motor_power'], "motor_power": item['motor_power'],
"tool_quality_max": item['tool_quality_max'], "tool_quality_max": item['tool_quality_max'],
"tool_long_max": item['tool_long_max'], "tool_long_max": item['tool_long_max'],
"tool_diameter_max": item['tool_diameter_max'], "tool_diameter_max": item['tool_diameter_max'],
"tool_diameter_min": item['tool_diameter_min'],
"machine_tool_category": self.env['sf.machine_tool.category'].search( "machine_tool_category": self.env['sf.machine_tool.category'].search(
[('code', '=', item['machine_tool_category'])]).id, [('code', '=', item['machine_tool_category'])]).id,
@@ -812,8 +818,10 @@ class MachineToolType(models.Model):
"z_axis": item['z_axis'], "z_axis": item['z_axis'],
"b_axis": item['b_axis'], "b_axis": item['b_axis'],
"c_axis": item['c_axis'], "c_axis": item['c_axis'],
"knife_type": item['knife_type'],
"remark": item['remark'], "remark": item['remark'],
"precision": item['precision'], "precision_min": item['precision_min'],
"precision_max": item['precision_max'],
'control_system_id': self.env['sf.machine.control_system'].search( 'control_system_id': self.env['sf.machine.control_system'].search(
[('code', '=', item['control_system_id'])]).id, [('code', '=', item['control_system_id'])]).id,
"active": item['active'], "active": item['active'],
@@ -830,13 +838,15 @@ class MachineToolType(models.Model):
"machine_tool_H": item['machine_tool_H'], "machine_tool_H": item['machine_tool_H'],
"feed_speed": item['feed_speed'], "feed_speed": item['feed_speed'],
"tool_speed": item['tool_speed'], "tool_speed": item['tool_speed'],
"distance": item['distance'], "distance_min": item['distance_min'],
"distance_max": item['distance_max'],
"taper": item['taper'], "taper": item['taper'],
"torque": item['torque'], "torque": item['torque'],
"motor_power": item['motor_power'], "motor_power": item['motor_power'],
"tool_quality_max": item['tool_quality_max'], "tool_quality_max": item['tool_quality_max'],
"tool_long_max": item['tool_long_max'], "tool_long_max": item['tool_long_max'],
"tool_diameter_max": item['tool_diameter_max'], "tool_diameter_max": item['tool_diameter_max'],
"tool_diameter_min": item['tool_diameter_min'],
"machine_tool_category": self.env['sf.machine_tool.category'].search( "machine_tool_category": self.env['sf.machine_tool.category'].search(
[('code', '=', item['machine_tool_category'])]).id, [('code', '=', item['machine_tool_category'])]).id,
@@ -856,9 +866,11 @@ class MachineToolType(models.Model):
"y_axis": item['y_axis'], "y_axis": item['y_axis'],
"z_axis": item['z_axis'], "z_axis": item['z_axis'],
"b_axis": item['b_axis'], "b_axis": item['b_axis'],
"knife_type": item['knife_type'],
"c_axis": item['c_axis'], "c_axis": item['c_axis'],
"remark": item['remark'], "remark": item['remark'],
"precision": item['precision'], "precision_min": item['precision_min'],
"precision_max": item['precision_max'],
'control_system_id': self.env['sf.machine.control_system'].search( 'control_system_id': self.env['sf.machine.control_system'].search(
[('code', '=', item['control_system_id'])]).id, [('code', '=', item['control_system_id'])]).id,
"active": item['active'], "active": item['active'],
@@ -875,13 +887,15 @@ class MachineToolType(models.Model):
"machine_tool_H": item['machine_tool_H'], "machine_tool_H": item['machine_tool_H'],
"feed_speed": item['feed_speed'], "feed_speed": item['feed_speed'],
"tool_speed": item['tool_speed'], "tool_speed": item['tool_speed'],
"distance": item['distance'], "distance_min": item['distance_min'],
"distance_max": item['distance_max'],
"taper": item['taper'], "taper": item['taper'],
"torque": item['torque'], "torque": item['torque'],
"motor_power": item['motor_power'], "motor_power": item['motor_power'],
"tool_quality_max": item['tool_quality_max'], "tool_quality_max": item['tool_quality_max'],
"tool_long_max": item['tool_long_max'], "tool_long_max": item['tool_long_max'],
"tool_diameter_max": item['tool_diameter_max'], "tool_diameter_max": item['tool_diameter_max'],
"tool_diameter_min": item['tool_diameter_min'],
"machine_tool_category": self.env['sf.machine_tool.category'].search( "machine_tool_category": self.env['sf.machine_tool.category'].search(
[('code', '=', item['machine_tool_category'])]).id, [('code', '=', item['machine_tool_category'])]).id,