2026-09-21 11:03:19 +05:30

90 lines
5.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Inherit Student Form View to add Smart Buttons and Finance metrics -->
<record id="view_education_student_form_inherit_finance" model="ir.ui.view">
<field name="name">education.student.form.inherit.finance</field>
<field name="model">education.student</field>
<field name="inherit_id" ref="education_student.view_education_student_form"/>
<field name="arch" type="xml">
<!-- Replace placeholder button box with complete set of smart buttons -->
<xpath expr="//div[@name='button_box']" position="replace">
<div class="oe_button_box" name="button_box">
<!-- 1. Fee Assignments Button -->
<button class="oe_stat_button" icon="fa-tasks" type="action" name="%(action_education_fee_assignment)d" context="{'search_default_student_id': id}">
<div class="o_stat_info">
<span class="o_stat_text">Assignments</span>
</div>
</button>
<!-- 2. Payments Button -->
<button class="oe_stat_button" icon="fa-credit-card" type="action" name="%(action_education_student_payment)d" context="{'search_default_student_id': id}">
<div class="o_stat_info">
<span class="o_stat_value">
<field name="total_paid" widget="monetary"/>
</span>
<span class="o_stat_text">Payments</span>
</div>
</button>
<!-- 3. Ledger Button -->
<button class="oe_stat_button" icon="fa-list-alt" type="action" name="%(action_education_student_ledger)d" context="{'search_default_student_id': id}">
<div class="o_stat_info">
<span class="o_stat_text">Ledger</span>
</div>
</button>
<!-- 4. Receipts Button -->
<button class="oe_stat_button" icon="fa-file-text-o" type="action" name="%(action_education_student_payment)d" context="{'search_default_student_id': id, 'search_default_confirmed': 1}">
<div class="o_stat_info">
<span class="o_stat_value">
<field name="total_fees" widget="monetary"/>
</span>
<span class="o_stat_text">Receipts</span>
</div>
</button>
<!-- 5. Outstanding Button -->
<button class="oe_stat_button" icon="fa-money" type="action" name="%(action_education_student_ledger)d" context="{'search_default_student_id': id}">
<div class="o_stat_info">
<span class="o_stat_value">
<field name="outstanding_amount" widget="monetary"/>
</span>
<span class="o_stat_text">Outstanding</span>
</div>
</button>
<!-- Attendance placeholder -->
<button class="oe_stat_button" icon="fa-calendar-check-o" type="object" name="action_draft" string="Attendance">
<div class="o_stat_info">
<span class="o_stat_value">0</span>
<span class="o_stat_text">Attendance</span>
</div>
</button>
<!-- Documents placeholder -->
<button class="oe_stat_button" icon="fa-folder-open-o" type="object" name="action_draft" string="Documents">
<div class="o_stat_info">
<span class="o_stat_value">0</span>
<span class="o_stat_text">Documents</span>
</div>
</button>
</div>
</xpath>
<!-- Inject a Finance summary tab in the notebook -->
<xpath expr="//notebook" position="inside">
<page string="Finance Summary" name="finance_summary" groups="education_finance.group_finance_executive">
<group>
<group string="Balance Metrics">
<field name="currency_id" invisible="1"/>
<field name="total_fees"/>
<field name="total_paid"/>
<field name="outstanding_amount"/>
<field name="payment_status" widget="badge" decoration-info="payment_status == 'partial'" decoration-success="payment_status == 'fully_paid' or payment_status == 'no_dues'" decoration-danger="payment_status == 'overdue'"/>
</group>
<group string="Last Transaction info">
<field name="last_payment_date"/>
<field name="last_receipt_number"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</odoo>