AGV增加运行日志
设备oee增加运行日志
This commit is contained in:
@@ -17,12 +17,30 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
equipment_type_code = fields.Char('简写')
|
||||
|
||||
|
||||
class SfMaintenanceEquipmentAGVLog(models.Model):
|
||||
_name = 'maintenance.equipment.agv.log'
|
||||
_description = 'AGV运行日志'
|
||||
|
||||
run_type = fields.Char('任务类型')
|
||||
run_code = fields.Char('任务指令代码')
|
||||
run_first = fields.Char('任务起点')
|
||||
production_line = fields.Char('目的生产线')
|
||||
run_last = fields.Char('任务终点')
|
||||
workorder = fields.Char('工件编码/任务单号')
|
||||
time = fields.Datetime('日期/事件')
|
||||
state = fields.Char('事件/状体')
|
||||
equipment_id = fields.Many2one('maintenance.equipment', '设备')
|
||||
|
||||
|
||||
class SfMaintenanceEquipment(models.Model):
|
||||
_inherit = 'maintenance.equipment'
|
||||
_description = '设备'
|
||||
|
||||
crea_url = "/api/machine_tool/create"
|
||||
|
||||
|
||||
#AGV运行日志
|
||||
agv_logs = fields.One2many('maintenance.equipment.agv.log', 'equipment_id', string='AGV运行日志')
|
||||
# 1212修改后的字段
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴"), ("六轴", "六轴")],
|
||||
@@ -194,6 +212,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
# 多个型号对应一个机床
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
|
||||
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_id', '设备故障日志')
|
||||
equipment_oee_ids = fields.One2many('maintenance.equipment.oee', 'equipment_id', '设备OEE')
|
||||
|
||||
# def name_get(self):
|
||||
# result = []
|
||||
|
||||
@@ -23,6 +23,7 @@ class SfMaintenanceEquipmentOEE(models.Model):
|
||||
fault_nums = fields.Integer('故障次数')
|
||||
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_oee_id', '设备故障日志',
|
||||
related='equipment_id.sf_maintenance_logs_ids')
|
||||
oee_logs = fields.One2many('maintenance.equipment.oee.logs', 'equipment_oee_id', string='运行日志')
|
||||
|
||||
def name_get(self):
|
||||
result = []
|
||||
@@ -30,4 +31,19 @@ class SfMaintenanceEquipmentOEE(models.Model):
|
||||
if parameter.equipment_id:
|
||||
name = parameter.equipment_id.name
|
||||
result.append((parameter.id, name))
|
||||
return result
|
||||
return result
|
||||
|
||||
|
||||
class SfMaintenanceEquipmentOEELog(models.Model):
|
||||
_name = 'maintenance.equipment.oee.logs'
|
||||
_description = '设备运行日志'
|
||||
|
||||
name = fields.Char('运行日志')
|
||||
run_time = fields.Datetime('时间')
|
||||
state = fields.Selection([("开机", "开机"), ("关机", "关机"), ("等待", "等待"), ("开始加工", "开始加工"),
|
||||
("结束加工", "结束加工"), ("故障", "故障"),
|
||||
("检修", "检修"), ("保养", "保养")], default="", string="事件/状态")
|
||||
workorder_id = fields.Char('加工订单')
|
||||
time = fields.Char('持续时长')
|
||||
color = fields.Char('颜色', default=1)
|
||||
equipment_oee_id = fields.Many2one('maintenance.equipment.oee', '设备OEE')
|
||||
|
||||
@@ -7,12 +7,18 @@ access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,s
|
||||
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment_oee_logs,maintenance_equipment_oee_logs,model_maintenance_equipment_oee_logs,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_equipment_oee_logs,maintenance_equipment_oee_logs,model_maintenance_equipment_oee_logs,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment_oee_logs,maintenance_equipment_oee_logs,model_maintenance_equipment_oee_logs,base.group_user,1,1,1,1
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_manager,1,1,1,0
|
||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,0,0,0
|
||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment_agv_log,maintenance_equipment_agv_log,model_maintenance_equipment_agv_log,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_equipment_agv_log,maintenance_equipment_agv_log,model_maintenance_equipment_agv_log,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment_agv_log,maintenance_equipment_agv_log,model_maintenance_equipment_agv_log,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
access_maintenance_request_group_plan_dispatch,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
||||
|
@@ -49,6 +49,19 @@
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="运行日志">
|
||||
<field name="oee_logs">
|
||||
<tree create="1" edit="1" delete="1" editable="bottom">
|
||||
<field name = 'run_time'/>
|
||||
<field name = 'state'/>
|
||||
<field name = 'workorder_id'/>
|
||||
<field name = 'time'/>
|
||||
<field name = 'color' widget="color"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
@@ -63,6 +76,7 @@
|
||||
<searchpanel>
|
||||
<field name="equipment_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
<field name="equipment_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -32,6 +32,14 @@
|
||||
<field string="设备故障日志" name="sf_maintenance_logs_ids" widget="statinfo"/>
|
||||
</button>
|
||||
|
||||
<button name="%(action_maintenance_oee)d"
|
||||
type="action"
|
||||
class="oe_stat_button"
|
||||
context="{'search_default_equipment_id': [active_id]}"
|
||||
icon="fa-exchange"
|
||||
attrs="{'invisible': [('state_zc', '!=', '已注册')]}">
|
||||
<field string="设备oee" name="equipment_oee_ids" widget="statinfo"/>
|
||||
</button>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='maintenance_team_id']" position="before">
|
||||
@@ -63,15 +71,18 @@
|
||||
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||
<group>
|
||||
<group string="基础参数">
|
||||
<field name="control_system_id" attrs="{'required': [('equipment_type', '=', '机床')]}" options="{'no_create': True}"/>
|
||||
<field name="control_system_id" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'no_create': True}"/>
|
||||
<label for="workbench_L" string="工作台尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="workbench_L" string="长"/>
|
||||
<field name="workbench_L" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
<field name="workbench_L" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="workbench_W" string="宽"/>
|
||||
<field name="workbench_W" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
<field name="workbench_W" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="workpiece_load"/>
|
||||
@@ -115,22 +126,26 @@
|
||||
|
||||
<!-- <field name="lead_screw" required="1"/>-->
|
||||
<!-- <field name="guide_rail" required="1"/>-->
|
||||
<field name="number_of_axles" attrs="{'required': [('equipment_type', '=', '机床')]}" widget="radio"
|
||||
<field name="number_of_axles" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
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" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
<field name="x_axis" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
<field name="y_axis" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
<field name="z_axis" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="a_axis" string="a"
|
||||
@@ -177,58 +192,74 @@
|
||||
|
||||
<!-- <field name="distance" required="1"/>-->
|
||||
</group>
|
||||
<group string="刀具">
|
||||
<!-- <field name="knife_type" required="1"/>-->
|
||||
<field name="number_of_knife_library" attrs="{'required': [('equipment_type', '=', '机床')]}" options="{'format': false}"/>
|
||||
<!-- <field name="tool_speed" required="1"/>-->
|
||||
<field name="tool_full_diameter_max"/>
|
||||
<field name="tool_perimeter_diameter_max"/>
|
||||
<field name="tool_long_max"/>
|
||||
<!-- <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>&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"/>
|
||||
<field name="T_tool_time"/>
|
||||
<field name="C_tool_time"/>
|
||||
</group>
|
||||
|
||||
<group string="进给参数">
|
||||
<field name="X_axis_rapid_traverse_speed"/>
|
||||
<field name="Y_axis_rapid_traverse_speed"/>
|
||||
<field name="Z_axis_rapid_traverse_speed"/>
|
||||
<field name="a_axis_rapid_traverse_speed"/>
|
||||
<field name="b_axis_rapid_traverse_speed"/>
|
||||
<field name="c_axis_rapid_traverse_speed"/>
|
||||
<field name="straight_cutting_feed_rate"/>
|
||||
<field name="rotary_cutting_feed_rate"/>
|
||||
</group>
|
||||
<group string="精度参数">
|
||||
<field name="X_precision"/>
|
||||
<field name="X_precision_repeat"/>
|
||||
<field name="Y_precision"/>
|
||||
<field name="Y_precision_repeat"/>
|
||||
<field name="Z_precision"/>
|
||||
<field name="Z_precision_repeat"/>
|
||||
<field name="a_precision"/>
|
||||
<field name="a_precision_repeat"/>
|
||||
<field name="b_precision"/>
|
||||
<field name="b_precision_repeat"/>
|
||||
<field name="c_precision"/>
|
||||
<field name="c_precision_repeat"/>
|
||||
</group>
|
||||
|
||||
<group string="刀具">
|
||||
<!-- <field name="knife_type" required="1"/>-->
|
||||
<field name="number_of_knife_library"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<!-- <field name="tool_speed" required="1"/>-->
|
||||
<field name="tool_full_diameter_max"/>
|
||||
<field name="tool_perimeter_diameter_max"/>
|
||||
<field name="tool_long_max"/>
|
||||
<!-- <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>&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"/>
|
||||
<field name="T_tool_time"/>
|
||||
<field name="C_tool_time"/>
|
||||
</group>
|
||||
|
||||
<group string="进给参数">
|
||||
<field name="X_axis_rapid_traverse_speed"/>
|
||||
<field name="Y_axis_rapid_traverse_speed"/>
|
||||
<field name="Z_axis_rapid_traverse_speed"/>
|
||||
<field name="a_axis_rapid_traverse_speed"/>
|
||||
<field name="b_axis_rapid_traverse_speed"/>
|
||||
<field name="c_axis_rapid_traverse_speed"/>
|
||||
<field name="straight_cutting_feed_rate"/>
|
||||
<field name="rotary_cutting_feed_rate"/>
|
||||
</group>
|
||||
<group string="精度参数">
|
||||
<field name="X_precision"/>
|
||||
<field name="X_precision_repeat"/>
|
||||
<field name="Y_precision"/>
|
||||
<field name="Y_precision_repeat"/>
|
||||
<field name="Z_precision"/>
|
||||
<field name="Z_precision_repeat"/>
|
||||
<field name="a_precision"/>
|
||||
<field name="a_precision_repeat"/>
|
||||
<field name="b_precision"/>
|
||||
<field name="b_precision_repeat"/>
|
||||
<field name="c_precision"/>
|
||||
<field name="c_precision_repeat"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
</page>
|
||||
<page string="AGV运行日志" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', 'AGV小车')]}">
|
||||
<field name="agv_logs">
|
||||
<tree create="1" edit="1" delete="1" editable="bottom">
|
||||
<field name = 'run_type'/>
|
||||
<field name = 'run_code'/>
|
||||
<field name = 'run_first'/>
|
||||
<field name = 'run_last'/>
|
||||
<field name = 'production_line'/>
|
||||
<field name = 'workorder'/>
|
||||
<field name = 'time'/>
|
||||
<field name = 'state'/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
<page string="设备参数" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', 'AGV小车')]}">
|
||||
@@ -913,28 +944,30 @@
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//notebook" position="before">
|
||||
<group string="加工能力" attrs="{'invisible': [('equipment_type', '!=', '机床')]}" class="processingMethod">
|
||||
<group string="加工能力" attrs="{'invisible': [('equipment_type', '!=', '机床')]}"
|
||||
class="processingMethod">
|
||||
<div>
|
||||
<field name='image_id' widget="custom_many2many_checkboxes" string="">
|
||||
<field name='image_id' widget="custom_many2many_checkboxes" string="">
|
||||
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
</group>
|
||||
<group string="冷却方式" attrs="{'invisible': [('equipment_type', '!=', '机床')]}" class="processingMethod">
|
||||
<group string="冷却方式" attrs="{'invisible': [('equipment_type', '!=', '机床')]}"
|
||||
class="processingMethod">
|
||||
<div>
|
||||
<field name='image_lq_id' widget="custom_many2many_checkboxes" string="">
|
||||
<field name='image_lq_id' widget="custom_many2many_checkboxes" string="">
|
||||
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
|
||||
Reference in New Issue
Block a user