diff --git a/send_email_payslips/__init__.py b/send_email_payslips/__init__.py new file mode 100644 index 000000000..e393d149e --- /dev/null +++ b/send_email_payslips/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 . +# +############################################################################## +from . import models diff --git a/send_email_payslips/__openerp__.py b/send_email_payslips/__openerp__.py new file mode 100644 index 000000000..ed0a6827e --- /dev/null +++ b/send_email_payslips/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 . +# +############################################################################## +{ + '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, +} diff --git a/send_email_payslips/models/__init__.py b/send_email_payslips/models/__init__.py new file mode 100644 index 000000000..8ca41d5fe --- /dev/null +++ b/send_email_payslips/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 . +# +############################################################################## + +from . import send_payslip diff --git a/send_email_payslips/models/send_payslip.py b/send_email_payslips/models/send_payslip.py new file mode 100644 index 000000000..24604c54d --- /dev/null +++ b/send_email_payslips/models/send_payslip.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 . +# +############################################################################## + +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, + } diff --git a/send_email_payslips/static/description/banner.jpg b/send_email_payslips/static/description/banner.jpg new file mode 100644 index 000000000..f585caa20 Binary files /dev/null and b/send_email_payslips/static/description/banner.jpg differ diff --git a/send_email_payslips/static/description/cybro_logo.png b/send_email_payslips/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/send_email_payslips/static/description/cybro_logo.png differ diff --git a/send_email_payslips/static/description/icon.png b/send_email_payslips/static/description/icon.png new file mode 100644 index 000000000..15704fe49 Binary files /dev/null and b/send_email_payslips/static/description/icon.png differ diff --git a/send_email_payslips/static/description/index.html b/send_email_payslips/static/description/index.html new file mode 100644 index 000000000..7581c8ba3 --- /dev/null +++ b/send_email_payslips/static/description/index.html @@ -0,0 +1,56 @@ +
+
+

Send Email Payslips

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features

+
    +
  • Send By Email Button in payslip view.
  • +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+

Email template with attached payslip.

+
+ +
+
+
+ +
+

Need Any Help?

+ +
+ diff --git a/send_email_payslips/static/description/payslip_send_mail_01.png b/send_email_payslips/static/description/payslip_send_mail_01.png new file mode 100644 index 000000000..44814f52b Binary files /dev/null and b/send_email_payslips/static/description/payslip_send_mail_01.png differ diff --git a/send_email_payslips/static/description/payslip_send_mail_02.png b/send_email_payslips/static/description/payslip_send_mail_02.png new file mode 100644 index 000000000..1f54a6e6a Binary files /dev/null and b/send_email_payslips/static/description/payslip_send_mail_02.png differ diff --git a/send_email_payslips/views/payslip_mail_template.xml b/send_email_payslips/views/payslip_mail_template.xml new file mode 100644 index 000000000..9fc3c732e --- /dev/null +++ b/send_email_payslips/views/payslip_mail_template.xml @@ -0,0 +1,49 @@ + + + + + + Payslip - Send by Email + ${object.employee_id.company_id and object.employee_id.company_id.email or ''} + ${object.employee_id.company_id.name} - Ref ${object.name or 'n/a' } + ${object.employee_id.address_home_id.id} + + + + ${(object.name or '').replace('/','_')} + ${object.employee_id.address_home_id.lang} + + +

Hello ${object.employee_id.name},

+
+

Please find attached ${(object.name)}

+

If you have any question, do not hesitate to contact HR.

+
+

Thank you

+
+
+

+ ${object.company_id.name}

+
+
+ + ${object.company_id.partner_id.sudo().with_context(show_address=True, html_format=True).name_get()[0][1] | safe} + + % if object.company_id.phone: +
+ Phone:  ${object.company_id.phone} +
+ % endif + % if object.company_id.website: + + %endif +

+
+ + ]]>
+
+
+
diff --git a/send_email_payslips/views/send_payslip.xml b/send_email_payslips/views/send_payslip.xml new file mode 100644 index 000000000..5e2079693 --- /dev/null +++ b/send_email_payslips/views/send_payslip.xml @@ -0,0 +1,15 @@ + + + + + hr.payslip.form + hr.payslip + + + +