Initial commit on branch odoo_DuyDat

This commit is contained in:
Duy Dat
2025-06-13 14:20:29 +07:00
commit 7819a1d6db
228 changed files with 4502 additions and 0 deletions
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Loan Documents Action-->
<record id="loan_documents_action" model="ir.actions.act_window">
<field name="name">Loan Documents</field>
<field name="res_model">loan.documents</field>
<field name="view_mode">list,form</field>
</record>
<!-- Loan Documents Tree View -->
<record id="loan_documents_view_tree" model="ir.ui.view">
<field name="name">loan.documents.view.list</field>
<field name="model">loan.documents</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<list string="Loan Documents" editable="bottom">
<field name="loan_proofs"/>
<field name="company_id"/>
</list>
</field>
</record>
</odoo>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Loan Management Menu Items-->
<menuitem id="loan_management_menu_root" name="Loan Management"
web_icon="advanced_loan_management,static/description/icon.png"/>
<menuitem id="loan_management_loan" name="Loan" sequence="10"
parent="loan_management_menu_root"/>
<menuitem id="loan_management_request" name="Loan Requests"
parent="loan_management_loan" action="loan_request_action"/>
<menuitem id="loan_management_type" name="Loan Types"
parent="loan_management_loan" action="loan_type_action"/>
<menuitem id="loan_management_lines" name="Repayments"
parent="loan_management_loan" action="repayment_line_action"/>
<menuitem id="loan_management_certificates" name="Documents" sequence="15"
parent="loan_management_menu_root"/>
<menuitem id="loan_management_proofs" name="Loan Proofs"
parent="loan_management_certificates" action="loan_documents_action"/>
<menuitem id="loan_management_conf" name="Configuration" sequence="20"
parent="loan_management_menu_root"/>
<menuitem id="loan_management_settings" name="Settings"
parent="loan_management_conf" action="res_config_settings_action"/>
<menuitem id="loan_management_report" name="Loan Report" sequence="20"
parent="loan_management_menu_root"/>
</odoo>
@@ -0,0 +1,175 @@
<?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>
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Loan Type Action-->
<record id="loan_type_action" model="ir.actions.act_window">
<field name="name">Loan Type</field>
<field name="res_model">loan.type</field>
<field name="view_mode">kanban,list,form</field>
</record>
<!-- Loan Type Kanban View-->
<record id="loan_type_view_kanban" model="ir.ui.view">
<field name="name">loan.type.view.kanban</field>
<field name="model">loan.type</field>
<field name="arch" type="xml">
<kanban>
<field name='id'/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="oe_kanban_details">
<strong>
<ul>
<li>Name :
<field name="name"/>
</li>
<li>Amount :
<field name="loan_amount"/>
</li>
<li>Tenure :
<field name="tenure"/>
</li>
<li>Interest Rate:
<field name="interest_rate"
widget="percentage"/>
</li>
</ul>
</strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Loan Type Tree View-->
<record id="loan_type_view_tree" model="ir.ui.view">
<field name="name">loan.type.view.list</field>
<field name="model">loan.type</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<list string="Loan Type">
<field name="name"/>
<field name="loan_amount"/>
<field name="interest_rate" widget="percentage"/>
<field name="processing_fee"/>
</list>
</field>
</record>
<!-- Loan Type Form View-->
<record id="loan_type_view_form" model="ir.ui.view">
<field name="name">loan.type.view.form</field>
<field name="model">loan.type</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Loan Type">
<header/>
<sheet>
<div class="oe_title">
<h1>
<field name="name" style="width: 50%%;"
placeholder="Loan Type"/>
</h1>
</div>
<group>
<group>
<field name="loan_amount"/>
<field name="tenure"/>
<field name="tenure_plan"/>
<field name="documents_ids"
widget="many2many_tags"/>
</group>
<group>
<field name="processing_fee"/>
<field name="interest_rate" widget="percentage" style="width: 3rem"/>
<field name="disbursal_amount"/>
</group>
</group>
<notebook>
<page string="Reminder">
<group>
<field name="note"/>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
</odoo>
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Default GroupBy-->
<record id="repayment_line_default_group" model="ir.ui.view">
<field name="name">repayment.line.default.group</field>
<field name="model">repayment.line</field>
<field name="arch" type="xml">
<search string="Loan">
<filter name="loan" string="Loan ID"
context="{'group_by': 'loan_id'}"/>
</search>
</field>
</record>
<!-- Repayment Line Action-->
<record id="repayment_line_action" model="ir.actions.act_window">
<field name="name">Repayment Line</field>
<field name="res_model">repayment.line</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_loan': 1}</field>
<field name="search_view_id" ref="repayment_line_default_group"/>
</record>
<!-- Repayment Line Tree View-->
<record id="repayment_line_view_tree" model="ir.ui.view">
<field name="name">repayment.line.view.list</field>
<field name="model">repayment.line</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<list string="Loan Request" create="false">
<field name="name"/>
<field name="partner_id"/>
<field name="loan_id"/>
<field name="date"/>
<field name="total_amount"/>
<field name="company_id"/>
<field name="state" widget="badge"
decoration-success="state == 'paid'" decoration-danger="state == 'unpaid'"/>
</list>
</field>
</record>
<!-- Repayment Line Form View -->
<record id="repayment_line_view_form" model="ir.ui.view">
<field name="name">repayment.line.view.form</field>
<field name="model">repayment.line</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Repayment Line" create="false">
<header>
<field name="state" widget="statusbar"
statusbar_visible="unpaid,paid"/>
<button invisible="(invoice == True) or (state != 'unpaid')"
name="action_pay_emi"
class="oe_highlight"
string="Pay"
type="object"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name" style="width: 50%%;"/>
</h1>
</div>
<group>
<group>
<field name="partner_id"/>
<field name="loan_id"/>
</group>
<group>
<field name="date"/>
<field name="amount"/>
<field name="interest_amount"/>
<field name="total_amount"/>
<field name="invoice" column_invisible="1"/>
</group>
<group>
<field name="company_id"/>
</group>
</group>
<notebook>
<page string="Accounting">
<group>
<group>
<field name="journal_loan_id"/>
</group>
<group>
<field name="interest_account_id"/>
<field name="repayment_account_id"/>
</group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
</odoo>
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Loan Management Action For Conf Settings-->
<record id="res_config_settings_action" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'advanced_loan_management',
'bin_size':
False}
</field>
</record>
<!-- Loan Management Form View For Conf Settings-->
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.loan.management
</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form"
position="inside">
<app data-string="Loan Management" string="Loan" name="advanced_loan_management">
<field name="interest_product_id" column_invisible="1"/>
<field name="interest_product_id" invisible="1"/>
<block title="Loan Interest" name="fiscal_localization_setting_container" >
<setting string="Loan Interest Details" company_dependent="1" help="Interest product and repayment details.">
<div class="content-group">
<div class="mt16">
<div>
<label for="interest_product_id" string="Interest Product" class="col-2 o_light_label"/>
<field name="interest_product_id" />
</div>
</div>
</div>
<div class="content-group">
<div class="mt16">
<div>
<label for="repayment_product_id" string="Repayment Product" class="col-2 o_light_label"/>
<field name="repayment_product_id" />
</div>
</div>
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- res partner inherit Loans -->
<record id="res_partner_view_form_inherit" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit.loan.management</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_view_loans" type="object" class="oe_stat_button"
icon="fa-calendar">
<field name="loan_count" widget="statinfo" string="Loans"/>
</button>
</xpath>
</field>
</record>
</odoo>