Files
Odoo-Modules/Fusion Accounting/views/integration_bridge_views.xml
2026-02-22 01:22:18 -05:00

180 lines
8.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ===================================================================
Fusion Accounting - Integration Bridge Views
===================================================================
Conditional view extensions that surface bridge fields and actions
in the UI. Each extension uses ``invisible`` expressions that
evaluate to True when the target model does not exist, so they
degrade gracefully when fleet / hr_expense / helpdesk are absent.
Copyright (c) Nexa Systems Inc. - All rights reserved.
-->
<!-- =================================================================
Fleet Bridge: vehicle field on journal-item lines
================================================================= -->
<!-- Add vehicle field to the journal items list view -->
<record id="view_move_line_tree_fleet_bridge" model="ir.ui.view">
<field name="name">account.move.line.list.fusion.fleet.bridge</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree"/>
<field name="priority">200</field>
<field name="arch" type="xml">
<xpath expr="//list/field[@name='analytic_distribution']" position="after">
<field name="fusion_vehicle_id"
optional="hide"
string="Vehicle"/>
</xpath>
</field>
</record>
<!-- Add vehicle to the journal items form view -->
<record id="view_move_line_form_fleet_bridge" model="ir.ui.view">
<field name="name">account.move.line.form.fusion.fleet.bridge</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form"/>
<field name="priority">200</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='analytic_distribution']" position="after">
<field name="fusion_vehicle_id" string="Vehicle"/>
<field name="fusion_vehicle_license_plate"
string="License Plate"
readonly="1"/>
</xpath>
</field>
</record>
<!-- Vehicle field in the inline invoice/bill line items -->
<record id="view_invoice_line_fleet_bridge" model="ir.ui.view">
<field name="name">account.move.form.invoice.lines.fusion.fleet.bridge</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">201</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line_ids']//list//field[@name='analytic_distribution']"
position="after">
<field name="fusion_vehicle_id"
optional="hide"
string="Vehicle"/>
</xpath>
</field>
</record>
<!-- =================================================================
HR Expense Bridge: expense sheet link on journal entries
================================================================= -->
<!-- Stat button + field on journal entry form -->
<record id="view_move_form_expense_bridge" model="ir.ui.view">
<field name="name">account.move.form.fusion.expense.bridge</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">202</field>
<field name="arch" type="xml">
<!-- Stat button for linked expense sheet -->
<xpath expr="//div[@name='button_box']" position="inside">
<field name="fusion_expense_sheet_id" invisible="1"/>
<button name="action_open_expense_sheet"
class="oe_stat_button"
icon="fa-suitcase"
type="object"
invisible="not fusion_expense_sheet_id">
<div class="o_stat_info">
<span class="o_stat_text">Expense Report</span>
</div>
</button>
</xpath>
<!-- Expense reference in the Other Info tab -->
<xpath expr="//page[@id='other_tab']//field[@name='fiscal_position_id']"
position="after">
<field name="fusion_expense_sheet_id"
string="Expense Report"
readonly="1"
invisible="not fusion_expense_sheet_id"/>
<field name="fusion_expense_employee_id"
string="Expense Employee"
readonly="1"
invisible="not fusion_expense_sheet_id"/>
</xpath>
</field>
</record>
<!-- Expense sheet reference in journal entry list view -->
<record id="view_move_tree_expense_bridge" model="ir.ui.view">
<field name="name">account.move.list.fusion.expense.bridge</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_tree"/>
<field name="priority">202</field>
<field name="arch" type="xml">
<xpath expr="//list/field[@name='ref']" position="after">
<field name="fusion_expense_sheet_id"
string="Expense Report"
optional="hide"/>
</xpath>
</field>
</record>
<!-- =================================================================
Helpdesk Bridge: ticket link on journal entries
================================================================= -->
<!-- Stat button + field on journal entry form -->
<record id="view_move_form_helpdesk_bridge" model="ir.ui.view">
<field name="name">account.move.form.fusion.helpdesk.bridge</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">203</field>
<field name="arch" type="xml">
<!-- Stat button for linked ticket -->
<xpath expr="//div[@name='button_box']" position="inside">
<field name="fusion_helpdesk_ticket_id" invisible="1"/>
<button name="action_open_helpdesk_ticket"
class="oe_stat_button"
icon="fa-ticket"
type="object"
invisible="not fusion_helpdesk_ticket_id">
<div class="o_stat_info">
<span class="o_stat_text">Helpdesk Ticket</span>
</div>
</button>
</xpath>
<!-- Ticket reference in the Other Info tab -->
<xpath expr="//page[@id='other_tab']//field[@name='fiscal_position_id']"
position="after">
<field name="fusion_helpdesk_ticket_id"
string="Helpdesk Ticket"
readonly="1"
invisible="not fusion_helpdesk_ticket_id"/>
<field name="fusion_helpdesk_ticket_ref"
string="Ticket Reference"
readonly="1"
invisible="not fusion_helpdesk_ticket_id"/>
</xpath>
</field>
</record>
<!-- Ticket reference in journal entry list view -->
<record id="view_move_tree_helpdesk_bridge" model="ir.ui.view">
<field name="name">account.move.list.fusion.helpdesk.bridge</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_tree"/>
<field name="priority">203</field>
<field name="arch" type="xml">
<xpath expr="//list/field[@name='ref']" position="after">
<field name="fusion_helpdesk_ticket_id"
string="Helpdesk Ticket"
optional="hide"/>
</xpath>
</field>
</record>
</odoo>