优化机场看板以及机床表单

This commit is contained in:
qihao.gong@jikimo.com
2023-08-17 11:11:47 +08:00
parent f5653ce1dd
commit 28fcf5c4fa
4 changed files with 26 additions and 10 deletions

View File

@@ -135,6 +135,7 @@ class SfMaintenanceEquipment(models.Model):
active = fields.Boolean('有效', default=True)
# 多个型号对应一个机床
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs','maintenance_equipment_id', '设备故障日志')
def name_get(self):

View File

@@ -9,7 +9,7 @@ class SfMaintenanceLogs(models.Model):
name = fields.Char(string='名称')
type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型')
brand = fields.Many2one('sf.machine.brand', relared='model.brand_id', string='品牌')
model = fields.Many2one('maintenance.equipment', string='设备')
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='设备')
code_location = fields.Char(string='编码位置')
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
fault_code = fields.Char(string='故障代码')

View File

@@ -11,7 +11,7 @@
<field name="name"/>
<field name="type"/>
<field name="brand"/>
<field name="model"/>
<field name="maintenance_equipment_id"/>
<field name="code_location"/>
<field name="fault_type"/>
<field name="fault_code"/>
@@ -39,7 +39,7 @@
<field name="name"/>
<field name="type"/>
<field name="brand"/>
<field name="model"/>
<field name="maintenance_equipment_id"/>
<field name="code_location"/>
<field name="fault_type"/>
<field name="fault_code"/>
@@ -64,13 +64,13 @@
<field name="arch" type="xml">
<search>
<searchpanel>
<field name="model" icon="fa-building" enable_counters="1"/>
<field name="maintenance_equipment_id" icon="fa-building" enable_counters="1"/>
</searchpanel>
<field name="code"/>
<field name="name"/>
<field name="type"/>
<field name="brand"/>
<field name="model"/>
<field name="maintenance_equipment_id"/>
<field name="code_location"/>
<field name="fault_type"/>
<field name="fault_code"/>

View File

@@ -19,16 +19,31 @@
<field name="arch" type="xml">
<data>
<xpath expr="//sheet" position="after">
<!-- <button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>-->
<field name="state_zc" widget="radio" options="{'horizontal': true}"/>
<xpath expr="//sheet" position="before">
<header>
<field name="state" widget="statusbar" options="{'clickable': '1'}"/>
</header>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(action_maintenance_logs)d"
type="action"
class="oe_stat_button"
context="{'default_sf_maintenance_logs_ids': sf_maintenance_logs_ids}"
icon="fa-wrench">
<field string="设备故障日志" name="sf_maintenance_logs_ids" widget="statinfo"/>
</button>
</xpath>
<xpath expr="//field[@name='maintenance_team_id']" position="before">
<field name="machine_tool_picture" widget="image"/>
</xpath>
<xpath expr="//field[@name='category_id']" position="after">
<field name="state_zc" readonly="1"/>
<field name="code" readonly="1"/>
<field name="state" widget="radio" options="{'horizontal': true}"/>
<field name="equipment_type" invisible="1"/>
<field name="brand_id" attrs="{'invisible': [('equipment_type', '!=', '机床')]}"
force_save="1"/>
@@ -282,7 +297,7 @@
<div class="o_kanban_record_bottom state_zc">
<field name="state_zc"/>
</div>
<div class="o_kanban_record_bottom state_zc">
<div class="o_kanban_record_bottom state_zc">
<field name="state"/>
</div>
<!-- <div class="o_kanban_record_bottom">-->