diff --git a/lunch_payroll/README.rst b/lunch_payroll/README.rst new file mode 100644 index 000000000..513d43c4f --- /dev/null +++ b/lunch_payroll/README.rst @@ -0,0 +1,36 @@ +Lunch - Payroll +=============== + +Lunch amount of the employee will deduct from the salary + + +Installation +============ +- www.odoo.com/documentation/12.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 + +Author +------ + +Cybrosys Techno Solutions + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + diff --git a/lunch_payroll/__init__.py b/lunch_payroll/__init__.py new file mode 100644 index 000000000..7c378d646 --- /dev/null +++ b/lunch_payroll/__init__.py @@ -0,0 +1,3 @@ +from . import models + + diff --git a/lunch_payroll/__manifest__.py b/lunch_payroll/__manifest__.py new file mode 100644 index 000000000..0565ddae3 --- /dev/null +++ b/lunch_payroll/__manifest__.py @@ -0,0 +1,46 @@ +################################################################################### +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Cybrosys() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License(AGPLv3) 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 Lesser 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 . +# +################################################################################### +{ + 'name': 'Lunch - Payroll', + 'version': '12.0.1.0.0', + 'summary': 'Deduct lunch amount from the employee salary', + 'description': 'Deduct lunch amount from the employee salary', + 'category': 'Tools', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'www.cybrosys.com', + 'depends': ['lunch', 'hr_payroll'], + 'data': [ + 'data/data.xml', + 'views/views.xml', + ], + 'qweb': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} + + + + + diff --git a/lunch_payroll/data/data.xml b/lunch_payroll/data/data.xml new file mode 100644 index 000000000..bd975caf7 --- /dev/null +++ b/lunch_payroll/data/data.xml @@ -0,0 +1,16 @@ + + + + + LUNCH + Lunch + + fix + 0 + 1 + + + + + + \ No newline at end of file diff --git a/lunch_payroll/doc/RELEASE_NOTES.md b/lunch_payroll/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..3641281aa --- /dev/null +++ b/lunch_payroll/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.04.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit diff --git a/lunch_payroll/models/__init__.py b/lunch_payroll/models/__init__.py new file mode 100644 index 000000000..215ca4c47 --- /dev/null +++ b/lunch_payroll/models/__init__.py @@ -0,0 +1,6 @@ +from . import model + + + + + diff --git a/lunch_payroll/models/model.py b/lunch_payroll/models/model.py new file mode 100644 index 000000000..5654c98bb --- /dev/null +++ b/lunch_payroll/models/model.py @@ -0,0 +1,45 @@ +from odoo import api, fields, models, _ + + +class HRSalaryRule(models.Model): + _inherit = 'hr.salary.rule' + + is_lunch = fields.Boolean(string='Is Lunch ?') + + +class HRPayslip(models.Model): + _inherit = 'hr.payslip' + + @api.multi + def compute_sheet(self): + """overrding the compute sheet method to add the lunch value to the payslip""" + for payslip in self: + number = payslip.number or self.env['ir.sequence'].next_by_code('salary.slip') + # delete old payslip lines + payslip.line_ids.unlink() + # set the list of contract for which the rules have to be applied + # if we don't give the contract, then the rules to apply should be for all current contracts of the employee + contract_ids = payslip.contract_id.ids or \ + self.get_contract(payslip.employee_id, payslip.date_from, payslip.date_to) + lines = [(0, 0, line) for line in self._get_payslip_lines(contract_ids, payslip.id)] + lunch_rules = self.env['hr.salary.rule'].search([('is_lunch', '=', True)]).mapped('id') + for line in lines: + if line[2]['salary_rule_id'] in lunch_rules: + amount = self.compute_lunch() + line[2]['amount'] = -amount + payslip.write({'line_ids': lines, 'number': number}) + return True + + @api.multi + def compute_lunch(self): + employee = self.employee_id + amount = 0 + user_id = employee.user_id + if user_id: + lunch_rec = self.env['lunch.order'].search([('user_id', '=', user_id.id), + ('date', '>=', self.date_from), + ('date', '<=', self.date_to), + ('state', '=', 'confirmed')]) + if lunch_rec: + amount = sum(lunch_rec.mapped('total')) + return amount diff --git a/lunch_payroll/static/description/banner.jpg b/lunch_payroll/static/description/banner.jpg new file mode 100644 index 000000000..e4dc67c24 Binary files /dev/null and b/lunch_payroll/static/description/banner.jpg differ diff --git a/lunch_payroll/static/description/icon.png b/lunch_payroll/static/description/icon.png new file mode 100644 index 000000000..e20f822f4 Binary files /dev/null and b/lunch_payroll/static/description/icon.png differ diff --git a/lunch_payroll/static/description/index.html b/lunch_payroll/static/description/index.html new file mode 100644 index 000000000..b2a4de5aa --- /dev/null +++ b/lunch_payroll/static/description/index.html @@ -0,0 +1,348 @@ + +
+
+

+ Lunch - Payroll +

+

+ Deduct lunch amount from the employee salary +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Employee can seamlessly order their lunch using this lunch module. The corresponding amount for the + lunch shall thereafter be deducted from the employee salary of the month. +

+

+ Configuration +

+

+ Add the Salary rule 'Lunch' to the salary structure of the employee. +

+
+
+ +
+
+

+ Features +

+

+ + Link Lunch and Payroll. +

+

+ + Deduct Lunch amount from employee pay slip. +

+
+
+ +
+
+

+ Screenshots +

+

+ + New salary rule named Lunch is added. +

+
+ +
+

+ + This Lunch rule is added to salary structure. +

+
+ +
+

+ + Lunch amount is deducted from the payslip. +

+
+ +
+
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
diff --git a/lunch_payroll/static/description/lunch_payroll_1.jpg b/lunch_payroll/static/description/lunch_payroll_1.jpg new file mode 100644 index 000000000..43e4d27d6 Binary files /dev/null and b/lunch_payroll/static/description/lunch_payroll_1.jpg differ diff --git a/lunch_payroll/static/description/lunch_payroll_2.jpg b/lunch_payroll/static/description/lunch_payroll_2.jpg new file mode 100644 index 000000000..72cea8fe6 Binary files /dev/null and b/lunch_payroll/static/description/lunch_payroll_2.jpg differ diff --git a/lunch_payroll/static/description/lunch_payroll_3.jpg b/lunch_payroll/static/description/lunch_payroll_3.jpg new file mode 100644 index 000000000..502c596de Binary files /dev/null and b/lunch_payroll/static/description/lunch_payroll_3.jpg differ diff --git a/lunch_payroll/views/views.xml b/lunch_payroll/views/views.xml new file mode 100644 index 000000000..38f57220f --- /dev/null +++ b/lunch_payroll/views/views.xml @@ -0,0 +1,16 @@ + + + + + hr.salary.rule + hr.salary.rule + + + + + + + + + +