On the original purchase sale.order: - Repairs button (fa-wrench) lists all repair.order records where x_fc_original_sale_order_id = this SO - Maintenance button (fa-calendar-check-o) lists all fusion.repair.maintenance.contract records spawned from this SO - Both auto-hide when count is zero - Both gated by fusion_repairs.group_fusion_repairs_user Follows the count + action_view_* + oe_stat_button / statinfo pattern from fusion_claims/views/sale_order_views.xml line ~1176. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1.4 KiB
XML
32 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="view_sale_order_form_inherit_fusion_repairs" model="ir.ui.view">
|
|
<field name="name">sale.order.form.inherit.fusion_repairs</field>
|
|
<field name="model">sale.order</field>
|
|
<field name="inherit_id" ref="sale.view_order_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
|
|
<button name="action_view_repair_orders"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-wrench"
|
|
invisible="x_fc_repair_order_count == 0"
|
|
groups="fusion_repairs.group_fusion_repairs_user">
|
|
<field name="x_fc_repair_order_count" widget="statinfo" string="Repairs"/>
|
|
</button>
|
|
<button name="action_view_maintenance_contracts"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-calendar-check-o"
|
|
invisible="x_fc_maintenance_contract_count == 0"
|
|
groups="fusion_repairs.group_fusion_repairs_user">
|
|
<field name="x_fc_maintenance_contract_count"
|
|
widget="statinfo" string="Maintenance"/>
|
|
</button>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|