Metatron_Student_ERP/addons/education_finance/views/student_discount_views.xml
2026-09-21 11:03:19 +05:30

71 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_education_student_discount_tree" model="ir.ui.view">
<field name="name">education.student.discount.tree</field>
<field name="model">education.student.discount</field>
<field name="arch" type="xml">
<list string="Student Fee Discounts">
<field name="student_id"/>
<field name="type"/>
<field name="amount"/>
<field name="approved_by"/>
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'confirmed'" decoration-danger="state == 'cancelled'"/>
</list>
</field>
</record>
<record id="view_education_student_discount_form" model="ir.ui.view">
<field name="name">education.student.discount.form</field>
<field name="model">education.student.discount</field>
<field name="arch" type="xml">
<form string="Student Fee Discount">
<header>
<button name="action_confirm" string="Confirm Discount" type="object" class="oe_highlight" invisible="state != 'draft'"/>
<button name="action_cancel" string="Cancel Discount" type="object" invisible="state != 'confirmed'"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed"/>
</header>
<sheet>
<group>
<group>
<field name="student_id" readonly="state != 'draft'"/>
<field name="type" readonly="state != 'draft'"/>
<field name="amount" readonly="state != 'draft'"/>
</group>
<group>
<field name="approved_by" readonly="1"/>
<field name="validity" readonly="state != 'draft'"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<group>
<field name="reason" placeholder="Enter reason for discount..." readonly="state != 'draft'"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_education_student_discount_search" model="ir.ui.view">
<field name="name">education.student.discount.search</field>
<field name="model">education.student.discount</field>
<field name="arch" type="xml">
<search string="Student Fee Discounts">
<field name="student_id"/>
<field name="approved_by"/>
<filter string="Confirmed" name="confirmed" domain="[('state', '=', 'confirmed')]"/>
<group>
<filter string="Student" name="group_student" context="{'group_by': 'student_id'}"/>
<filter string="Status" name="group_status" context="{'group_by': 'state'}"/>
</group>
</search>
</field>
</record>
<record id="action_education_student_discount" model="ir.actions.act_window">
<field name="name">Discounts</field>
<field name="res_model">education.student.discount</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_education_student_discount_search"/>
</record>
</odoo>