[FIX] hr_maintenance: fix search view domain about equipment availability

The fields `owner_user_id` used `maintenance` search view to filter on
assigned equipment is overwritten in `hr_maintenance` to be computed
based on employee or department manager linked user.
However employee may not have linked user, considering equipment
unassigned.
Use directly the presence of employee or department to
determine if an equipment is assigned or not.
This commit is contained in:
Christophe Simonis
2017-04-20 12:17:31 +02:00
parent 6382cd5598
commit 852940f1ba
@@ -54,6 +54,20 @@
</record>
<!-- equiment : views -->
<record id="maintenance_equipment_view_search_inherit_hr" model='ir.ui.view'>
<field name="name">maintenance.equipment.view.search.inherit.hr</field>
<field name="model">maintenance.equipment</field>
<field name="inherit_id" ref="maintenance.hr_equipment_view_search"/>
<field name="arch" type="xml">
<filter name="assigned" position="attributes">
<attribute name="domain">['|', ('employee_id', '!=', False), ('department_id', '!=', False)]</attribute>
</filter>
<filter name="available" position="attributes">
<attribute name="domain">[('employee_id', '=', False), ('department_id', '=', False)]</attribute>
</filter>
</field>
</record>
<record id="maintenance_equipment_view_form_inherit_hr" model="ir.ui.view">
<field name="name">maintenance.equipment.view.form.inherit.hr</field>
<field name="model">maintenance.equipment</field>
@@ -99,4 +113,4 @@
</xpath>
</field>
</record>
</odoo>
</odoo>