优化机场看板以及机床表单
This commit is contained in:
@@ -135,6 +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', '机床')
|
||||||
|
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs','maintenance_equipment_id', '设备故障日志')
|
||||||
|
|
||||||
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class SfMaintenanceLogs(models.Model):
|
|||||||
name = fields.Char(string='名称')
|
name = fields.Char(string='名称')
|
||||||
type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型')
|
type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型')
|
||||||
brand = fields.Many2one('sf.machine.brand', relared='model.brand_id', 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='编码位置')
|
code_location = fields.Char(string='编码位置')
|
||||||
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||||
fault_code = fields.Char(string='故障代码')
|
fault_code = fields.Char(string='故障代码')
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<field name="brand"/>
|
<field name="brand"/>
|
||||||
<field name="model"/>
|
<field name="maintenance_equipment_id"/>
|
||||||
<field name="code_location"/>
|
<field name="code_location"/>
|
||||||
<field name="fault_type"/>
|
<field name="fault_type"/>
|
||||||
<field name="fault_code"/>
|
<field name="fault_code"/>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<field name="brand"/>
|
<field name="brand"/>
|
||||||
<field name="model"/>
|
<field name="maintenance_equipment_id"/>
|
||||||
<field name="code_location"/>
|
<field name="code_location"/>
|
||||||
<field name="fault_type"/>
|
<field name="fault_type"/>
|
||||||
<field name="fault_code"/>
|
<field name="fault_code"/>
|
||||||
@@ -64,13 +64,13 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<searchpanel>
|
<searchpanel>
|
||||||
<field name="model" icon="fa-building" enable_counters="1"/>
|
<field name="maintenance_equipment_id" icon="fa-building" enable_counters="1"/>
|
||||||
</searchpanel>
|
</searchpanel>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<field name="brand"/>
|
<field name="brand"/>
|
||||||
<field name="model"/>
|
<field name="maintenance_equipment_id"/>
|
||||||
<field name="code_location"/>
|
<field name="code_location"/>
|
||||||
<field name="fault_type"/>
|
<field name="fault_type"/>
|
||||||
<field name="fault_code"/>
|
<field name="fault_code"/>
|
||||||
|
|||||||
@@ -19,16 +19,31 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<xpath expr="//sheet" position="after">
|
<xpath expr="//sheet" position="before">
|
||||||
<!-- <button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>-->
|
<header>
|
||||||
<field name="state_zc" widget="radio" options="{'horizontal': true}"/>
|
|
||||||
|
<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>
|
||||||
<xpath expr="//field[@name='maintenance_team_id']" position="before">
|
<xpath expr="//field[@name='maintenance_team_id']" position="before">
|
||||||
<field name="machine_tool_picture" widget="image"/>
|
<field name="machine_tool_picture" widget="image"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='category_id']" position="after">
|
<xpath expr="//field[@name='category_id']" position="after">
|
||||||
|
<field name="state_zc" readonly="1"/>
|
||||||
<field name="code" readonly="1"/>
|
<field name="code" readonly="1"/>
|
||||||
<field name="state" widget="radio" options="{'horizontal': true}"/>
|
|
||||||
<field name="equipment_type" invisible="1"/>
|
<field name="equipment_type" invisible="1"/>
|
||||||
<field name="brand_id" attrs="{'invisible': [('equipment_type', '!=', '机床')]}"
|
<field name="brand_id" attrs="{'invisible': [('equipment_type', '!=', '机床')]}"
|
||||||
force_save="1"/>
|
force_save="1"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user