You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

175 lines
9.3 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Loan Request Action-->
<record id="loan_request_action" model="ir.actions.act_window">
<field name="name">Loan Request</field>
<field name="res_model">loan.request</field>
<field name="view_mode">list,form</field>
</record>
<!-- Loan Request Tree View-->
<record id="loan_request_view_tree" model="ir.ui.view">
<field name="name">loan.request.view.list</field>
<field name="model">loan.request</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<list string="Loan Request">
<field name="name"/>
<field name="partner_id"/>
<field name="loan_amount"/>
<field name="interest_rate" widget="percentage"/>
<field name="date"/>
<field name="tenure"/>
<field name="company_id"/>
<field name="state" widget="badge" decoration-info="state in ['draft', 'confirmed']"
decoration-success="state in ['approved', 'disbursed']" decoration-danger="state == 'rejected'"
decoration-warning="state == 'waiting'"
decoration-muted="state == 'closed'"/>
</list>
</field>
</record>
<!-- Loan Request Form View-->
<record id="loan_request_view_form" model="ir.ui.view">
<field name="name">loan.request.view.form</field>
<field name="model">loan.request</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Loan Request">
<header>
<!-- <div class="alert alert-info" role="alert"-->
<!-- style="height: 40px; margin-bottom:0px;"-->
<!-- invisible="state != 'waiting'"-->
<!-- groups="advanced_loan_management.loan_management_group_user">-->
<!-- Waiting for approval from the manager-->
<!-- </div>-->
<field name="state" widget="statusbar"
statusbar_visible="draft,confirmed,approved"/>
<button name="action_loan_request" class="oe_highlight"
invisible="state != 'draft'"
string="Confirm"
type="object"/>
<button name="action_compute_repayment" class="oe_highlight"
invisible="state != 'confirmed'"
string="Compute Repayments"
type="object"/>
<button name="action_request_for_loan" class="oe_highlight"
invisible="state != 'confirmed'"
string="Request"
type="object"/>
<button name="action_loan_approved" class="oe_highlight"
invisible="state != 'waiting'"
string="Approve" type="object"
groups="advanced_loan_management.loan_management_group_manager"/>
<button name="action_loan_rejected" class="oe_highlight"
invisible="state != 'waiting'"
string="Reject" type="object"
groups="advanced_loan_management.loan_management_group_manager"/>
<button name="action_disburse_loan" class="oe_highlight"
string="Disburse"
invisible="state != 'approved'"
type="object"/>
<button name="action_close_loan" class="oe_highlight"
string="Close"
type="object"
invisible="state != 'disbursed'"/>
</header>
<div class="alert alert-info w-100 d-flex align-items-center gap-1"
invisible="state != 'waiting'" role="alert">
<span>Waiting for approval from the manager</span>
</div>
<sheet>
<div class="oe_title">
<h1>
<field name="name" style="width: 50%%;"
placeholder="Loan Type"/>
</h1>
</div>
<group>
<group>
<field name="partner_id"/>
<field name="loan_type_id"
readonly="state != 'draft'"/>
</group>
<group>
<field name="tenure"
readonly="state != 'draft'"/>
<field name="disbursal_amount"/>
<field name="currency_id"/>
<field name="date"/>
<field name="request" invisible="1"/>
</group>
<group>
<field name="loan_amount"/>
<field name="interest_rate" widget="percentage" style="width: 3rem"/>
<field name="company_id"/>
</group>
</group>
<notebook>
<page string="Repayment schedules"
invisible="state == 'draft'">
<field name="repayment_lines_ids" readonly="1">
<list string="list" create="false">
<field name="name"/>
<field name="date"/>
<field name="amount"/>
<field name="interest_amount"/>
<field name="total_amount"/>
<field name="state"
column_invisible="parent.state != 'disbursed'"
widget="badge"
optional="show"
decoration-danger="state == 'unpaid'"
decoration-warning="state == 'invoiced'"
decoration-success="state == 'paid'"/>
<field name="invoice" column_invisible="1"/>
<button invisible="(invoice == True) or (state != 'unpaid') or (parent.state != 'disbursed')"
name="action_pay_emi"
class="oe_highlight"
string="Pay"
type="object"/>
<button invisible="(invoice == False) or (parent.state != 'disbursed') or (state == 'paid')"
name="action_view_invoice"
class="oe_highlight"
string="View"
type="object"/>
</list>
</field>
</page>
<page string="Documents">
<group>
<field name="documents_ids"
widget="many2many_tags"/>
<field name="img_attachment_ids"
widget="many2many_binary"/>
</group>
</page>
<page string="Loan rejection"
invisible="state != 'rejected'">
<field name="reject_reason" readonly="1"/>
</page>
<page string="Accounting"
invisible="state == 'draft'">
<group>
<group>
<field name="journal_id"
required="state == 'approved'"
readonly="state == 'disbursed'"/>
</group>
<group>
<field name="debit_account_id"
required="state == 'approved'"
readonly="state == 'disbursed'"/>
<field name="credit_account_id"
required="state == 'approved'"
readonly="state == 'disbursed'"/>
</group>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
</odoo>