@ -0,0 +1,35 @@ |
|||
OHRMS Loan Management |
|||
===================== |
|||
|
|||
Manage Loan Requests. |
|||
|
|||
|
|||
Installation |
|||
============ |
|||
- www.odoo.com/documentation/10.0/setup/install.html |
|||
- Install our custom addon |
|||
|
|||
License |
|||
======= |
|||
GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) |
|||
(http://www.gnu.org/licenses/agpl.html) |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Credits |
|||
======= |
|||
* Cybrosys Techno Solutions <https://www.cybrosys.com> |
|||
|
|||
Author |
|||
------ |
|||
|
|||
Developers: Anusha P P <anusha@cybrosys.in> |
|||
|
|||
Maintainer |
|||
---------- |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit https://www.cybrosys.com. |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import models |
|||
|
@ -0,0 +1,52 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################### |
|||
# A part of OpenHRMS Project <https://www.openhrms.com> |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>). |
|||
# Author: Anusha P P (<https://www.cybrosys.com>) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################### |
|||
{ |
|||
'name': 'OHRMS Loan Management', |
|||
'version': '10.0.1.0.0', |
|||
'summary': 'Manage Loan Requests', |
|||
'description': """ |
|||
Helps you to manage Loan Requests of your company's staff. |
|||
""", |
|||
'category': 'Human Resources', |
|||
'author': "Cybrosys Techno Solutions", |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.openhrms.com", |
|||
'depends': [ |
|||
'hr_payroll', 'hr', 'account', |
|||
], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'security/security.xml', |
|||
'views/hr_loan_sequence.xml', |
|||
'data/hr_payroll_data.xml', |
|||
'views/hr_loan.xml', |
|||
'views/hr_payroll.xml', |
|||
], |
|||
'demo': [], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!--Adding a salary rule for loan--> |
|||
<data noupdate="0"> |
|||
<record id="hr_rule_loan" model="hr.salary.rule"> |
|||
<field name="name">Loan</field> |
|||
<field name="sequence" eval="100"/> |
|||
<field name="code">LO</field> |
|||
<field name="category_id" ref="hr_payroll.DED"/> |
|||
<field name="condition_select">none</field> |
|||
<field name="amount_select">code</field> |
|||
<field name="amount_python_compute">result = -payslip.total_amount_paid</field> |
|||
</record> |
|||
|
|||
<record id="hr_rule_input_loan" model="hr.rule.input"> |
|||
<field name="code">LO</field> |
|||
<field name="name">Loan</field> |
|||
<field name="input_id" ref="hr_rule_loan"/> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import hr_loan |
|||
import hr_payroll |
|||
|
@ -0,0 +1,173 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from odoo import models, fields, api |
|||
from datetime import datetime |
|||
from dateutil.relativedelta import relativedelta |
|||
|
|||
|
|||
class HrLoan(models.Model): |
|||
_name = 'hr.loan' |
|||
_inherit = ['mail.thread', 'ir.needaction_mixin'] |
|||
_description = "HR Loan Request" |
|||
|
|||
@api.one |
|||
def _compute_amount(self): |
|||
total_paid_amount = 0.00 |
|||
for loan in self: |
|||
for line in loan.loan_line_ids: |
|||
if line.paid: |
|||
total_paid_amount += line.paid_amount |
|||
balance_amount = loan.loan_amount - total_paid_amount |
|||
self.total_amount = loan.loan_amount |
|||
self.balance_amount = balance_amount |
|||
self.total_paid_amount = total_paid_amount |
|||
|
|||
@api.one |
|||
def _get_old_loan(self): |
|||
"""This compute employees old loans due amount. |
|||
""" |
|||
old_amount = 0.00 |
|||
for loan in self.search([('employee_id', '=', self.employee_id.id), ('state', '=', 'approve')]): |
|||
if loan.id != self.id: |
|||
old_amount += loan.balance_amount |
|||
self.loan_old_amount = old_amount |
|||
|
|||
name = fields.Char(string="Loan Name", default="/", readonly=True) |
|||
date = fields.Date(string="Date Request", default=fields.Date.today(), readonly=True) |
|||
employee_id = fields.Many2one('hr.employee', string="Employee", required=True) |
|||
parent_id = fields.Many2one('hr.employee', related="employee_id.parent_id", string="Manager") |
|||
department_id = fields.Many2one('hr.department', related="employee_id.department_id", readonly=True, |
|||
string="Department") |
|||
job_id = fields.Many2one('hr.job', related="employee_id.job_id", readonly=True, string="Job Position") |
|||
emp_salary = fields.Float(string="Employee Salary", related="employee_id.contract_id.wage", readonly=True) |
|||
loan_old_amount = fields.Float(string="Old Loan Amount Not Paid", compute='_get_old_loan') |
|||
loan_amount = fields.Float(string="Loan Amount", required=True) |
|||
total_amount = fields.Float(string="Total Amount", readonly=True, compute='_compute_amount') |
|||
balance_amount = fields.Float(string="Balance Amount", compute='_compute_amount') |
|||
total_paid_amount = fields.Float(string="Total Paid Amount", compute='_compute_amount') |
|||
installment = fields.Integer(string="No Of Installments", default=1) |
|||
payment_start_date = fields.Date(string="Start Date of Payment", required=True, default=fields.Date.today()) |
|||
loan_line_ids = fields.One2many('hr.loan.line', 'loan_id', string="Loan Line", index=True) |
|||
move_id = fields.Many2one('account.move', string="Entry Journal", readonly=True) |
|||
emp_account_id = fields.Many2one('account.account', string="Employee Loan Account") |
|||
treasury_account_id = fields.Many2one('account.account', string="Treasury Account") |
|||
journal_id = fields.Many2one('account.journal', string="Journal") |
|||
company_id = fields.Many2one('res.company', 'Company', readonly=True, |
|||
default=lambda self: self.env.user.company_id, |
|||
states={'draft': [('readonly', False)]}) |
|||
currency_id = fields.Many2one('res.currency', string='Currency', required=True, |
|||
default=lambda self: self.env.user.company_id.currency_id) |
|||
state = fields.Selection([ |
|||
('draft', 'Draft'), |
|||
('waiting_approval_1', 'Waiting Approval From Hr'), |
|||
('waiting_approval_2', 'Waiting Approval From Accounts'), |
|||
('approve', 'Approved'), |
|||
('refuse', 'Refused'), |
|||
], string="State", default='draft', track_visibility='onchange', copy=False, ) |
|||
|
|||
@api.model |
|||
def create(self, values): |
|||
values['name'] = self.env['ir.sequence'].get('hr.loan.req') or ' ' |
|||
res = super(HrLoan, self).create(values) |
|||
return res |
|||
|
|||
@api.multi |
|||
def action_refuse(self): |
|||
return self.write({'state': 'refuse'}) |
|||
|
|||
@api.multi |
|||
def action_set_to_draft(self): |
|||
return self.write({'state': 'draft'}) |
|||
|
|||
@api.multi |
|||
def submit(self): |
|||
self.write({'state': 'waiting_approval_1'}) |
|||
|
|||
@api.multi |
|||
def onchange_employee_id(self, employee_id=False): |
|||
old_amount = 0.00 |
|||
if employee_id: |
|||
for loan in self.search([('employee_id', '=', employee_id), ('state', '=', 'approve')]): |
|||
if loan.id != self.id: |
|||
old_amount += loan.balance_amount |
|||
return { |
|||
'value': { |
|||
'loan_old_amount': old_amount} |
|||
} |
|||
|
|||
@api.multi |
|||
def action_approve(self): |
|||
self.write({'state': 'approve'}) |
|||
|
|||
@api.multi |
|||
def compute_loan_line(self): |
|||
"""This automatically create the installment the employee need to pay to |
|||
company based on payment start date and the no of installments. |
|||
""" |
|||
loan_line = self.env['hr.loan.line'] |
|||
loan_line.search([('loan_id', '=', self.id)]).unlink() |
|||
for loan in self: |
|||
date_start_str = datetime.strptime(loan.payment_start_date, '%Y-%m-%d') |
|||
counter = 1 |
|||
amount_per_time = loan.loan_amount / loan.installment |
|||
for i in range(1, loan.installment + 1): |
|||
line_id = loan_line.create({ |
|||
'paid_date': date_start_str, |
|||
'paid_amount': amount_per_time, |
|||
'employee_id': loan.employee_id.id, |
|||
'loan_id': loan.id}) |
|||
counter += 1 |
|||
date_start_str = date_start_str + relativedelta(months=1) |
|||
|
|||
return True |
|||
|
|||
@api.multi |
|||
def button_reset_balance_total(self): |
|||
"""This function recompute the balance. |
|||
""" |
|||
total_paid_amount = 0.00 |
|||
for loan in self: |
|||
for line in loan.loan_line_ids: |
|||
if line.paid: |
|||
total_paid_amount += line.paid_amount |
|||
balance_amount = loan.loan_amount - total_paid_amount |
|||
self.write({'total_paid_amount': total_paid_amount, 'balance_amount': balance_amount}) |
|||
|
|||
|
|||
class HrLoanLine(models.Model): |
|||
_name = "hr.loan.line" |
|||
_description = "HR Loan Request Line" |
|||
|
|||
paid_date = fields.Date(string="Payment Date", required=True) |
|||
employee_id = fields.Many2one('hr.employee', string="Employee") |
|||
paid_amount = fields.Float(string="Paid Amount", required=True) |
|||
paid = fields.Boolean(string="Paid") |
|||
notes = fields.Text(string="Notes") |
|||
loan_id = fields.Many2one('hr.loan', string="Loan Ref.", ondelete='cascade') |
|||
payroll_id = fields.Many2one('hr.payslip', string="Payslip Ref.") |
|||
|
|||
@api.one |
|||
def action_paid_amount(self): |
|||
return self.write({'paid': True}) |
|||
|
|||
|
|||
class HrEmployee(models.Model): |
|||
_inherit = "hr.employee" |
|||
|
|||
@api.one |
|||
def _compute_loans(self): |
|||
"""This compute the loan amount and total loans count of an employee. |
|||
""" |
|||
count = 0 |
|||
loan_remain_amount = 0.00 |
|||
loan_ids = self.env['hr.loan'].search([('employee_id', '=', self.id)]) |
|||
for loan in loan_ids: |
|||
loan_remain_amount += loan.balance_amount |
|||
count += 1 |
|||
self.loan_count = count |
|||
self.loan_amount = loan_remain_amount |
|||
|
|||
loan_amount = fields.Float(string="loan Amount", compute='_compute_loans') |
|||
loan_count = fields.Integer(string="Loan Count", compute='_compute_loans') |
|||
|
|||
|
@ -0,0 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from odoo import models, fields, api |
|||
|
|||
|
|||
class HrPayslip(models.Model): |
|||
_inherit = 'hr.payslip' |
|||
|
|||
@api.one |
|||
def compute_total_paid_loan(self): |
|||
"""This compute the total paid amount of Loan. |
|||
""" |
|||
total = 0.00 |
|||
for line in self.loan_ids: |
|||
if line.paid: |
|||
total += line.paid_amount |
|||
self.total_amount_paid = total |
|||
|
|||
loan_ids = fields.One2many('hr.loan.line', 'payroll_id', string="Loans") |
|||
total_amount_paid = fields.Float(string="Total Loan Amount", compute='compute_total_paid_loan') |
|||
|
|||
@api.multi |
|||
def get_loan(self): |
|||
"""This gives the installment lines of an employee where the state is not in paid. |
|||
""" |
|||
array = [] |
|||
loan_ids = self.env['hr.loan.line'].search([('employee_id', '=', self.employee_id.id), ('paid', '=', False)]) |
|||
for loan in loan_ids: |
|||
if loan.loan_id.state == 'approve': |
|||
array.append(loan.id) |
|||
self.loan_ids = array |
|||
return array |
|||
|
|||
@api.multi |
|||
def action_payslip_done(self): |
|||
array = [] |
|||
for line in self.loan_ids: |
|||
if line.paid: |
|||
array.append(line.id) |
|||
else: |
|||
line.payroll_id = False |
|||
self.loan_ids = array |
|||
return super(HrPayslip, self).action_payslip_done() |
|
@ -0,0 +1,35 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="rule_hr_loan" model="ir.rule"> |
|||
<field name="name">Loan Request Multi Company</field> |
|||
<field name="model_id" ref="model_hr_loan"/> |
|||
<field eval="True" name="global"/> |
|||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> |
|||
</record> |
|||
|
|||
<record id="hr_loan_manager_rule" model="ir.rule"> |
|||
<field name="name">Loan Forms 4</field> |
|||
<field name="model_id" ref="model_hr_loan"/> |
|||
<field name="groups" eval="[(4, ref('hr.group_hr_user')),(4, ref('account.group_account_user'))]"/> |
|||
<field name="perm_write" eval="True"/> |
|||
<field name="perm_read" eval="True"/> |
|||
<field name="perm_create" eval="True"/> |
|||
<field name="perm_unlink" eval="True"/> |
|||
</record> |
|||
|
|||
|
|||
<record id="hr_loan_rule" model="ir.rule"> |
|||
<field name="name">Loan Forms</field> |
|||
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field> |
|||
<field name="global" eval="True"/> |
|||
<field name="model_id" ref="model_hr_loan"/> |
|||
<field name="groups" eval="[(4,ref('base.group_user'))]"/> |
|||
<field name="perm_write" eval="True"/> |
|||
<field name="perm_read" eval="True"/> |
|||
<field name="perm_create" eval="True"/> |
|||
<field name="perm_unlink" eval="True"/> |
|||
</record> |
|||
|
|||
</data> |
|||
</odoo> |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 221 KiB |
After Width: | Height: | Size: 31 KiB |
@ -0,0 +1,163 @@ |
|||
<section class="oe_container bg-gray-lighter" xmlns="http://www.w3.org/1999/html"> |
|||
<div class="oe_row"> |
|||
<div class="oe_span"> |
|||
<h2 class="oe_slogan">OpenHRMS</h2> |
|||
<h3 class="oe_slogan">Most advanced open source HR management software</h3> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced oe_mt32"> |
|||
<div class="oe_span"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<a href="https://www.openhrms.com/#request-demo"> |
|||
<img src="HRMS-BUTTON.png"> |
|||
</a> |
|||
<div class="oe_demo_footer oe_centeralign">Online Demo</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan">HR Loan</h2> |
|||
<h3 class="oe_slogan">Manage Loan request of employees</h3> |
|||
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a></h4> |
|||
</div> |
|||
<div class="oe_row oe_spaced" style="padding-left:65px;"> |
|||
<h4>Features:</h4> |
|||
<div> |
|||
<span style="color:green;"> ☑ </span>Employee can create loan request.<br/> |
|||
<span style="color:green;"> ☑ </span>Double layer approval, from Accounting & HR Department.<br/> |
|||
<span style="color:green;"> ☑ </span>Loan amount is deducted from the salary.<br/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="" style="text-align: center;"> |
|||
<div class="oe_picture"> |
|||
<h3 class="oe_slogan">Overview</h3> |
|||
<p class="oe_mt32"> |
|||
HR Loan is a component of Open HRMS suit. |
|||
HR Loan module helps the user to configure different loan policies, assign approval authority, conduct the verification process and sanction loan for employees. |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="" style="text-align: center;"> |
|||
<h3 class="oe_slogan">Configuration</h3> |
|||
</div> |
|||
<div class="" style="text-align: center;"> |
|||
<p>Install the Module "HR Loan Accounting" in order to enable Accounting Entries. |
|||
Enable the option "Loan Approval From Accounting Department" In accounting settings</p> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="accounting_validation.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="" style="text-align: center;"> |
|||
<p>Add the deduction rule for loan in Salary Structure</p> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="loan_rule.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="" style="text-align: center;"> |
|||
<h3 class="oe_slogan">Loan Request</h3> |
|||
<p>Employee can create loan request</p> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="loan_request.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="" style="text-align: center;"> |
|||
<h3 class="oe_slogan">Loan Approval</h3> |
|||
<p>Once the HR department has given the Approval, the accounts department take the decision</p> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="loan_approval.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="" style="text-align: center;"> |
|||
<h3 class="oe_slogan">Employee Payslip</h3> |
|||
<p>When we create the payslip, all the pending installments will be listed there, |
|||
we can manually select the installments that have to be deducted from the salary</p> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="payslip.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="" style="text-align: center;"> |
|||
<h3 class="oe_slogan">Loan Amount Deduction</h3> |
|||
<p>When we check the Loan request again, |
|||
the deducted installments will be changed to paid state.</p> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="loan_amount_deduction.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<div class="row section-content"> |
|||
<div class="col-md-6 img-content"> |
|||
<h3>Our Odoo Services</h3> |
|||
</div> <div class="bc-span col-md-12"><div class="inner-span"><a target="_blank" href="https://www.openhrms.com"><img class="img-border img-responsive thumbnail" src="cybro-service.png"></a></div></div> |
|||
</div> |
|||
</div> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
</div> |
|||
</section> |
After Width: | Height: | Size: 123 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 95 KiB |
@ -0,0 +1,187 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<!--Loan Tree view--> |
|||
<record id="tree_hr_loan_view" model="ir.ui.view"> |
|||
<field name="name">hr.loan.tree</field> |
|||
<field name="model">hr.loan</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Loan Requests"> |
|||
<field name="name"/> |
|||
<field name="employee_id"/> |
|||
<field name="loan_amount"/> |
|||
<field name="date"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<!--Loan Form view--> |
|||
<record id="view_hr_loan_form" model="ir.ui.view"> |
|||
<field name="name">hr.loan.form</field> |
|||
<field name="model">hr.loan</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Loan Request"> |
|||
<header> |
|||
<button name="submit" type="object" string="Submit" states="draft" class="oe_highlight"/> |
|||
<button name="action_approve" type="object" string="Approve" states="waiting_approval_1" class="oe_highlight" groups="hr.group_hr_manager,hr.group_hr_user"/> |
|||
<button name="action_double_approve" type="object" string="Approve" states="waiting_approval_2" class="oe_highlight" groups="account.group_account_user,account.group_account_manager"/> |
|||
<button name="action_refuse" type="object" string="Refuse" states="draft,waiting_approval_1,waiting_approval_2" class="oe_highlight" groups="hr.group_hr_manager,hr.group_hr_user"/> |
|||
<field name="state" widget="statusbar" statusbar_visible="draft,waiting_approval_1,waiting_approval_2,approve" /> |
|||
</header> |
|||
|
|||
<sheet> |
|||
<div class="oe_button_box" name="button_box"> |
|||
</div> |
|||
|
|||
<div class="oe_title"> |
|||
<label for="name" class="oe_edit_only"/> |
|||
<h1> |
|||
<field name="name" class="oe_inline"/> |
|||
</h1> |
|||
</div> |
|||
<group col="4"> |
|||
<field name="employee_id" on_change="onchange_employee_id(employee_id)" attrs="{'readonly':[('state','=','approve')]}"/> |
|||
<field name="date"/> |
|||
<div colspan="4"> |
|||
<group> |
|||
<field name="department_id"/> |
|||
<field name="job_id"/> |
|||
<field name="emp_salary"/> |
|||
<field name="loan_old_amount"/> |
|||
</group> |
|||
</div> |
|||
<field name="emp_account_id" attrs="{'invisible':[('state', 'in',('draft','waiting_approval_1'))]}"/> |
|||
<field name="treasury_account_id" attrs="{'invisible':[('state', 'in',('draft','waiting_approval_1'))]}"/> |
|||
<field name="journal_id" attrs="{'invisible':[('state', 'in',('draft','waiting_approval_1'))]}"/> |
|||
<field name="loan_amount" attrs="{'readonly':[('state','=','approve')]}"/> |
|||
<field name="installment" attrs="{'readonly':[('state','=','approve')]}"/> |
|||
<field name="payment_start_date" attrs="{'readonly':[('state','=','approve')]}"/> |
|||
</group> |
|||
<notebook> |
|||
<page string="Installments"> |
|||
<group> |
|||
<field name="move_id" invisible="1"/> |
|||
</group> |
|||
<field name="loan_line_ids"> |
|||
<tree string="Loan Line" editable="bottom"> |
|||
<field name="paid_date"/> |
|||
<field name="paid_amount"/> |
|||
<field name="paid" readonly="1"/> |
|||
<field name="notes"/> |
|||
<button name="action_paid_amount" icon="fa-arrows-v" string="Pay Amount" type="object" attrs="{'invisible':[('paid','=',True)]}" |
|||
groups="hr.group_hr_manager,hr.group_hr_user"/> |
|||
</tree> |
|||
</field> |
|||
<group class="oe_subtotal_footer oe_right"> |
|||
<field name="total_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/> |
|||
<div> |
|||
<label for="total_paid_amount"/> |
|||
<button name="button_reset_balance_total" states="draft" |
|||
string="(update)" class="oe_link oe_edit_only" |
|||
type="object" help="Recompute Balance" groups="hr.group_hr_manager,hr.group_hr_user"/> |
|||
</div> |
|||
<field name="total_paid_amount" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}"/> |
|||
<field name="balance_amount" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/> |
|||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> |
|||
<field name="currency_id" options="{'no_create': True}" groups="base.group_multi_company"/> |
|||
</group> |
|||
<button type="object" name="compute_loan_line" string="Compute" colspan="2" attrs="{'invisible':[('state','=','approve')]}" |
|||
groups="hr.group_hr_manager,hr.group_hr_user" class="oe_stat_button" |
|||
icon="fa-clock-o"/> |
|||
<div class="oe_clear"/> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_follower_ids" widget="mail_followers"/> |
|||
<field name="message_ids" widget="mail_thread"/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<!--loan search view--> |
|||
<record id="view_loan_request_search_form" model="ir.ui.view"> |
|||
<field name="name">hr.loan.search.form</field> |
|||
<field name="model">hr.loan</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Tasks"> |
|||
<field name="employee_id"/> |
|||
<field name="department_id"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter string="Employee" name="employee_id" context="{'group_by':'employee_id'}"/> |
|||
<filter string="Department" context="{'group_by':'department_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
<!--loan menu--> |
|||
<menuitem name="Loans And Salary Advance" |
|||
id="menu_hr_loans_and_advances" parent="hr.menu_hr_root" |
|||
sequence="20"/> |
|||
|
|||
<record id="action_hr_loan_request" model="ir.actions.act_window"> |
|||
<field name="name">Loan Requests</field> |
|||
<field name="res_model">hr.loan</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="search_view_id" ref="view_loan_request_search_form"/> |
|||
<field name="help" type="html"> |
|||
<p> |
|||
Create new loan request. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<menuitem name="Loan Requests" |
|||
id="menu_base_hr_loan_request" |
|||
parent = "menu_hr_loans_and_advances" |
|||
sequence="1"/> |
|||
|
|||
<menuitem name="Loan Requests" |
|||
parent="menu_base_hr_loan_request" |
|||
id="menu_hr_loan_request" |
|||
action="action_hr_loan_request"/> |
|||
|
|||
<!-- Shortcuts --> |
|||
<record id="act_hr_employee_loan_request" model="ir.actions.act_window"> |
|||
<field name="name">Loans</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">hr.loan</field> |
|||
<field name="src_model">hr.employee</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field> |
|||
<field name="domain">[('employee_id','=',active_id)]</field> |
|||
<field name="view_id" eval="tree_hr_loan_view"/> |
|||
</record> |
|||
|
|||
|
|||
<!-- HR employee inherit Loans --> |
|||
<record id="view_employee_form_loan_inherit" model="ir.ui.view"> |
|||
<field name="name">hr.employee.loan.form.inherit</field> |
|||
<field name="model">hr.employee</field> |
|||
<field name="inherit_id" ref="hr.view_employee_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//group[@name='active_group']" position="before"> |
|||
<group string="Loans"> |
|||
<label for="loan_amount"/> |
|||
<div> |
|||
<field name="loan_amount" class="oe_inline"/> |
|||
</div> |
|||
</group> |
|||
</xpath> |
|||
<xpath expr="//div[@name='button_box']" position="inside"> |
|||
<button name="%(act_hr_employee_loan_request)d" |
|||
type="action" |
|||
class="oe_stat_button" |
|||
icon="fa-calendar" |
|||
groups="hr.group_hr_manager,hr.group_hr_user"> |
|||
<field name="loan_count" widget="statinfo" string="Loans"/> |
|||
</button> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" ?> |
|||
<odoo> |
|||
<data noupdate='1'> |
|||
<record id="ir_seq_hr_loan" model="ir.sequence"> |
|||
<field name="name">Loan Request</field> |
|||
<field name="code">hr.loan.req</field> |
|||
<field name="prefix">Loan NO </field> |
|||
<field name="padding">4</field> |
|||
<field name="number_increment">1</field> |
|||
<field name="number_next_actual">1</field> |
|||
<field name="implementation">standard</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="hr_payslip_form_inherit_view" model="ir.ui.view"> |
|||
<field name="name">hr.payslip.inherit.form1</field> |
|||
<field name="model">hr.payslip</field> |
|||
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='input_line_ids']" position="after"> |
|||
<separator string="Loans"/> |
|||
<group string="Loans"> |
|||
<button name="get_loan" string="Update Loans" type="object" groups="hr_payroll.group_hr_payroll_manager"/> |
|||
<field name="loan_ids"> |
|||
<tree string="Loans" editable="bottom"> |
|||
<field name="loan_id"/> |
|||
<field name="paid_date"/> |
|||
<field name="paid_amount"/> |
|||
<field name="paid" groups="hr_payroll.group_hr_payroll_manager"/> |
|||
<field name="notes"/> |
|||
</tree> |
|||
</field> |
|||
<group class="oe_subtotal_footer oe_right"> |
|||
<field name="total_amount_paid"/> |
|||
</group> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |