[ADD] maintenance_equipment_customer: add customer contact link
Some checks failed
tests / test (pull_request) Successful in 1m11s
pre-commit / pre-commit (pull_request) Failing after 1m35s

Store the company contact owning the equipment as a single many2one field,
restricted to company partners. Expose linked equipment and installed
services on the contact form and filters, so contacts can be searched by
service and version.
This commit is contained in:
Stéphan Sainléger
2026-11-17 17:21:11 +01:00
parent 01cf43a97e
commit 1593eb2222
12 changed files with 608 additions and 5 deletions

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="equipment_view_form_customer_inherit" model="ir.ui.view">
<field name="name">maintenance.equipment.form.customer</field>
<field name="model">maintenance.equipment</field>
<field name="inherit_id" ref="maintenance.hr_equipment_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_title')]" position="after">
<group name="customer">
<field name="customer_id" />
</group>
</xpath>
</field>
</record>
<record id="equipment_view_list_customer_inherit" model="ir.ui.view">
<field name="name">maintenance.equipment.list.customer</field>
<field name="model">maintenance.equipment</field>
<field name="inherit_id" ref="maintenance.hr_equipment_view_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="customer_id" optional="hide" />
</xpath>
</field>
</record>
<record id="equipment_view_search_customer_inherit" model="ir.ui.view">
<field name="name">maintenance.equipment.search.customer</field>
<field name="model">maintenance.equipment</field>
<field name="inherit_id" ref="maintenance.hr_equipment_view_search" />
<field name="arch" type="xml">
<xpath expr="//field[@name='owner_user_id']" position="after">
<field name="customer_id" />
</xpath>
<xpath expr="//group[@expand='0']" position="inside">
<filter
string="Customer Contact"
name="customer"
context="{'group_by': 'customer_id'}"
/>
</xpath>
</field>
</record>
</odoo>