@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Muhammed Amal(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import models |
@ -0,0 +1,40 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Muhammed Amal(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': 'HR Expense Payment', |
|||
'version': '9.0.1.0.0', |
|||
'summary': """Pay Button in HR Expense""", |
|||
'description': 'Payment can be done in HR expense form', |
|||
'category': "Generic Modules/Human Resources", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': "http://www.cybrosys.com", |
|||
'website': 'www.cybrosys.com', |
|||
'depends': ['base', 'hr_expense'], |
|||
'data': ['views/hr_expense_payment.xml'], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Muhamed Amal(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import hr_expense_payment |
@ -0,0 +1,70 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Muhamed Amal(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
from openerp import models, fields |
|||
from openerp.exceptions import UserError |
|||
from openerp.tools.translate import _ |
|||
|
|||
|
|||
class AddExpensePaymentButton(models.Model): |
|||
_inherit = 'hr.expense' |
|||
|
|||
payment_id = fields.Many2one('account.payment', string='Payment Reference', copy=False) |
|||
check_payment = fields.Boolean(default=False, copy=False) |
|||
|
|||
def hr_expense_payment(self, cr, uid, ids, context=None): |
|||
expense = self.browse(cr, uid, ids, context) |
|||
if not expense.check_payment: |
|||
total = expense.total_amount |
|||
partner_id = expense.employee_id.address_home_id |
|||
payment_creation_obj = self.pool.get('account.payment') |
|||
vals_payment = {'communication': False, |
|||
'journal_id': 5, |
|||
'destination_journal_id': False, |
|||
'currency_id': 21, |
|||
'partner_type': u'supplier', |
|||
'state': 'draft', |
|||
'payment_type': u'outbound', |
|||
'amount': total, |
|||
'partner_id': partner_id.id, |
|||
'payment_method_id': 2} |
|||
expense.payment_id = payment_creation_obj.create(cr, uid, vals_payment, context) |
|||
expense.check_payment = True |
|||
else: |
|||
raise UserError(_('You have already created a payment')) |
|||
|
|||
def hr_expense_reconcile(self, cr, uid, ids, context=None): |
|||
if self.browse(cr, uid, ids, context).check_payment: |
|||
if self.browse(cr, uid, ids, context).payment_id.state == 'draft': |
|||
raise UserError(_('Please validate payment for this employee')) |
|||
else: |
|||
return { |
|||
'name': 'Reconcile', |
|||
'type': 'ir.actions.act_window', |
|||
'res_model': 'account.move.line', |
|||
'view_type': 'form', |
|||
'view_mode': 'tree,form', |
|||
'res_id': 'hr_expense_payment', |
|||
'domain': [('account_id.name', '=', 'Creditors'), ('reconciled', '=', False)] |
|||
} |
|||
else: |
|||
raise UserError(_('Please create a payment for this employee')) |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,104 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan">HR Expense Payment</h2> |
|||
<h3 class="oe_slogan">Easily process payment for expenses</h3> |
|||
<h4 class="oe_slogan">Cybrosys Techno Solutions , www.cybrosys.com</h4> |
|||
</div> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p style="text-align: center;">This module helps you to process the hr expense management from the hr module itself</p> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p>☛ You can create the payment for an employee by a single click</p> |
|||
</p> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="pay_button.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p>☛ A draft payment will be created</p> |
|||
<p>Note : You should manually validate the payment</p> |
|||
</p> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="payment_draft.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p>☛ Reconcile the journal item for payment and employee expense</p> |
|||
</p> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="payment_reconcile.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p>☛ Expense state is changed to draft</p> |
|||
</p> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="payment_paid.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<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="http://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="http://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="http://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> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
|
|||
|
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 67 KiB |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<openerp> |
|||
<data> |
|||
<record id="hr_expense_form_view_add_payment" model="ir.ui.view"> |
|||
<field name="name">hr.expense.form</field> |
|||
<field name="model">hr.expense</field> |
|||
<field name="inherit_id" ref="hr_expense.hr_expense_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//button[@name='submit_expenses']" position="after"> |
|||
<button name="hr_expense_payment" states="post" |
|||
string="Pay" type="object" class="oe_highlight"/> |
|||
<button name="hr_expense_reconcile" states="post" |
|||
string="Reconcile" type="object" class="oe_highlight"/> |
|||
</xpath> |
|||
|
|||
<xpath expr="//field[@name='account_move_id']" position="after"> |
|||
<field name="payment_id" readonly="1"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |