diff --git a/individual_product_report/README.md b/individual_product_report/README.md new file mode 100644 index 000000000..5bba59bd2 --- /dev/null +++ b/individual_product_report/README.md @@ -0,0 +1,32 @@ +Product Sale Report Graph View +============================== + +Installation +============ +- www.odoo.com/documentation/14.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 + + +Developer: Afras Habis - odoo@cybrosys.com + V14 Muhammed Nafih - odoo@cybrosys.com + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + diff --git a/individual_product_report/__init__.py b/individual_product_report/__init__.py new file mode 100644 index 000000000..7480ba260 --- /dev/null +++ b/individual_product_report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# 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 . +# +################################################################################### + +from . import models \ No newline at end of file diff --git a/individual_product_report/__manifest__.py b/individual_product_report/__manifest__.py new file mode 100644 index 000000000..4354a6434 --- /dev/null +++ b/individual_product_report/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# 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 . +# +###################################################################################. + +{ + 'name': 'Product Sale Report Graph View', + 'version': '14.0.1.0.0', + 'description': "Sale Reports of Individual Products in Graph view", + 'summary': """Sale Report of Individual Products in Graph view""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Sales', + 'depends': ['sale_management'], + 'license': 'AGPL-3', + 'data': [ + 'views/sale_report_view.xml', + ], + "images": ['static/description/banner.png'], + 'installable': True, + 'application': False, + +} diff --git a/individual_product_report/doc/RELEASE_NOTES.md b/individual_product_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..40428f44e --- /dev/null +++ b/individual_product_report/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 31.10.2020 +#### Version 14.0.1.0.0 +#### ADD \ No newline at end of file diff --git a/individual_product_report/models/__init__.py b/individual_product_report/models/__init__.py new file mode 100644 index 000000000..d637fd19f --- /dev/null +++ b/individual_product_report/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# 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 . +# +################################################################################### + +from . import sale_report \ No newline at end of file diff --git a/individual_product_report/models/sale_report.py b/individual_product_report/models/sale_report.py new file mode 100644 index 000000000..79f7f8cd7 --- /dev/null +++ b/individual_product_report/models/sale_report.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# 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 . +# +################################################################################### + +from odoo import models, fields, api + + +class SaleProductTemplateReport(models.Model): + _inherit = 'product.template' + + def action_view_sales_report(self): + """ To view the graph view on click of Sales Report Button in product.template model """ + + action = self.env.ref('individual_product_report.report_sales_product_graph').read()[0] + action['domain'] = [('product_tmpl_id', 'in', self.ids)] + action['context'] = { + 'graph_measure': ['product_uom_qty'], + 'active_id': self._context.get('active_id'), + 'active_model': 'sale.report', + 'search_default_Sales': 1, + 'time_ranges': {'field': 'date', 'range': 'last_365_days'}, + 'group_by': 'date', + } + return action + + +class SaleProductReport(models.Model): + _inherit = 'product.product' + + def action_view_sales_report(self): + """ To view the graph view on click of Sales Report Button in product.product model """ + + action = self.env.ref('individual_product_report.report_sales_product_graph').read()[0] + action['domain'] = [('product_id', 'in', self.ids)] + action['context'] = { + 'graph_measure': ['product_uom_qty'], + 'active_id': self._context.get('active_id'), + 'active_model': 'sale.report', + 'search_default_Sales': 1, + 'time_ranges': {'field': 'date', 'range': 'last_365_days'}, + 'group_by': 'date', + } + return action diff --git a/individual_product_report/static/description/banner.png b/individual_product_report/static/description/banner.png new file mode 100644 index 000000000..83557693a Binary files /dev/null and b/individual_product_report/static/description/banner.png differ diff --git a/individual_product_report/static/description/icon.png b/individual_product_report/static/description/icon.png new file mode 100644 index 000000000..d69b6a26d Binary files /dev/null and b/individual_product_report/static/description/icon.png differ diff --git a/individual_product_report/static/description/images/1st.png b/individual_product_report/static/description/images/1st.png new file mode 100644 index 000000000..26c4aceaf Binary files /dev/null and b/individual_product_report/static/description/images/1st.png differ diff --git a/individual_product_report/static/description/images/2nd.png b/individual_product_report/static/description/images/2nd.png new file mode 100644 index 000000000..0ca062c90 Binary files /dev/null and b/individual_product_report/static/description/images/2nd.png differ diff --git a/individual_product_report/static/description/images/3rd.png b/individual_product_report/static/description/images/3rd.png new file mode 100644 index 000000000..d256729bc Binary files /dev/null and b/individual_product_report/static/description/images/3rd.png differ diff --git a/individual_product_report/static/description/images/4th.png b/individual_product_report/static/description/images/4th.png new file mode 100644 index 000000000..967c7d49b Binary files /dev/null and b/individual_product_report/static/description/images/4th.png differ diff --git a/individual_product_report/static/description/images/bank.png b/individual_product_report/static/description/images/bank.png new file mode 100644 index 000000000..088d9be88 Binary files /dev/null and b/individual_product_report/static/description/images/bank.png differ diff --git a/individual_product_report/static/description/images/cash.jpeg b/individual_product_report/static/description/images/cash.jpeg new file mode 100644 index 000000000..b7a48f2f4 Binary files /dev/null and b/individual_product_report/static/description/images/cash.jpeg differ diff --git a/individual_product_report/static/description/images/checked.png b/individual_product_report/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/individual_product_report/static/description/images/checked.png differ diff --git a/individual_product_report/static/description/images/cybrosys.png b/individual_product_report/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/individual_product_report/static/description/images/cybrosys.png differ diff --git a/individual_product_report/static/description/images/dynamic.png b/individual_product_report/static/description/images/dynamic.png new file mode 100644 index 000000000..b025b5c48 Binary files /dev/null and b/individual_product_report/static/description/images/dynamic.png differ diff --git a/individual_product_report/static/description/images/excel.png b/individual_product_report/static/description/images/excel.png new file mode 100644 index 000000000..60b9433b3 Binary files /dev/null and b/individual_product_report/static/description/images/excel.png differ diff --git a/individual_product_report/static/description/images/inventory.png b/individual_product_report/static/description/images/inventory.png new file mode 100644 index 000000000..5aa67e261 Binary files /dev/null and b/individual_product_report/static/description/images/inventory.png differ diff --git a/individual_product_report/static/description/images/produt_sale_report.png b/individual_product_report/static/description/images/produt_sale_report.png new file mode 100644 index 000000000..810a03900 Binary files /dev/null and b/individual_product_report/static/description/images/produt_sale_report.png differ diff --git a/individual_product_report/static/description/images/tax.png b/individual_product_report/static/description/images/tax.png new file mode 100644 index 000000000..fc94d26e6 Binary files /dev/null and b/individual_product_report/static/description/images/tax.png differ diff --git a/individual_product_report/static/description/index.html b/individual_product_report/static/description/index.html new file mode 100644 index 000000000..0b6a2725b --- /dev/null +++ b/individual_product_report/static/description/index.html @@ -0,0 +1,523 @@ +
+ cybrosys-logo
+
+
+
+

