12 changed files with 271 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<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 . import models |
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<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': "Send Email Payslips", |
|||
'version': '9.0.1.0.0', |
|||
'summary': """Send Payslip by Email""", |
|||
'description': """This module allow send payslip by mail""", |
|||
'author': "Cybrosys Techno Solutions", |
|||
'company': "Cybrosys Techno Solutions", |
|||
'website': "http://www.cybrosys.com", |
|||
'category': 'Human Resources', |
|||
'depends': ['base', 'hr', 'hr_payroll'], |
|||
'data': [ |
|||
'views/send_payslip.xml', |
|||
'views/payslip_mail_template.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<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 . import send_payslip |
@ -0,0 +1,63 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<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, api |
|||
|
|||
|
|||
class SendPayslips(models.Model): |
|||
_name = 'hr.payslip' |
|||
_inherit = ['hr.payslip', 'mail.thread'] |
|||
|
|||
@api.multi |
|||
def send_payslip(self): |
|||
""" |
|||
This function opens a window to compose an email, with the edi payslip template message loaded by default |
|||
""" |
|||
self.ensure_one() |
|||
ir_model_data = self.env['ir.model.data'] |
|||
try: |
|||
template_id = ir_model_data.get_object_reference('send_email_payslips', 'email_template_hr_payslip')[1] |
|||
except ValueError: |
|||
template_id = False |
|||
try: |
|||
compose_form_id = ir_model_data.get_object_reference('mail', 'email_compose_message_wizard_form')[1] |
|||
except ValueError: |
|||
compose_form_id = False |
|||
ctx = dict() |
|||
ctx.update({ |
|||
'default_model': 'hr.payslip', |
|||
'default_res_id': self.ids[0], |
|||
'default_use_template': bool(template_id), |
|||
'default_template_id': template_id, |
|||
'default_composition_mode': 'comment', |
|||
}) |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'view_type': 'form', |
|||
'view_mode': 'form', |
|||
'res_model': 'mail.compose.message', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,56 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan">Send Email Payslips</h2> |
|||
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4> |
|||
<div> |
|||
<h4><p>Features</p></h4> |
|||
<ul> |
|||
<li>Send By Email Button in payslip view.</li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="payslip_send_mail_01.png"> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h3 class="oe_slogan">Email template with attached payslip.</h3> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="payslip_send_mail_02.png"> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<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: 92 KiB |
After Width: | Height: | Size: 89 KiB |
@ -0,0 +1,49 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<!--Email template --> |
|||
<record id="email_template_hr_payslip" model="mail.template"> |
|||
<field name="name">Payslip - Send by Email</field> |
|||
<field name="email_from">${object.employee_id.company_id and object.employee_id.company_id.email or ''}</field> |
|||
<field name="subject">${object.employee_id.company_id.name} - Ref ${object.name or 'n/a' }</field> |
|||
<field name="partner_to">${object.employee_id.address_home_id.id}</field> |
|||
<field name="model_id" ref="hr_payroll.model_hr_payslip"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="hr_payroll.action_report_payslip"/> |
|||
<field name="report_name">${(object.name or '').replace('/','_')}</field> |
|||
<field name="lang">${object.employee_id.address_home_id.lang}</field> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.employee_id.name},</p> |
|||
<br/> |
|||
<p>Please find attached <i>${(object.name)}</i></p> |
|||
<p>If you have any question, do not hesitate to contact HR.</p> |
|||
<br/> |
|||
<p>Thank you</p> |
|||
<br/> |
|||
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;"> |
|||
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;"> |
|||
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3> |
|||
</div> |
|||
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;"> |
|||
<span style="color: #222; margin-bottom: 5px; display: block; "> |
|||
${object.company_id.partner_id.sudo().with_context(show_address=True, html_format=True).name_get()[0][1] | safe} |
|||
</span> |
|||
% if object.company_id.phone: |
|||
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> |
|||
Phone: ${object.company_id.phone} |
|||
</div> |
|||
% endif |
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
<p></p> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record model="ir.ui.view" id="employee_payslip_send_mail_form_view"> |
|||
<field name="name">hr.payslip.form</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="//header/button[@name='hr_verify_sheet']" position="before"> |
|||
<button name="send_payslip" string="Send By Email" type="object" class="oe_highlight"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
Loading…
Reference in new issue