工作重心看板展示设备状态以及图片,设备看板增加负责人

This commit is contained in:
qihao.gong@jikimo.com
2023-08-24 14:51:03 +08:00
parent 90868d4a09
commit 3b3847990d
3 changed files with 32 additions and 14 deletions

View File

@@ -303,6 +303,9 @@
<!-- 内容 --> <!-- 内容 -->
<div class="o_kanban_record_bottom state_zc"> <div class="o_kanban_record_bottom state_zc">
<field name="state_zc"/> <field name="state_zc"/>
</div>
<div class="o_kanban_record_bottom state_zc">
<field name="technician_user_id"/>
</div> </div>
<div class="o_kanban_record_bottom state_zc"> <div class="o_kanban_record_bottom state_zc">
<field name="state"/> <field name="state"/>

View File

@@ -9,7 +9,6 @@ class ResWorkcenter(models.Model):
# 生产线显示 # 生产线显示
production_line_show = fields.Char(string='生产线') production_line_show = fields.Char(string='生产线')
equipment_id = fields.Many2one('maintenance.equipment', string='设备')
machine_tool_id = fields.Many2one('sf.machine_tool', string='机床') machine_tool_id = fields.Many2one('sf.machine_tool', string='机床')
production_line_id = fields.Many2one('sf.production.line', string='生产线') production_line_id = fields.Many2one('sf.production.line', string='生产线')
is_process_outsourcing = fields.Boolean('工艺外协') is_process_outsourcing = fields.Boolean('工艺外协')
@@ -19,6 +18,12 @@ class ResWorkcenter(models.Model):
'maintenance.equipment', string="设备", 'maintenance.equipment', string="设备",
check_company=True) check_company=True)
equipment_status = fields.Selection(
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
string="设备状态", related='equipment_id.state')
equipment_image = fields.Binary('设备图片', related='equipment_id.machine_tool_picture')
# 查询工艺外协加工中心 # 查询工艺外协加工中心
def get_process_outsourcing_workcenter(self): def get_process_outsourcing_workcenter(self):
outsourcing_workcenter = self.env['mrp.workcenter'].search([('is_process_outsourcing', '=', True)]) outsourcing_workcenter = self.env['mrp.workcenter'].search([('is_process_outsourcing', '=', True)])

View File

@@ -24,19 +24,28 @@
</field> </field>
</record> </record>
<!-- <record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">--> <record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">
<!-- <field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>--> <field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>
<!-- <field name="model">mrp.workcenter</field>--> <field name="model">mrp.workcenter</field>
<!-- <field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>--> <field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
<!-- <field name="arch" type="xml">--> <field name="arch" type="xml">
<!-- &lt;!&ndash; Desktop view &ndash;&gt;--> <!-- Desktop view -->
<!-- <xpath expr="//div[@name='o_wo']" position="inside">--> <xpath expr='(//field[@name="name"])[1]' position="after">
<!-- <button class="btn btn-secondary fa fa-desktop" name="action_work_order" type="object"-->
<!-- context="{'search_default_ready': 1, 'search_default_progress': 1, 'search_default_pending': 1, 'desktop_list_view': 1, 'search_default_workcenter_id': active_id}"--> <field name="equipment_status" />
<!-- title="Work orders" aria-label="Work orders"/>--> <field name="equipment_image" />
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>--> </xpath>
<xpath expr='(//field[@name="name"])[2]' position="after">
<field name="equipment_status" />
<field name="equipment_image" widget="image" />
</xpath>
</field>
</record>
<!-- override to change the no content image --> <!-- override to change the no content image -->
<record id="mrp.action_work_orders" model="ir.actions.act_window"> <record id="mrp.action_work_orders" model="ir.actions.act_window">
@@ -90,6 +99,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="after"> <xpath expr="//field[@name='company_id']" position="after">
<field name="users_ids" widget="many2many_tags" string="可操作用户"/> <field name="users_ids" widget="many2many_tags" string="可操作用户"/>
<field name="equipment_status"/>
</xpath> </xpath>
<xpath expr="//field[@name='alternative_workcenter_ids']" position="after"> <xpath expr="//field[@name='alternative_workcenter_ids']" position="after">
<field name="production_line_id"/> <field name="production_line_id"/>