Product Sale Report Graph View

+
+

Key Highlights

+
    +
  • checkSale reports of individual products in graph view +
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This module is used to get the sale report of individual products in graph view +

+
+
+ +

Product Sale Report Graph View

+
+
    +
  • + Individual + product sale report in Line chart +
  • +
+
    +
  • + Individual + product sale report in Bar chart + +
  • +
+
    +
  • + Individual + product sale report in Pie chart + +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

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.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please + let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/individual_product_report/views/sale_report_view.xml b/individual_product_report/views/sale_report_view.xml new file mode 100644 index 000000000..52895e1cf --- /dev/null +++ b/individual_product_report/views/sale_report_view.xml @@ -0,0 +1,46 @@ + + + + + + + product.template.sale.report.button + product.template + + + +
+ +
+
+
+ + + + + product.product.sale.report.button + product.product + + + +
+ +
+
+
+ + + + Sales Analysis + sale.report + graph + + +
+
\ No newline at end of file diff --git a/insurance_management_cybro/README.rst b/insurance_management_cybro/README.rst new file mode 100644 index 000000000..0ea091dcc --- /dev/null +++ b/insurance_management_cybro/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Insurance Management +==================== +This module will used for Insurance Management & Operations. + + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: Niyas Raphy@cybrosys + Sreejith P @cybrosys + Version 13: Nimisha Murali@cybrosys + Version 14: Muhammed nafih@cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ + + diff --git a/insurance_management_cybro/__init__.py b/insurance_management_cybro/__init__.py new file mode 100755 index 000000000..e48f2d890 --- /dev/null +++ b/insurance_management_cybro/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models diff --git a/insurance_management_cybro/__manifest__.py b/insurance_management_cybro/__manifest__.py new file mode 100755 index 000000000..7577ca2fd --- /dev/null +++ b/insurance_management_cybro/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +{ + 'name': 'Insurance Management', + 'version': '14.0.1.0.0', + 'summary': """Insurance Management & Operations""", + 'description': """Insurance Management""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Industries', + 'depends': ['base', 'account'], + 'license': 'AGPL-3', + 'data': [ + 'views/insurance_details.xml', + 'views/claim_details.xml', + 'views/employee_details.xml', + 'views/policy_management.xml', + 'views/insurance_sequence.xml', + 'views/insurance_management.xml', + 'security/ir.model.access.csv', + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'application': True, + 'auto_install': False, +} + diff --git a/insurance_management_cybro/doc/RELEASE_NOTES.md b/insurance_management_cybro/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..00012d1c6 --- /dev/null +++ b/insurance_management_cybro/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 31.10.2020 +#### Version 14.0.1.0.0 +#### ADD +Initial commit for Insurance Management + + + diff --git a/insurance_management_cybro/models/__init__.py b/insurance_management_cybro/models/__init__.py new file mode 100755 index 000000000..bbd1b7465 --- /dev/null +++ b/insurance_management_cybro/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import insurance_model +from . import claim_details +from . import employee_details +from . import policy_details diff --git a/insurance_management_cybro/models/claim_details.py b/insurance_management_cybro/models/claim_details.py new file mode 100755 index 000000000..caac7fc04 --- /dev/null +++ b/insurance_management_cybro/models/claim_details.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields, api, _ + + +class ClaimDetails(models.Model): + _name = 'claim.details' + + name = fields.Char(string='Name', required=True, copy=False, readonly=True, index=True, + default=lambda self: _('New')) + name_2 = fields.Char(string='Name 2', required=True, copy=False, readonly=True, index=True, + default=lambda self: _('New')) + insurance_id = fields.Many2one('insurance.details', required=True) + partner_id = fields.Many2one(related='insurance_id.partner_id', string='Customer', readonly=True) + policy_id = fields.Many2one(related='insurance_id.policy_id', string='Policy', readonly=True) + employee_id = fields.Many2one(related='insurance_id.employee_id', string='Agent', readonly=True) + amount = fields.Float(related='insurance_id.amount', string='Amount') + date_claimed = fields.Date(string='Date Applied', default=fields.Date.today()) + invoice_id = fields.Many2one('account.move', string='Invoiced', readonly=True, copy=False) + note_field = fields.Html(string='Comment') + + @api.model + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code('claim.details') or 'New' + return super(ClaimDetails, self).create(vals) + + + def create_invoice(self): + if not self.invoice_id: + invoice_val = self.env['account.move'].create({ + 'move_type': 'in_invoice', + 'partner_id': self.partner_id.id, + 'invoice_user_id': self.env.user.id, + 'claim_id': self.id, + 'invoice_origin': self.name, + 'invoice_line_ids': [(0, 0, { + 'name': 'Invoice For Insurance Claim', + 'quantity': 1, + 'price_unit': self.amount, + 'account_id': 41, + })], + }) + self.invoice_id = invoice_val diff --git a/insurance_management_cybro/models/employee_details.py b/insurance_management_cybro/models/employee_details.py new file mode 100755 index 000000000..3e24e9a99 --- /dev/null +++ b/insurance_management_cybro/models/employee_details.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class EmployeeDetails(models.Model): + _name = 'employee.details' + + name = fields.Char(string='Name', required=True) + related_partner = fields.Many2one('res.users', string='Related User', copy=False) + sex = fields.Selection([('male', 'Male'), ('female', 'Female')]) + phone = fields.Float(string='Phone Number', size=15, digits=(15, 0)) + salary_type = fields.Selection([('fixed', 'Fixed'), ('commission', 'Commission'), ('both', 'Both')], + default='commission', required=True) + base_salary = fields.Integer(string='Base Salary') + last_salary = fields.Date(string='Last Payment On', copy=False) + insurance_ids = fields.One2many('insurance.details', 'employee_id', string='Last Payment On', readonly=True) + note_field = fields.Html(string='Comment') + invoice_id = fields.Many2one('account.move', string='Last payment', copy=False, readonly=True) + + + def salary_payment(self): + if self.invoice_id: + if self.invoice_id.state == 'draft': + raise UserError(_("You Must validate last payment made in order to create a new payment")) + amount = 0 + if self.base_salary == 0: + raise UserError(_("Amount should be greater than zero")) + if self.salary_type == 'fixed': + amount = self.base_salary + elif self.salary_type == 'commission': + for ins in self.insurance_ids: + if self.last_salary: + if ins.date_start > self.last_salary: + amount += (ins.commission_rate * ins.amount)/100 + else: + amount = self.base_salary + for ins in self.insurance_ids: + if ins.date_start > self.last_salary: + amount += (ins.commission_rate * ins.amount) / 100 + + + invoice_date = self.env['account.move'].create({ + 'move_type': 'in_invoice', + 'partner_id': self.related_partner.partner_id.id, + 'invoice_user_id': self.env.user.id, + 'claim_id': self.id, + 'invoice_origin': self.name, + 'invoice_line_ids': [(0, 0, { + 'name': 'Invoice For Insurance Claim', + 'quantity': 1, + 'price_unit': amount, + 'account_id': 41, + })], + }) + self.write({ + 'invoice_id': invoice_date.id, + 'last_salary': fields.Date.today() + }) diff --git a/insurance_management_cybro/models/insurance_model.py b/insurance_management_cybro/models/insurance_model.py new file mode 100755 index 000000000..fea1eb2bb --- /dev/null +++ b/insurance_management_cybro/models/insurance_model.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class InsuranceDetails(models.Model): + _name = 'insurance.details' + + name = fields.Char(string='Name', required=True, copy=False, readonly=True, index=True, + default=lambda self: _('New')) + partner_id = fields.Many2one('res.partner', string='Customer', required=True) + date_start = fields.Date(string='Date Started', default=fields.Date.today(), required=True) + close_date = fields.Date(string='Date Closed') + invoice_ids = fields.One2many('account.move', 'insurance_id', string='Invoices', readonly=True) + employee_id = fields.Many2one('employee.details', string='Agent', required=True) + commission_rate = fields.Float(string='Commission Percentage') + policy_id = fields.Many2one('policy.details', string='Policy', required=True) + amount = fields.Float(related='policy_id.amount', string='Amount') + state = fields.Selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('closed', 'Closed')], + required=True, default='draft') + hide_inv_button = fields.Boolean(copy=False) + note_field = fields.Html(string='Comment') + + + def confirm_insurance(self): + if self.amount > 0: + self.state = 'confirmed' + self.hide_inv_button = True + else: + raise UserError(_("Amount should be Greater than Zero")) + + + def create_invoice(self): + created_invoice=self.env['account.move'].create({ + 'move_type': 'out_invoice', + 'partner_id': self.partner_id.id, + 'invoice_user_id': self.env.user.id, + 'invoice_origin': self.name, + 'invoice_line_ids': [(0, 0, { + 'name': 'Invoice For Insurance', + 'quantity': 1, + 'price_unit': self.amount, + 'account_id': 41, + })], + }) + self.invoice_ids = created_invoice + if self.policy_id.payment_type == 'fixed': + self.hide_inv_button = False + + def close_insurance(self): + for records in self.invoice_ids: + if records.state == 'paid': + raise UserError(_("All invoices must be Paid")) + self.state = 'closed' + self.hide_inv_button = False + + @api.model + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code('insurance.details') or 'New' + return super(InsuranceDetails, self).create(vals) + + +class AccountInvoiceRelate(models.Model): + _inherit = 'account.move' + + insurance_id = fields.Many2one('insurance.details', string='Insurance') + claim_id = fields.Many2one('claim.details', string='Insurance') diff --git a/insurance_management_cybro/models/policy_details.py b/insurance_management_cybro/models/policy_details.py new file mode 100755 index 000000000..e6c1ccf03 --- /dev/null +++ b/insurance_management_cybro/models/policy_details.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields + + +class PolicyDetails(models.Model): + _name = 'policy.details' + + name = fields.Char(string='Name', required=True) + policy_type = fields.Many2one('policy.type', string='Policy Type', required=True) + payment_type = fields.Selection([('fixed', 'Fixed'), ('installment', 'Installment')], + required=True, default='fixed') + amount = fields.Float(string='Amount', required=True) + policy_duration = fields.Integer(string='Duration in Days', required=True) + note_field = fields.Html(string='Comment') + + +class PolicyType(models.Model): + _name = 'policy.type' + + name = fields.Char(string='Name') diff --git a/insurance_management_cybro/security/ir.model.access.csv b/insurance_management_cybro/security/ir.model.access.csv new file mode 100755 index 000000000..4635a099d --- /dev/null +++ b/insurance_management_cybro/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_claim_details,access.claim.details,model_claim_details,base.group_user,1,1,1,1 +access_employee_details,access.employee.details,model_employee_details,base.group_user,1,1,1,1 +access_insurance_details,access.insurance.details,model_insurance_details,base.group_user,1,1,1,1 +access_policy_details,access.policy.details,model_policy_details,base.group_user,1,1,1,1 +access_policy_type,access.policy.type,model_policy_type,base.group_user,1,1,1,1 +access_account_move,access.account.move,model_account_move,base.group_user,1,1,1,1 diff --git a/insurance_management_cybro/static/description/banner.png b/insurance_management_cybro/static/description/banner.png new file mode 100644 index 000000000..ea94ba10d Binary files /dev/null and b/insurance_management_cybro/static/description/banner.png differ diff --git a/insurance_management_cybro/static/description/icon.png b/insurance_management_cybro/static/description/icon.png new file mode 100644 index 000000000..fcd5f6107 Binary files /dev/null and b/insurance_management_cybro/static/description/icon.png differ diff --git a/insurance_management_cybro/static/description/images/agent manage.png b/insurance_management_cybro/static/description/images/agent manage.png new file mode 100644 index 000000000..089225eb0 Binary files /dev/null and b/insurance_management_cybro/static/description/images/agent manage.png differ diff --git a/insurance_management_cybro/static/description/images/banner_lifeline_for_task.jpeg b/insurance_management_cybro/static/description/images/banner_lifeline_for_task.jpeg new file mode 100644 index 000000000..4a467ea22 Binary files /dev/null and b/insurance_management_cybro/static/description/images/banner_lifeline_for_task.jpeg differ diff --git a/insurance_management_cybro/static/description/images/banner_project_report_xls_pdf.png b/insurance_management_cybro/static/description/images/banner_project_report_xls_pdf.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/insurance_management_cybro/static/description/images/banner_project_report_xls_pdf.png differ diff --git a/insurance_management_cybro/static/description/images/banner_project_status_report.png b/insurance_management_cybro/static/description/images/banner_project_status_report.png new file mode 100644 index 000000000..d1b689710 Binary files /dev/null and b/insurance_management_cybro/static/description/images/banner_project_status_report.png differ diff --git a/insurance_management_cybro/static/description/images/banner_subtask.jpeg b/insurance_management_cybro/static/description/images/banner_subtask.jpeg new file mode 100644 index 000000000..f2b224110 Binary files /dev/null and b/insurance_management_cybro/static/description/images/banner_subtask.jpeg differ diff --git a/insurance_management_cybro/static/description/images/banner_task_deadline_reminder.jpeg b/insurance_management_cybro/static/description/images/banner_task_deadline_reminder.jpeg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/insurance_management_cybro/static/description/images/banner_task_deadline_reminder.jpeg differ diff --git a/insurance_management_cybro/static/description/images/banner_task_statusbar.jpeg b/insurance_management_cybro/static/description/images/banner_task_statusbar.jpeg new file mode 100644 index 000000000..2c57cbb7b Binary files /dev/null and b/insurance_management_cybro/static/description/images/banner_task_statusbar.jpeg differ diff --git a/insurance_management_cybro/static/description/images/checked.png b/insurance_management_cybro/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/insurance_management_cybro/static/description/images/checked.png differ diff --git a/insurance_management_cybro/static/description/images/claim.png b/insurance_management_cybro/static/description/images/claim.png new file mode 100644 index 000000000..572174daf Binary files /dev/null and b/insurance_management_cybro/static/description/images/claim.png differ diff --git a/insurance_management_cybro/static/description/images/customer.png b/insurance_management_cybro/static/description/images/customer.png new file mode 100644 index 000000000..c95a5f34c Binary files /dev/null and b/insurance_management_cybro/static/description/images/customer.png differ diff --git a/insurance_management_cybro/static/description/images/cybrosys.png b/insurance_management_cybro/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/insurance_management_cybro/static/description/images/cybrosys.png differ diff --git a/insurance_management_cybro/static/description/images/insurance-1.png b/insurance_management_cybro/static/description/images/insurance-1.png new file mode 100644 index 000000000..df83039ba Binary files /dev/null and b/insurance_management_cybro/static/description/images/insurance-1.png differ diff --git a/insurance_management_cybro/static/description/images/insurance.png b/insurance_management_cybro/static/description/images/insurance.png new file mode 100644 index 000000000..eb5feded6 Binary files /dev/null and b/insurance_management_cybro/static/description/images/insurance.png differ diff --git a/insurance_management_cybro/static/description/images/policy manage.png b/insurance_management_cybro/static/description/images/policy manage.png new file mode 100644 index 000000000..c3d22780c Binary files /dev/null and b/insurance_management_cybro/static/description/images/policy manage.png differ diff --git a/insurance_management_cybro/static/description/index.html b/insurance_management_cybro/static/description/index.html new file mode 100644 index 000000000..0520a16c9 --- /dev/null +++ b/insurance_management_cybro/static/description/index.html @@ -0,0 +1,329 @@ +
cybrosys-logo
+
+
+
+

Insurance Management

+

Manage Insurance Business easily

+
+

Key Highlights

+
    +
  • Create insurance policies for customers.
  • +
  • Manage insurance claims and details.
  • +
  • Manage agents salary and commission.
  • +
  • Create accounting entries for all details.
  • + +
+
+
+
+ +
+
+
+
+ +
+
+ +

Overview

+
+

+ Aims Insurance business. It allows you to manage all kind of insurances in a practical way.

+
+
+ +

Insurance Management

+
+
    +
  • + Create insurance policies for customers. +
  • + +
  • + Manage insurance claims and details. +
  • + +
  • + Manage agents salary and commission. +
  • + +
  • + Create accounting entries for all details. +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/insurance_management_cybro/views/claim_details.xml b/insurance_management_cybro/views/claim_details.xml new file mode 100755 index 000000000..05c835610 --- /dev/null +++ b/insurance_management_cybro/views/claim_details.xml @@ -0,0 +1,69 @@ + + + + + + Claim Details + claim.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
+
+
+
+ + + Claim Details + claim.details + + + + + + + + + + + + + Claim Management + claim.details + tree,form + +

+ You have'nt created any claims yet. +

+
+
+
+ +
\ No newline at end of file diff --git a/insurance_management_cybro/views/employee_details.xml b/insurance_management_cybro/views/employee_details.xml new file mode 100755 index 000000000..fda1e96b4 --- /dev/null +++ b/insurance_management_cybro/views/employee_details.xml @@ -0,0 +1,70 @@ + + + + + + Employee Details + employee.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + Employee Details + employee.details + + + + + + + + + + + + Employee Management + employee.details + tree,form + +

+ You have'nt created any employee yet. +

+
+
+
+ +
\ No newline at end of file diff --git a/insurance_management_cybro/views/insurance_details.xml b/insurance_management_cybro/views/insurance_details.xml new file mode 100755 index 000000000..a02cf1bb6 --- /dev/null +++ b/insurance_management_cybro/views/insurance_details.xml @@ -0,0 +1,77 @@ + + + + + + Insurance Details + insurance.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + Insurance Details + insurance.details + + + + + + + + + + + + + Insurance Management + insurance.details + tree,form + +

+ You have'nt created any insurance yet. +

+
+
+
+ +
\ No newline at end of file diff --git a/insurance_management_cybro/views/insurance_management.xml b/insurance_management_cybro/views/insurance_management.xml new file mode 100755 index 000000000..86ee073ce --- /dev/null +++ b/insurance_management_cybro/views/insurance_management.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + diff --git a/insurance_management_cybro/views/insurance_sequence.xml b/insurance_management_cybro/views/insurance_sequence.xml new file mode 100755 index 000000000..ecd30c2a5 --- /dev/null +++ b/insurance_management_cybro/views/insurance_sequence.xml @@ -0,0 +1,19 @@ + + + + + Insurance Details + insurance.details + INS/ + 3 + + + + Claim Details + claim.details + CLM/ + 3 + + + + \ No newline at end of file diff --git a/insurance_management_cybro/views/policy_management.xml b/insurance_management_cybro/views/policy_management.xml new file mode 100755 index 000000000..382a603da --- /dev/null +++ b/insurance_management_cybro/views/policy_management.xml @@ -0,0 +1,58 @@ + + + + + Policy Details + policy.details + +
+ +
+

+ +

+
+ + + + + + + + + + + + + + + +
+
+
+
+ + Policy Details + policy.details + + + + + + + + + + + + Policy Management + policy.details + tree,form + +

+ You have'nt created any policy yet. +

+
+
+
+
\ No newline at end of file diff --git a/invoice_multi_approval/README.rst b/invoice_multi_approval/README.rst new file mode 100644 index 000000000..a8411a5c5 --- /dev/null +++ b/invoice_multi_approval/README.rst @@ -0,0 +1,41 @@ +Invoice multi level approval +============================ +* Enables the option for adding multiple approvals to the invoice documents + +Installation +============ +- www.odoo.com/documentation/14.0/setup/install.html +- Install our custom addon + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: Sayooj A O + Version 14 Muhammed Nafih @cybrosys + + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/invoice_multi_approval/__init__.py b/invoice_multi_approval/__init__.py new file mode 100644 index 000000000..2ac9ce16c --- /dev/null +++ b/invoice_multi_approval/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/invoice_multi_approval/__manifest__.py b/invoice_multi_approval/__manifest__.py new file mode 100644 index 000000000..2ad62b774 --- /dev/null +++ b/invoice_multi_approval/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Invoice Multi level Approval", + 'version': '14.0.1.0.0', + 'summary': """This module add the multiple approval option for invoice, + bill,refund and credit notes.""", + 'description': """This module add the multiple approval option for invoice, + bill,refund and credit notes.""", + 'category': 'Accounting', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['account'], + 'data': [ + 'data/data.xml', + 'security/groups.xml', + 'security/ir.model.access.csv', + 'views/invoice_approval_view.xml', + 'views/account_move_inherited.xml', + ], + 'license': "AGPL-3", + 'images': ['static/description/banner.png'], + 'installable': True, + 'application': True, +} diff --git a/invoice_multi_approval/data/data.xml b/invoice_multi_approval/data/data.xml new file mode 100644 index 000000000..6e2af647f --- /dev/null +++ b/invoice_multi_approval/data/data.xml @@ -0,0 +1,9 @@ + + + + + True + True + + + \ No newline at end of file diff --git a/invoice_multi_approval/doc/RELEASE_NOTES.md b/invoice_multi_approval/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9c519f07c --- /dev/null +++ b/invoice_multi_approval/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 31.10.2020 +#### Version 14.0.1.0.0 +##### ADD +- Initial commit diff --git a/invoice_multi_approval/models/__init__.py b/invoice_multi_approval/models/__init__.py new file mode 100644 index 000000000..3920246a8 --- /dev/null +++ b/invoice_multi_approval/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import account_move +from . import invoice_approval diff --git a/invoice_multi_approval/models/account_move.py b/invoice_multi_approval/models/account_move.py new file mode 100644 index 000000000..b0eb1f525 --- /dev/null +++ b/invoice_multi_approval/models/account_move.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class AccountMove(models.Model): + _inherit = 'account.move' + + approval_ids = fields.One2many('approval.line', 'move_id') + document_fully_approved = fields.Boolean(compute='_compute_document_fully_approved') + check_approve_ability = fields.Boolean(compute='_compute_check_approve_ability') + is_approved = fields.Boolean(compute='_compute_is_approved') + page_visibility = fields.Boolean(compute='_compute_page_visibility') + + @api.depends('approval_ids') + def _compute_page_visibility(self): + """Compute function for making the approval page visible/invisible""" + if self.approval_ids: + self.page_visibility = True + else: + self.page_visibility = False + + @api.onchange('partner_id') + def _onchange_partner_id(self): + """This is the onchange function of the partner which loads the + persons for the approval to the approver table of the account.move""" + res = super(AccountMove, self)._onchange_partner_id() + invoice_approval_id = self.env['invoice.approval'].search([]) + self.approval_ids = None + if invoice_approval_id.approve_customer_invoice and self.move_type == 'out_invoice': + for user in invoice_approval_id.invoice_approver_ids: + vals = { + 'approver_id': user.id + } + self.approval_ids |= self.approval_ids.new(vals) + elif invoice_approval_id.approve_vendor_bill and self.move_type == 'in_invoice': + for user in invoice_approval_id.bill_approver_ids: + vals = { + 'approver_id': user.id + } + self.approval_ids |= self.approval_ids.new(vals) + elif invoice_approval_id.approve_customer_credit and self.move_type == 'out_refund': + for user in invoice_approval_id.cust_credit_approver_ids: + vals = { + 'approver_id': user.id + } + self.approval_ids |= self.approval_ids.new(vals) + elif invoice_approval_id.approve_vendor_credit and self.move_type == 'in_refund': + for user in invoice_approval_id.vend_credit_approver_ids: + vals = { + 'approver_id': user.id + } + self.approval_ids |= self.approval_ids.new(vals) + return res + + @api.depends('approval_ids.approver_id') + def _compute_check_approve_ability(self): + """This is the compute function which check the current + logged in user is eligible or not for approving the document""" + current_user = self.env.uid + approvers_list = [] + for approver in self.approval_ids: + approvers_list.append(approver.approver_id.id) + if current_user in approvers_list: + self.check_approve_ability = True + else: + self.check_approve_ability = False + + def invoice_approve(self): + """This is the function of the approve button also + updates the approval table values according to the + approval of the users""" + self.ensure_one() + current_user = self.env.uid + for approval_id in self.approval_ids: + if current_user == approval_id.approver_id.id: + approval_id.update({'approval_status': True}) + + def _compute_is_approved(self): + """In this compute function we are verifying whether the document + is approved/not approved by the current logged in user""" + current_user = self.env.uid + if self.invoice_line_ids and self.approval_ids: + for approval_id in self.approval_ids: + if current_user == approval_id.approver_id.id: + if approval_id.approval_status: + self.is_approved = True + break + else: + self.is_approved = False + else: + self.is_approved = False + else: + self.is_approved = False + + @api.depends('approval_ids') + def _compute_document_fully_approved(self): + """This is the compute function which verifies whether + the document is completely approved or not""" + length_approval_ids = len(self.approval_ids) + approval_ids = self.approval_ids + approve_lines = approval_ids.filtered(lambda item: item.approval_status) + length_approve_lines = len(approve_lines) + if length_approval_ids == length_approve_lines: + self.document_fully_approved = True + else: + self.document_fully_approved = False + + +class ApprovalLine(models.Model): + _name = 'approval.line' + _description = 'Approval line in Move' + + move_id = fields.Many2one('account.move') + approver_id = fields.Many2one('res.users', string='Approver') + approval_status = fields.Boolean(string='Status') diff --git a/invoice_multi_approval/models/invoice_approval.py b/invoice_multi_approval/models/invoice_approval.py new file mode 100644 index 000000000..c467b0e9d --- /dev/null +++ b/invoice_multi_approval/models/invoice_approval.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class InvoiceApproval(models.Model): + _name = 'invoice.approval' + _rec_name = 'name' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Invoice Approval' + + name = fields.Char(default='Approval Configuration') + approve_customer_invoice = fields.Boolean(string="Approval on Customer Invoice", + help='Enable this field for adding the approvals for the customer invoice') + invoice_approver_ids = fields.Many2many('res.users', 'invoice_id', string='Invoice Approver', domain=lambda self: [ + ('groups_id', 'in', self.env.ref('invoice_multi_approval.group_approver').id)], + help='In this field you can add the approvers for the customer invoice') + approve_vendor_bill = fields.Boolean(string="Approval on Vendor Bill", + help='Enable this field for adding the approvals for the Vendor bill') + bill_approver_ids = fields.Many2many('res.users', 'bill_id', string='Bill Approver', domain=lambda self: [ + ('groups_id', 'in', self.env.ref('invoice_multi_approval.group_approver').id)], + help='In this field you can add the approvers for the Vendor bill') + approve_customer_credit = fields.Boolean(string='Approval on Customer Refund', + help='Enable this field for adding the approvals for the customer credit note') + cust_credit_approver_ids = fields.Many2many('res.users', 'cust_credit_id', string='Customer Credit Note Approver', + domain=lambda self: [ + ('groups_id', 'in', + self.env.ref('invoice_multi_approval.group_approver').id)], + help='In this field you can add the approvers for the Customer credit note') + approve_vendor_credit = fields.Boolean(string='Approval on Vendor Refund', + help='Enable this field for adding the approvals for the Vendor credit note') + vend_credit_approver_ids = fields.Many2many('res.users', 'vend_credit_id', string='Vendor Credit Note Approver', + domain=lambda self: [ + ('groups_id', 'in', + self.env.ref('invoice_multi_approval.group_approver').id)], + help='In this field you can add the approvers for the Vendor credit note') + + def apply_configuration(self): + """Function for applying the approval configuration""" + return True diff --git a/invoice_multi_approval/security/groups.xml b/invoice_multi_approval/security/groups.xml new file mode 100644 index 000000000..09e31e65d --- /dev/null +++ b/invoice_multi_approval/security/groups.xml @@ -0,0 +1,31 @@ + + + + + Invoice Approval + Access to the invoice approval menu + 3 + + + Approvers + + + + Approve Manager + + + + + Billing Administrator + + + + + Billing + + + + + \ No newline at end of file diff --git a/invoice_multi_approval/security/ir.model.access.csv b/invoice_multi_approval/security/ir.model.access.csv new file mode 100644 index 000000000..2f7d93c53 --- /dev/null +++ b/invoice_multi_approval/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +invoice_approval_access_right_user_id,invoice_approval_access_right_user,model_invoice_approval,invoice_multi_approval.group_approver,1,1,1,1 +invoice_approval_access_right_manager_id,invoice_approval_access_right_manager,model_invoice_approval,invoice_multi_approval.group_approve_manager,1,1,1,1 +approval_line_access_right_user_id,approval_line_access_right_user,model_approval_line,invoice_multi_approval.group_approver,1,1,1,1 +approval_line_access_right_manager_id,approval_line_access_right_manager,model_approval_line,invoice_multi_approval.group_approve_manager,1,1,1,1 +approval_line_access_right_group_user_id,approval_line_access_right_group_user,model_approval_line,base.group_user,1,0,0,0 +invoice_approval_access_right_group_user_id,invoice_approval_access_right_group_user,model_invoice_approval,base.group_user,1,0,0,0 diff --git a/invoice_multi_approval/static/description/banner.png b/invoice_multi_approval/static/description/banner.png new file mode 100644 index 000000000..84a9233a6 Binary files /dev/null and b/invoice_multi_approval/static/description/banner.png differ diff --git a/invoice_multi_approval/static/description/icon.png b/invoice_multi_approval/static/description/icon.png new file mode 100644 index 000000000..858c4784f Binary files /dev/null and b/invoice_multi_approval/static/description/icon.png differ diff --git a/invoice_multi_approval/static/description/images/approval.png b/invoice_multi_approval/static/description/images/approval.png new file mode 100644 index 000000000..e7e8b363a Binary files /dev/null and b/invoice_multi_approval/static/description/images/approval.png differ diff --git a/invoice_multi_approval/static/description/images/banner_barcode_scanning.jpeg b/invoice_multi_approval/static/description/images/banner_barcode_scanning.jpeg new file mode 100644 index 000000000..529143e4e Binary files /dev/null and b/invoice_multi_approval/static/description/images/banner_barcode_scanning.jpeg differ diff --git a/invoice_multi_approval/static/description/images/banner_currency_total.png b/invoice_multi_approval/static/description/images/banner_currency_total.png new file mode 100644 index 000000000..6153ed719 Binary files /dev/null and b/invoice_multi_approval/static/description/images/banner_currency_total.png differ diff --git a/invoice_multi_approval/static/description/images/banner_customer_sequence.jpeg b/invoice_multi_approval/static/description/images/banner_customer_sequence.jpeg new file mode 100644 index 000000000..7451342d6 Binary files /dev/null and b/invoice_multi_approval/static/description/images/banner_customer_sequence.jpeg differ diff --git a/invoice_multi_approval/static/description/images/banner_previous_rates.jpeg b/invoice_multi_approval/static/description/images/banner_previous_rates.jpeg new file mode 100644 index 000000000..e10c28799 Binary files /dev/null and b/invoice_multi_approval/static/description/images/banner_previous_rates.jpeg differ diff --git a/invoice_multi_approval/static/description/images/banner_product_branding.png b/invoice_multi_approval/static/description/images/banner_product_branding.png new file mode 100644 index 000000000..aa12beabb Binary files /dev/null and b/invoice_multi_approval/static/description/images/banner_product_branding.png differ diff --git a/invoice_multi_approval/static/description/images/banner_product_expiry.jpeg b/invoice_multi_approval/static/description/images/banner_product_expiry.jpeg new file mode 100644 index 000000000..84a872d44 Binary files /dev/null and b/invoice_multi_approval/static/description/images/banner_product_expiry.jpeg differ diff --git a/invoice_multi_approval/static/description/images/checked.png b/invoice_multi_approval/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/invoice_multi_approval/static/description/images/checked.png differ diff --git a/invoice_multi_approval/static/description/images/cybrosys.png b/invoice_multi_approval/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/invoice_multi_approval/static/description/images/cybrosys.png differ diff --git a/invoice_multi_approval/static/description/images/invoice_approval_01.png b/invoice_multi_approval/static/description/images/invoice_approval_01.png new file mode 100644 index 000000000..d1957c2ee Binary files /dev/null and b/invoice_multi_approval/static/description/images/invoice_approval_01.png differ diff --git a/invoice_multi_approval/static/description/images/invoice_approval_02.png b/invoice_multi_approval/static/description/images/invoice_approval_02.png new file mode 100644 index 000000000..113211795 Binary files /dev/null and b/invoice_multi_approval/static/description/images/invoice_approval_02.png differ diff --git a/invoice_multi_approval/static/description/images/invoice_approval_03.png b/invoice_multi_approval/static/description/images/invoice_approval_03.png new file mode 100644 index 000000000..42a656803 Binary files /dev/null and b/invoice_multi_approval/static/description/images/invoice_approval_03.png differ diff --git a/invoice_multi_approval/static/description/images/invoice_approval_04.png b/invoice_multi_approval/static/description/images/invoice_approval_04.png new file mode 100644 index 000000000..348892aeb Binary files /dev/null and b/invoice_multi_approval/static/description/images/invoice_approval_04.png differ diff --git a/invoice_multi_approval/static/description/images/invoice_approval_05.png b/invoice_multi_approval/static/description/images/invoice_approval_05.png new file mode 100644 index 000000000..6c1519834 Binary files /dev/null and b/invoice_multi_approval/static/description/images/invoice_approval_05.png differ diff --git a/invoice_multi_approval/static/description/index.html b/invoice_multi_approval/static/description/index.html new file mode 100644 index 000000000..0ec312da4 --- /dev/null +++ b/invoice_multi_approval/static/description/index.html @@ -0,0 +1,542 @@ +
+ cybrosys-logo
+
+
+
+

Invoice Multi Level Approval

+

Module add the multiple approval option for + invoice,bill,refund and credit notes.

+
+

Key Highlights

+
    +
  • checkConfiguration + panel for approval settings. +
  • +
  • checkDocument can + only validate when all approvals are completed. +
  • +
  • checkApproval + Option can be enabled/disabled from the configuration panel. +
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ The module allows to assign the users for the approval process in the invoice documents and + the document can be posted only after the approval process completed. +

+
+
+ +

Configuration panel for approval + settings.

+
+
    +
  • + + Seperate user groups for approver and approval managers. +
  • +
  • + Document + can only validate when all approvals are completed. +
  • +
  • + Approval + Option can be enabled/disabled from the configuration panel. +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

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.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please + let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/invoice_multi_approval/views/account_move_inherited.xml b/invoice_multi_approval/views/account_move_inherited.xml new file mode 100644 index 000000000..cc4409043 --- /dev/null +++ b/invoice_multi_approval/views/account_move_inherited.xml @@ -0,0 +1,48 @@ + + + + account.move.approval.inherited + account.move + + + + + + + + + +