2026-09-15 10:47:19 +05:30

70 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_education_student_refund_tree" model="ir.ui.view">
<field name="name">education.student.refund.tree</field>
<field name="model">education.student.refund</field>
<field name="arch" type="xml">
<tree string="Student Refunds">
<field name="student_id"/>
<field name="payment_id"/>
<field name="amount" sum="Total Amount"/>
<field name="reason"/>
<field name="status" widget="badge" decoration-info="status == 'draft'" decoration-success="status == 'approved'" decoration-danger="status == 'rejected'"/>
</tree>
</field>
</record>
<record id="view_education_student_refund_form" model="ir.ui.view">
<field name="name">education.student.refund.form</field>
<field name="model">education.student.refund</field>
<field name="arch" type="xml">
<form string="Student Refund">
<header>
<button name="action_approve" string="Approve Refund" type="object" class="oe_highlight" invisible="status != 'draft'" groups="education_finance.group_finance_manager"/>
<button name="action_reject" string="Reject Refund" type="object" invisible="status != 'draft'" groups="education_finance.group_finance_manager"/>
<field name="status" widget="statusbar" statusbar_visible="draft,approved,rejected"/>
</header>
<sheet>
<group>
<group>
<field name="payment_id" readonly="status != 'draft'"/>
<field name="student_id" readonly="1"/>
<field name="amount" readonly="status != 'draft'"/>
</group>
<group>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<group>
<field name="reason" placeholder="Enter reason for refund..." readonly="status != 'draft'"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_education_student_refund_search" model="ir.ui.view">
<field name="name">education.student.refund.search</field>
<field name="model">education.student.refund</field>
<field name="arch" type="xml">
<search string="Student Refunds">
<field name="student_id"/>
<field name="payment_id"/>
<filter string="Approved" name="approved" domain="[('status', '=', 'approved')]"/>
<filter string="Draft" name="draft" domain="[('status', '=', 'draft')]"/>
<group expand="1" string="Group By">
<filter string="Student" name="group_student" context="{'group_by': 'student_id'}"/>
<filter string="Status" name="group_status" context="{'group_by': 'status'}"/>
</group>
</search>
</field>
</record>
<record id="action_education_student_refund" model="ir.actions.act_window">
<field name="name">Refunds</field>
<field name="res_model">education.student.refund</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_education_student_refund_search"/>
</record>
</odoo>