diff --git a/insurance_management_cybro/__init__.py b/insurance_management_cybro/__init__.py new file mode 100644 index 000000000..106231867 --- /dev/null +++ b/insurance_management_cybro/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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 diff --git a/insurance_management_cybro/__manifest__.py b/insurance_management_cybro/__manifest__.py new file mode 100644 index 000000000..56c6e9dba --- /dev/null +++ b/insurance_management_cybro/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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': 'Insurance Management', + 'version': '11.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', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'application': True, + 'auto_install': False, +} + diff --git a/insurance_management_cybro/models/__init__.py b/insurance_management_cybro/models/__init__.py new file mode 100644 index 000000000..bb26c6c6f --- /dev/null +++ b/insurance_management_cybro/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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 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 100644 index 000000000..e5a70a8e3 --- /dev/null +++ b/insurance_management_cybro/models/claim_details.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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 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.Datetime(string='Date Applied', default=fields.Date.today()) + invoice_id = fields.Many2one('account.invoice', 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) + + @api.multi + def create_invoice(self): + if not self.invoice_id: + invoice_val = self.env['account.invoice'].create({ + 'type': 'in_invoice', + 'partner_id': self.partner_id.id, + 'user_id': self.env.user.id, + 'claim_id': self.id, + '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 100644 index 000000000..e986d7e36 --- /dev/null +++ b/insurance_management_cybro/models/employee_details.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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, _ +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.Datetime(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.invoice', string='Last payment', copy=False, readonly=True) + + @api.multi + 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.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 + + if amount == 0: + raise UserError(_("Amount should be greater than zero")) + invoice_date = self.env['account.invoice'].create({ + 'type': 'in_invoice', + 'partner_id': self.related_partner.partner_id.id, + 'user_id': self.env.user.id, + 'claim_id': self.id, + '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 100644 index 000000000..7c32a8380 --- /dev/null +++ b/insurance_management_cybro/models/insurance_model.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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, _ +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.Datetime(string='Date Started', default=fields.Date.today(), required=True) + close_date = fields.Datetime(string='Date Closed') + invoice_ids = fields.One2many('account.invoice', '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') + + @api.multi + 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")) + + @api.multi + def create_invoice(self): + self.env['account.invoice'].create({ + 'type': 'out_invoice', + 'partner_id': self.partner_id.id, + 'user_id': self.env.user.id, + 'insurance_id': self.id, + 'origin': self.name, + 'invoice_line_ids': [(0, 0, { + 'name': 'Invoice For Insurance', + 'quantity': 1, + 'price_unit': self.amount, + 'account_id': 41, + })], + }) + if self.policy_id.payment_type == 'fixed': + self.hide_inv_button = False + + @api.multi + 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.invoice' + + 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 100644 index 000000000..7dbd6b781 --- /dev/null +++ b/insurance_management_cybro/models/policy_details.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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 + + +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/static/description/banner.jpg b/insurance_management_cybro/static/description/banner.jpg new file mode 100644 index 000000000..4a6ba743d Binary files /dev/null and b/insurance_management_cybro/static/description/banner.jpg differ diff --git a/insurance_management_cybro/static/description/cybro_logo.png b/insurance_management_cybro/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/insurance_management_cybro/static/description/cybro_logo.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..3a1514101 Binary files /dev/null and b/insurance_management_cybro/static/description/icon.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..957b323a7 --- /dev/null +++ b/insurance_management_cybro/static/description/index.html @@ -0,0 +1,137 @@ +
+
+

Insurance Management

+

Manage Insurance Business easily

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features:

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

Insurance Management System

+
+
+
+ +
+
+
+

+ Create insurance policies for customers

+

+ Option to create multiple or single insurance based on policy

+

+ Monitor payment details +

+
+ +
+
+
+ +
+
+

Claims Management System

+
+
+
+ +
+
+
+

+ Create and manage customer claims for the insurances +

+ Create payment from the same form +

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

+

+ Create agent details +

+

+ Automated creation of salary or commission +

+

+ Manage payment details +

+

+
+
+
+ +
+
+

Create Policy

+
+
+ +
+
+
+

+ Create All types of policies from here +

+
+
+
+ +
+
+
+
+ +
+

+

+ Customer Details form +

+

+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/insurance_management_cybro/static/description/insurance_1.png b/insurance_management_cybro/static/description/insurance_1.png new file mode 100644 index 000000000..f25a75a70 Binary files /dev/null and b/insurance_management_cybro/static/description/insurance_1.png differ diff --git a/insurance_management_cybro/static/description/insurance_2.png b/insurance_management_cybro/static/description/insurance_2.png new file mode 100644 index 000000000..96d3c353c Binary files /dev/null and b/insurance_management_cybro/static/description/insurance_2.png differ diff --git a/insurance_management_cybro/static/description/insurance_3.png b/insurance_management_cybro/static/description/insurance_3.png new file mode 100644 index 000000000..b8ea64a54 Binary files /dev/null and b/insurance_management_cybro/static/description/insurance_3.png differ diff --git a/insurance_management_cybro/static/description/insurance_4.png b/insurance_management_cybro/static/description/insurance_4.png new file mode 100644 index 000000000..4231b9fa0 Binary files /dev/null and b/insurance_management_cybro/static/description/insurance_4.png differ diff --git a/insurance_management_cybro/static/description/insurance_5.png b/insurance_management_cybro/static/description/insurance_5.png new file mode 100644 index 000000000..7ebc9343f Binary files /dev/null and b/insurance_management_cybro/static/description/insurance_5.png differ diff --git a/insurance_management_cybro/views/claim_details.xml b/insurance_management_cybro/views/claim_details.xml new file mode 100644 index 000000000..6cfb8eaad --- /dev/null +++ b/insurance_management_cybro/views/claim_details.xml @@ -0,0 +1,70 @@ + + + + + + Claim Details + claim.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
+
+
+
+ + + Claim Details + claim.details + + + + + + + + + + + + + Claim Management + claim.details + form + 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 100644 index 000000000..cd137da47 --- /dev/null +++ b/insurance_management_cybro/views/employee_details.xml @@ -0,0 +1,71 @@ + + + + + + Employee Details + employee.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + Employee Details + employee.details + + + + + + + + + + + + Employee Management + employee.details + form + 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 100644 index 000000000..2ccc446f0 --- /dev/null +++ b/insurance_management_cybro/views/insurance_details.xml @@ -0,0 +1,78 @@ + + + + + + Insurance Details + insurance.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + Insurance Details + insurance.details + + + + + + + + + + + + + Insurance Management + insurance.details + form + 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 100644 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 100644 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 100644 index 000000000..d0fc8bd02 --- /dev/null +++ b/insurance_management_cybro/views/policy_management.xml @@ -0,0 +1,59 @@ + + + + + Policy Details + policy.details + +
+ +
+

+ +

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

+ You have'nt created any policy yet. +

+
+
+
+
\ No newline at end of file