@ -0,0 +1,51 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://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 <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
GNU Affero General Public License v3.0 (AGPL v3) |
||||
|
(http://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer: Niyas Raphy , Sreejith P |
||||
|
(V13) Nimisha Murali |
||||
|
(V14) Muhammed Nafih |
||||
|
(V15) Abhishek E T |
||||
|
(V17) Jumana Haseen, |
||||
|
Contact: odoo@cybrosys.com |
||||
|
|
||||
|
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 <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,59 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Insurance Management', |
||||
|
'version': '17.0.1.0.0', |
||||
|
'category': 'Accounting', |
||||
|
'summary': """Insurance Management & Operations of the customers and manage |
||||
|
the insurance claims and the salary of agents with or without the |
||||
|
commission.""", |
||||
|
'description': """Insurance Management and claims based on policies allows |
||||
|
the user to create insurance policies """, |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['account'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'data/payment_type_data.xml', |
||||
|
'data/insurance_details_data.xml', |
||||
|
'data/claim_details_data.xml', |
||||
|
'views/claim_details_views.xml', |
||||
|
'views/employee_details_views.xml', |
||||
|
'views/insurance_details_views.xml', |
||||
|
'views/policy_details_views.xml', |
||||
|
'views/insurance_management_menus.xml', |
||||
|
'views/policy_type_views.xml', |
||||
|
'views/payment_type_views.xml', |
||||
|
], |
||||
|
'assets': { |
||||
|
'web.assets_backend': [ |
||||
|
'account/static/src/components/**/*', |
||||
|
], |
||||
|
}, |
||||
|
'images': ['static/description/banner.png'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'application': True, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Adding sequence for claim details--> |
||||
|
<record id="claim_details_sequence" model="ir.sequence"> |
||||
|
<field name="name">Claim Details</field> |
||||
|
<field name="code">claim.details</field> |
||||
|
<field name="prefix">CLM/</field> |
||||
|
<field name="padding">3</field> |
||||
|
<field name="company_id" eval="False"/> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Adding sequence for insurance--> |
||||
|
<record id="insurance_details_sequence" model="ir.sequence"> |
||||
|
<field name="name">Insurance Details</field> |
||||
|
<field name="code">insurance.details</field> |
||||
|
<field name="prefix">INS/</field> |
||||
|
<field name="padding">3</field> |
||||
|
<field name="company_id" eval="False"/> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<record id ='payment_type_fixed' model="payment.type"> |
||||
|
<field name="name">Fixed</field> |
||||
|
</record> |
||||
|
<record id = 'payment_type_installment' model="payment.type"> |
||||
|
<field name="name">Installment</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,6 @@ |
|||||
|
## Module <insurance_management_cybro> |
||||
|
|
||||
|
#### 12.12.2023 |
||||
|
#### Version 17.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Insurance Management |
@ -0,0 +1,28 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import claim_details |
||||
|
from . import account_move |
||||
|
from . import employee_details |
||||
|
from . import insurance_details |
||||
|
from . import policy_details |
||||
|
from . import policy_type |
||||
|
from . import payment_type |
@ -0,0 +1,33 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import models, fields |
||||
|
|
||||
|
|
||||
|
class AccountMove(models.Model): |
||||
|
"""This class inherits 'account.move' and added fields insurance_id |
||||
|
and claim_id""" |
||||
|
_inherit = 'account.move' |
||||
|
|
||||
|
insurance_id = fields.Many2one('insurance.details', |
||||
|
string='Insurance', |
||||
|
help="Give the insurance details in invoice") |
||||
|
claim_id = fields.Many2one('claim.details', string='Insurance Claim', |
||||
|
help="Give the claim details") |
@ -0,0 +1,85 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models, _ |
||||
|
|
||||
|
|
||||
|
class ClaimDetails(models.Model): |
||||
|
"""This class creates a model 'claim.details' and added fields """ |
||||
|
_name = 'claim.details' |
||||
|
_description = "Claim Details" |
||||
|
|
||||
|
name = fields.Char(string='Name', copy=False, |
||||
|
readonly=True, index=True, default=lambda self: _('New'), |
||||
|
help="Sequence for claim details") |
||||
|
insurance_id = fields.Many2one('insurance.details', required=True, |
||||
|
domain=[('state', '=', 'confirmed')], |
||||
|
string="Insurance", |
||||
|
help="Confirmed orders can be selected") |
||||
|
partner_id = fields.Many2one(related='insurance_id.partner_id', |
||||
|
string='Customer', |
||||
|
help="Partner related to insurance") |
||||
|
policy_id = fields.Many2one(related='insurance_id.policy_id', |
||||
|
string='Policy', |
||||
|
help="Policy related to insurance") |
||||
|
employee_id = fields.Many2one(related='insurance_id.employee_id', |
||||
|
string='Agent', |
||||
|
help="Employee related to insurance") |
||||
|
currency_id = fields.Many2one( |
||||
|
'res.currency', string='Currency', required=True, |
||||
|
default=lambda self: self.env.user.company_id.currency_id.id, |
||||
|
help="default currency") |
||||
|
amount = fields.Monetary(related='insurance_id.amount', string='Amount', |
||||
|
help="Amount related to insurance") |
||||
|
date_claimed = fields.Date( |
||||
|
string='Date Applied', default=fields.Date.context_today, |
||||
|
help="Date of apply of claim details") |
||||
|
invoice_id = fields.Many2one('account.move', string='Invoiced', |
||||
|
readonly=True, copy=False, |
||||
|
help="Invoice related to the claim") |
||||
|
note_field = fields.Html(string='Comment', help="Related notes") |
||||
|
|
||||
|
@api.model |
||||
|
def create(self, vals): |
||||
|
"""Function to create sequence""" |
||||
|
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 action_create_bill(self): |
||||
|
"""Function to create bill with corresponding details""" |
||||
|
if not self.invoice_id: |
||||
|
invoice_val = self.env['account.move'].sudo().create({ |
||||
|
'move_type': 'in_invoice', |
||||
|
'invoice_date': fields.Date.context_today(self), |
||||
|
'partner_id': self.partner_id.id, |
||||
|
'invoice_user_id': self.env.user.id, |
||||
|
'claim_id': self.id, |
||||
|
'invoice_origin': self.name, |
||||
|
'invoice_line_ids': [(fields.Command.create({ |
||||
|
'name': 'Invoice For Insurance Claim', |
||||
|
'quantity': 1, |
||||
|
'price_unit': self.amount, |
||||
|
'account_id': 41, |
||||
|
}))], |
||||
|
}) |
||||
|
self.invoice_id = invoice_val |
@ -0,0 +1,114 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import re |
||||
|
from odoo import api, fields, models, _ |
||||
|
from odoo.exceptions import UserError, ValidationError |
||||
|
|
||||
|
|
||||
|
class EmployeeDetails(models.Model): |
||||
|
"""This class creates a model 'employee.details' and added fields """ |
||||
|
_name = 'employee.details' |
||||
|
_description = "Employee Details" |
||||
|
|
||||
|
name = fields.Char(string='Name', required=True, |
||||
|
help="Name of the employee") |
||||
|
user_id = fields.Many2one( |
||||
|
'res.users', string='Related User', copy=False, |
||||
|
help="Related user") |
||||
|
sex = fields.Selection( |
||||
|
[('male', 'Male'), ('female', 'Female'), ('others', 'Others')], |
||||
|
help="Select the sex of the employee") |
||||
|
phone = fields.Char(string='Phone Number', help="Phone number of employee", |
||||
|
required=True) |
||||
|
salary_type = fields.Selection( |
||||
|
[('fixed', 'Fixed'), ('commission', 'Commission'), ('both', 'Both')], |
||||
|
default='fixed', required=True, help="Select the salary type") |
||||
|
currency_id = fields.Many2one( |
||||
|
'res.currency', string='Currency', required=True, |
||||
|
default=lambda self: self.env.user.company_id.currency_id.id, |
||||
|
help="Select the currency") |
||||
|
base_salary = fields.Monetary(string='Base Salary', |
||||
|
help="Give the base salary of employee") |
||||
|
last_salary_date = fields.Date(string='Last Payment On', copy=False, |
||||
|
help="Last salary paid date") |
||||
|
insurance_ids = fields.One2many('insurance.details', |
||||
|
'employee_id', |
||||
|
string='Last Details', readonly=True, |
||||
|
help="Insurance details created " |
||||
|
"by employee") |
||||
|
note_field = fields.Html(string='Comment', |
||||
|
help="Give notes,if any") |
||||
|
invoice_id = fields.Many2one( |
||||
|
'account.move', string='Last payment', copy=False, |
||||
|
readonly=True, |
||||
|
help="Invoice of last payment") |
||||
|
|
||||
|
def action_salary_payment(self): |
||||
|
"""This function raises a user error if state is draft and |
||||
|
user error when base salary is less |
||||
|
and creates invoice with corresponding details given""" |
||||
|
if self.invoice_id: |
||||
|
if self.invoice_id.state == 'draft': |
||||
|
raise UserError(_("You must validate the last payment made in " |
||||
|
"order to create a new payment")) |
||||
|
amount = 0.0 |
||||
|
if self.salary_type == 'fixed': |
||||
|
amount = self.base_salary |
||||
|
if self.base_salary == 0.0: |
||||
|
raise UserError(_("Amount should be greater than zero")) |
||||
|
elif self.salary_type == 'commission': |
||||
|
for ins in self.insurance_ids: |
||||
|
if self.last_salary_date: |
||||
|
if ins.start_date > self.last_salary_date: |
||||
|
amount += (ins.commission_rate * ins.amount) / 100 |
||||
|
else: |
||||
|
for ins in self.insurance_ids: |
||||
|
if self.last_salary_date: |
||||
|
if ins.start_date > self.last_salary_date: |
||||
|
amount += ((ins.commission_rate * ins.amount) / 100 + |
||||
|
self.base_salary) |
||||
|
invoice_date = self.env['account.move'].sudo().create({ |
||||
|
'move_type': 'in_invoice', |
||||
|
'invoice_date': fields.Date.context_today(self), |
||||
|
'partner_id': self.user_id.partner_id.id, |
||||
|
'invoice_user_id': self.env.user.id, |
||||
|
'invoice_origin': self.name, |
||||
|
'invoice_line_ids': [(fields.Command.create({ |
||||
|
'name': 'Invoice For Salary Payment', |
||||
|
'quantity': 1, |
||||
|
'price_unit': amount, |
||||
|
'account_id': 41, |
||||
|
}))], |
||||
|
}) |
||||
|
self.sudo().write({ |
||||
|
'invoice_id': invoice_date.id, |
||||
|
'last_salary_date': fields.Date.context_today(self), |
||||
|
}) |
||||
|
|
||||
|
@api.constrains('phone') |
||||
|
def check_phone(self): |
||||
|
""" Make sure phone contains only 10 digits """ |
||||
|
for rec in self: |
||||
|
if not re.match('^[0-9]{10}$', rec.phone): |
||||
|
raise ValidationError( |
||||
|
_('Phone number should contain exactly 10 digits and only ' |
||||
|
'numbers are allowed')) |
@ -0,0 +1,170 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models, _, Command |
||||
|
from odoo.exceptions import UserError, ValidationError |
||||
|
|
||||
|
|
||||
|
class InsuranceDetails(models.Model): |
||||
|
"""This class creates a model 'insurance.details' and added fields """ |
||||
|
_name = 'insurance.details' |
||||
|
_description = "Insurance Details" |
||||
|
|
||||
|
name = fields.Char( |
||||
|
string='Name', required=True, copy=False, readonly=True, index=True, |
||||
|
default=lambda self: _('New'), help="Sequence of insurance created") |
||||
|
partner_id = fields.Many2one('res.partner', string='Customer', |
||||
|
required=True, |
||||
|
help="Partner related to insurance") |
||||
|
start_date = fields.Date( |
||||
|
string='Date Started', default=fields.Date.context_today, required=True, |
||||
|
help="Start date of insurance") |
||||
|
close_date = fields.Date(string='Date Closed', readonly=True, |
||||
|
help="End date of insurance") |
||||
|
invoice_ids = fields.One2many('account.move', 'insurance_id', |
||||
|
string='Invoices', readonly=True, |
||||
|
help="Invoices related to insurance ") |
||||
|
employee_id = fields.Many2one( |
||||
|
'employee.details', string='Agent', required=True, |
||||
|
help="Agent related to the insurance") |
||||
|
commission_rate = fields.Float(string='Commission Percentage', |
||||
|
help="Give the commission rate of" |
||||
|
" insurance to the agent",) |
||||
|
policy_id = fields.Many2one( |
||||
|
'policy.details', string='Policy', required=True, |
||||
|
help="Select the policy details and the policy preferred") |
||||
|
payment_type = fields.Selection( |
||||
|
[('fixed', 'Fixed'), ('installment', 'Installment')], |
||||
|
required=True, default='fixed', help="Select the policy type") |
||||
|
policy_duration = fields.Integer(string='Duration in months', required=True, |
||||
|
help="Specify the policy duration to" |
||||
|
" which this policy exists") |
||||
|
currency_id = fields.Many2one( |
||||
|
'res.currency', string='Currency', required=True, |
||||
|
default=lambda self: self.env.user.company_id.currency_id.id, |
||||
|
help="Give the currency") |
||||
|
amount = fields.Monetary(related='policy_id.amount', string='Amount', |
||||
|
help="The amount for the policy based " |
||||
|
"on policy selected") |
||||
|
amount_installment = fields.Monetary(string="Installment Amount", |
||||
|
compute="_compute_amount", |
||||
|
required=True, |
||||
|
help="Give the installment" |
||||
|
" amount for the policy") |
||||
|
amount_remaining = fields.Monetary(string='Amount remaining', |
||||
|
compute='_compute_amount_remaining') |
||||
|
state = fields.Selection( |
||||
|
[('draft', 'Draft'), ('confirmed', 'Confirmed'), ('closed', 'Closed')], |
||||
|
required=True, default='draft', |
||||
|
help="State of insurance") |
||||
|
hide_inv_button = fields.Boolean(copy=False) |
||||
|
note_field = fields.Html(string='Comment', help="Give the notes") |
||||
|
policy_number = fields.Integer(string="Policy Number", required=True, |
||||
|
help="Policy number is a unique number that" |
||||
|
"an insurance company uses to identify" |
||||
|
"you as a policyholder") |
||||
|
|
||||
|
@api.depends('amount', 'policy_duration') |
||||
|
def _compute_amount(self): |
||||
|
for record in self: |
||||
|
if record.policy_duration != 0: |
||||
|
record.amount_installment = ( |
||||
|
record.amount / record.policy_duration) |
||||
|
else: |
||||
|
record.amount_installment = 0.0 |
||||
|
|
||||
|
@api.depends('amount', 'amount_installment', 'invoice_ids.amount_total') |
||||
|
def _compute_amount_remaining(self): |
||||
|
for record in self: |
||||
|
total_invoice_amount = sum( |
||||
|
record.invoice_ids.mapped('amount_total')) |
||||
|
total_amount = record.amount |
||||
|
record.amount_remaining = total_amount - total_invoice_amount |
||||
|
|
||||
|
@api.constrains('commission_rate') |
||||
|
def _check_commission_rate(self): |
||||
|
"""This function defines a constraint that ensures the ' |
||||
|
commission_rate' attribute of objects meets certain criteria. |
||||
|
If any object violates the constraint by having a 'commission_rate' |
||||
|
that falls outside the range of 1 to 100, a validation error |
||||
|
is raised, """ |
||||
|
if self.filtered( |
||||
|
lambda reward: ( |
||||
|
reward.commission_rate < 0 or reward.commission_rate > |
||||
|
100)): |
||||
|
raise ValidationError( |
||||
|
_('Commission Percentage should be between 1-100')) |
||||
|
|
||||
|
@api.constrains('policy_number') |
||||
|
def _check_policy_number(self): |
||||
|
"""This function checks if policy number is not added,validation error |
||||
|
occurs""" |
||||
|
if not self.policy_number: |
||||
|
raise ValidationError( |
||||
|
_('Please add the policy number')) |
||||
|
|
||||
|
def action_confirm_insurance(self): |
||||
|
"""This function creates a validation error if amount not |
||||
|
greater than zero""" |
||||
|
if self.amount > 0: |
||||
|
self.state = 'confirmed' |
||||
|
self.hide_inv_button = True |
||||
|
else: |
||||
|
raise UserError(_("Amount should be greater than zero")) |
||||
|
|
||||
|
def action_create_invoice(self): |
||||
|
"""Function to create invoice with corresponding details""" |
||||
|
if self.payment_type == 'fixed': |
||||
|
self.hide_inv_button = False |
||||
|
|
||||
|
created_invoice = self.env['account.move'].sudo().create({ |
||||
|
'move_type': 'out_invoice', |
||||
|
'invoice_date': fields.Date.context_today(self), |
||||
|
'partner_id': self.partner_id.id, |
||||
|
'invoice_user_id': self.env.user.id, |
||||
|
'invoice_origin': self.name, |
||||
|
'invoice_line_ids': [(fields.Command.create({ |
||||
|
'name': 'Invoice For Insurance', |
||||
|
'quantity': 1, |
||||
|
'price_unit': self.amount if self.payment_type == 'fixed' else |
||||
|
self.amount_installment, |
||||
|
'account_id': 41, |
||||
|
}))], |
||||
|
}) |
||||
|
self.write({'invoice_ids': [Command.link(created_invoice.id)]}) |
||||
|
|
||||
|
def action_close_insurance(self): |
||||
|
"""Function on button to close the paid invoices or else raise |
||||
|
user error""" |
||||
|
for records in self.invoice_ids: |
||||
|
if records.state == 'paid': |
||||
|
raise UserError(_("All invoices must be paid")) |
||||
|
self.state = 'closed' |
||||
|
self.close_date = fields.Date.context_today(self) |
||||
|
self.hide_inv_button = False |
||||
|
|
||||
|
@api.model |
||||
|
def create(self, vals): |
||||
|
"""Function to create sequence""" |
||||
|
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) |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PaymentType(models.Model): |
||||
|
_name = 'payment.type' |
||||
|
_description = 'Payment Type' |
||||
|
|
||||
|
name = fields.Char(string="Payment Type", |
||||
|
help="Select the policy type") |
@ -0,0 +1,43 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PolicyDetails(models.Model): |
||||
|
"""This class creates a model 'policy.details' and added fields """ |
||||
|
_name = 'policy.details' |
||||
|
_description = "Policy Details" |
||||
|
|
||||
|
name = fields.Char(string='Name', required=True, |
||||
|
help="Give the policy name") |
||||
|
policy_type_id = fields.Many2one( |
||||
|
'policy.type', string='Policy Type', required=True, |
||||
|
help="Select the policy type") |
||||
|
payment_type_ids = fields.Many2many('payment.type', |
||||
|
help="Select the policy types") |
||||
|
currency_id = fields.Many2one( |
||||
|
'res.currency', string='Currency', required=True, |
||||
|
default=lambda self: self.env.user.company_id.currency_id.id, |
||||
|
help="Select the currency") |
||||
|
amount = fields.Monetary(string='Amount', required=True, |
||||
|
help="Give the amount for the policy") |
||||
|
note_field = fields.Html(string='Comment', help="Specify the comments") |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Jumana Haseen @cybrosys(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PolicyType(models.Model): |
||||
|
"""This class creates a model 'policy.type' and added fields """ |
||||
|
_name = 'policy.type' |
||||
|
_description = "Policy Type" |
||||
|
|
||||
|
name = fields.Char(string='Name', help="Give the policy type") |
|
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 773 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 571 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,75 @@ |
|||||
|
/** @odoo-module **/ |
||||
|
|
||||
|
import { registry } from "@web/core/registry"; |
||||
|
import { createElement, append } from "@web/core/utils/xml"; |
||||
|
import { Notebook } from "@web/core/notebook/notebook"; |
||||
|
import { formView } from "@web/views/form/form_view"; |
||||
|
import { FormCompiler } from "@web/views/form/form_compiler"; |
||||
|
import { FormRenderer } from "@web/views/form/form_renderer"; |
||||
|
import { FormController } from '@web/views/form/form_controller'; |
||||
|
import { useService } from "@web/core/utils/hooks"; |
||||
|
|
||||
|
export class AccountMoveController extends FormController { |
||||
|
setup() { |
||||
|
super.setup(); |
||||
|
this.account_move_service = useService("account_move"); |
||||
|
} |
||||
|
|
||||
|
async deleteRecord() { |
||||
|
if ( !await this.account_move_service.addDeletionDialog(this, this.model.root.resId)) { |
||||
|
return super.deleteRecord(...arguments); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
export class AccountMoveFormNotebook extends Notebook { |
||||
|
async changeTabTo(page_id) { |
||||
|
if (this.props.onBeforeTabSwitch) { |
||||
|
await this.props.onBeforeTabSwitch(page_id); |
||||
|
} |
||||
|
this.state.currentPage = page_id; |
||||
|
} |
||||
|
} |
||||
|
AccountMoveFormNotebook.template = "account.AccountMoveFormNotebook"; |
||||
|
AccountMoveFormNotebook.props = { |
||||
|
...Notebook.props, |
||||
|
onBeforeTabSwitch: { type: Function, optional: true }, |
||||
|
} |
||||
|
export class AccountMoveFormRenderer extends FormRenderer { |
||||
|
async saveBeforeTabChange() { |
||||
|
if (this.props.record.isInEdition && await this.props.record.isDirty()) { |
||||
|
const contentEl = document.querySelector('.o_content'); |
||||
|
const scrollPos = contentEl.scrollTop; |
||||
|
await this.props.record.save(); |
||||
|
if (scrollPos) { |
||||
|
contentEl.scrollTop = scrollPos; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
AccountMoveFormRenderer.components = { |
||||
|
...FormRenderer.components, |
||||
|
AccountMoveFormNotebook: AccountMoveFormNotebook, |
||||
|
} |
||||
|
export class AccountMoveFormCompiler extends FormCompiler { |
||||
|
compileNotebook(el, params) { |
||||
|
const originalNoteBook = super.compileNotebook(...arguments); |
||||
|
const noteBook = createElement("AccountMoveFormNotebook"); |
||||
|
for (const attr of originalNoteBook.attributes) { |
||||
|
noteBook.setAttribute(attr.name, attr.value); |
||||
|
} |
||||
|
noteBook.setAttribute("onBeforeTabSwitch", "() => __comp__.saveBeforeTabChange()"); |
||||
|
const slots = originalNoteBook.childNodes; |
||||
|
append(noteBook, [...slots]); |
||||
|
return noteBook; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export const AccountMoveFormView = { |
||||
|
...formView, |
||||
|
Renderer: AccountMoveFormRenderer, |
||||
|
Compiler: AccountMoveFormCompiler, |
||||
|
Controller: AccountMoveController, |
||||
|
}; |
||||
|
|
||||
|
registry.category("views").add("account_move_form", AccountMoveFormView); |
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
|
||||
|
<templates xml:space="preserve"> |
||||
|
<t t-name="account.AccountMoveFormNotebook" t-inherit="web.Notebook" t-inherit-mode="primary"> |
||||
|
<xpath expr="//a[@class='nav-link']" position="attributes"> |
||||
|
<attribute name="t-on-click.prevent">() => this.changeTabTo(navItem[0])</attribute> |
||||
|
</xpath> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,86 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Form view for claim details--> |
||||
|
<record id="claim_details_view_form" model="ir.ui.view"> |
||||
|
<field name="name">claim.details.view.form</field> |
||||
|
<field name="model">claim.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Claim Details Form"> |
||||
|
<header> |
||||
|
<button name="action_create_bill" string="Create Bill" type="object" class="oe_highlight" |
||||
|
invisible="invoice_id != False"/> |
||||
|
</header> |
||||
|
<sheet> |
||||
|
<div class="oe_title"> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="insurance_id" options="{'no_create': True}"/> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="policy_id"/> |
||||
|
<field name="employee_id"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="date_claimed"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="amount"/> |
||||
|
<field name="invoice_id"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<notebook> |
||||
|
<page string="Extra Notes"> |
||||
|
<field name="note_field"/> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Tree view for claim details--> |
||||
|
<record id="claim_details_view_tree" model="ir.ui.view"> |
||||
|
<field name="name">claim.details.view.tree</field> |
||||
|
<field name="model">claim.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Claim Details Tree"> |
||||
|
<field name="name"/> |
||||
|
<field name="insurance_id"/> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="policy_id"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="amount"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Search view for claim details--> |
||||
|
<record id="claim_details_view_search" model="ir.ui.view"> |
||||
|
<field name="name">claim.details.view.search</field> |
||||
|
<field name="model">claim.details</field> |
||||
|
<field eval="16" name="priority"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<search string="Search claims"> |
||||
|
<field name="name" string="Journal Item" filter_domain="[ |
||||
|
'|', '|', '|', |
||||
|
('name', 'ilike', self), ('insurance_id', 'ilike', self), ('partner_id', 'ilike', self), ('policy_id', 'ilike', self)]"/> |
||||
|
<field name="name"/> |
||||
|
<field name="name"/> |
||||
|
<field name="insurance_id"/> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="policy_id"/> |
||||
|
</search> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action for claim details--> |
||||
|
<record id="claim_details_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Claim Management</field> |
||||
|
<field name="res_model">claim.details</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="oe_view_nocontent_create"> |
||||
|
You haven't created any claims yet. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,88 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Form view for employee details--> |
||||
|
<record id="employee_details_view_form" model="ir.ui.view"> |
||||
|
<field name="name">employee.details.view.form</field> |
||||
|
<field name="model">employee.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Employee Details Form"> |
||||
|
<header> |
||||
|
<button name="action_salary_payment" string="Salary Payment" |
||||
|
type="object" |
||||
|
invisible="user_id==False" class="oe_highlight"/> |
||||
|
</header> |
||||
|
<sheet> |
||||
|
<div class="oe_title"> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="phone"/> |
||||
|
<field name="salary_type"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="base_salary" invisible="salary_type=='commission'"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="sex"/> |
||||
|
<field name="last_salary_date"/> |
||||
|
<field name="user_id"/> |
||||
|
<field name="invoice_id"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<notebook> |
||||
|
<page string="Insurance details"> |
||||
|
<field name="insurance_ids"/> |
||||
|
</page> |
||||
|
<page string="Extra Notes"> |
||||
|
<field name="note_field"/> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Tree view for employee details--> |
||||
|
<record id="employee_details_view_tree" model="ir.ui.view"> |
||||
|
<field name="name">employee.details.view.tree</field> |
||||
|
<field name="model">employee.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Employee Details Tree"> |
||||
|
<field name="name"/> |
||||
|
<field name="phone"/> |
||||
|
<field name="salary_type"/> |
||||
|
<field name="sex"/> |
||||
|
<field name="last_salary_date"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action for employee details--> |
||||
|
<record id="employee_details_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Employee Management</field> |
||||
|
<field name="res_model">employee.details</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="oe_view_nocontent_create"> |
||||
|
You haven't created any employee yet. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Search view for employee details--> |
||||
|
<record id="employee_details_view_search" model="ir.ui.view"> |
||||
|
<field name="name">employee.details.view.search</field> |
||||
|
<field name="model">employee.details</field> |
||||
|
<field eval="16" name="priority"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<search string="Search claims"> |
||||
|
<field name="name" string="Journal Item" filter_domain="[ |
||||
|
'|', '|', '|', |
||||
|
('name', 'ilike', self), ('salary_type', 'ilike', self), ('user_id', 'ilike', self), ('sex', 'ilike', self)]"/> |
||||
|
<field name="name"/> |
||||
|
<field name="salary_type"/> |
||||
|
<field name="sex"/> |
||||
|
<field name="user_id"/> |
||||
|
</search> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,107 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Form view for insurance details--> |
||||
|
<record id="insurance_details_view_form" model="ir.ui.view"> |
||||
|
<field name="name">insurance.details.view.form</field> |
||||
|
<field name="model">insurance.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Insurance Details Form"> |
||||
|
<header> |
||||
|
<button name="action_confirm_insurance" string="Confirm" |
||||
|
type="object" |
||||
|
invisible="state !='draft'" class="oe_highlight"/> |
||||
|
<button name="action_create_invoice" string="Create Invoice" |
||||
|
type="object" class="oe_highlight" |
||||
|
invisible="hide_inv_button != True"/> |
||||
|
<button name="action_close_insurance" string="Close" |
||||
|
type="object" |
||||
|
invisible="state !='confirmed'" |
||||
|
class="oe_highlight"/> |
||||
|
<field name="state" widget="statusbar"/> |
||||
|
</header> |
||||
|
<sheet> |
||||
|
<div class="oe_title"> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="policy_id"/> |
||||
|
<field name="payment_type"/> |
||||
|
<field name="amount_installment" |
||||
|
invisible="payment_type == 'fixed'"/> |
||||
|
<field name="amount_remaining" |
||||
|
invisible="payment_type == 'fixed'"/> |
||||
|
<field name="policy_duration"/> |
||||
|
<field name="policy_number"/> |
||||
|
<field name="employee_id"/> |
||||
|
<field name="commission_rate"/> |
||||
|
<field name="hide_inv_button" invisible="1"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="start_date"/> |
||||
|
<field name="close_date"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="amount"/> |
||||
|
|
||||
|
</group> |
||||
|
</group> |
||||
|
<notebook> |
||||
|
<page string="Invoices"> |
||||
|
<field name="invoice_ids"/> |
||||
|
</page> |
||||
|
<page string="Extra Notes"> |
||||
|
<field name="note_field"/> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Tree view for Insurance details--> |
||||
|
<record id="insurance_details_view_tree" model="ir.ui.view"> |
||||
|
<field name="name">insurance.details.view.tree</field> |
||||
|
<field name="model">insurance.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Insurance Details Tree"> |
||||
|
<field name="name"/> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="policy_id"/> |
||||
|
<field name="employee_id"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="amount"/> |
||||
|
<field name="state"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action for insurance details--> |
||||
|
<record id="insurance_details_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Insurance Management</field> |
||||
|
<field name="res_model">insurance.details</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="oe_view_nocontent_create"> |
||||
|
You haven't created any insurance yet. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Search view for insurance details--> |
||||
|
<record id="insurance_details_view_search" model="ir.ui.view"> |
||||
|
<field name="name">insurance.details.view.search</field> |
||||
|
<field name="model">insurance.details</field> |
||||
|
<field eval="16" name="priority"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<search string="Search claims"> |
||||
|
<field name="name" string="Journal Item" filter_domain="[ |
||||
|
'|', '|', '|', |
||||
|
('name', 'ilike', self), ('partner_id', 'ilike', self), ('policy_id', 'ilike', self), ('state', 'ilike', self)]"/> |
||||
|
<field name="name"/> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="policy_id"/> |
||||
|
<field name="state"/> |
||||
|
</search> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,37 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Menu item for Parent insurance menu--> |
||||
|
<menuitem id="insurance_management_menu_root" name="Insurance" sequence="5" |
||||
|
web_icon="insurance_management_cybro,static/description/icon.png"/> |
||||
|
<!-- Menu item for Insurance Management--> |
||||
|
<menuitem id="insurance_management_menu_insurance_management" |
||||
|
name="Insurance Management" |
||||
|
parent="insurance_management_menu_root" sequence="10"/> |
||||
|
<!-- Menu item for Insurance --> |
||||
|
<menuitem id="insurance_details_menu_action" name="Insurance" |
||||
|
parent="insurance_management_menu_insurance_management" |
||||
|
action="insurance_details_action" sequence="10"/> |
||||
|
<!-- Parent Menu item for Claims --> |
||||
|
<menuitem id="claim_details_menu_action" name="Claims" |
||||
|
parent="insurance_management_menu_insurance_management" |
||||
|
action="claim_details_action" sequence="20"/> |
||||
|
<!-- Parent Menu item for Agent --> |
||||
|
<menuitem id="insurance_management_menu_agent" name="Agent" |
||||
|
parent="insurance_management_menu_root" sequence="20"/> |
||||
|
<!-- Menu item for Agent --> |
||||
|
<menuitem id="employee_details_menu_action" name="Agent" |
||||
|
parent="insurance_management_menu_agent" |
||||
|
action="employee_details_action" sequence="10"/> |
||||
|
<!-- Parent Menu item for Configuration --> |
||||
|
<menuitem id="insurance_management_menu_configuration" name="Configuration" |
||||
|
parent="insurance_management_menu_root" |
||||
|
sequence="30"/> |
||||
|
<!-- Parent Menu item for Policy --> |
||||
|
<menuitem id="policy_details_menu_action" name="Policy" |
||||
|
parent="insurance_management_menu_configuration" |
||||
|
action="policy_details_action" sequence="10"/> |
||||
|
<!-- Parent Menu item for Customers --> |
||||
|
<menuitem id="res_partner_customer_menu_action" name="Customers" |
||||
|
parent="insurance_management_menu_configuration" |
||||
|
action="base.action_partner_customer_form" sequence="20"/> |
||||
|
</odoo> |
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<record id="view_payment_type_form" model="ir.ui.view"> |
||||
|
<field name="name">payment.type.form</field> |
||||
|
<field name="model">payment.type</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<group> |
||||
|
<field name="name" options="{'no_create': True}" |
||||
|
readonly="'id', '!=', False"/> |
||||
|
</group> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="view_payment_type_tree" model="ir.ui.view"> |
||||
|
<field name="name">payment.type.tree</field> |
||||
|
<field name="model">payment.type</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree> |
||||
|
<field name="name"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="action_payment_type" model="ir.actions.act_window"> |
||||
|
<field name="name">Payment Type</field> |
||||
|
<field name="type">ir.actions.act_window</field> |
||||
|
<field name="res_model">payment.type</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
<!-- <!– Define the action (view) for the menu--> |
||||
|
<!-- Attach the action to the menu --> |
||||
|
<menuitem id="payment_type_menu_action" name="Payment Type" |
||||
|
parent="insurance_management_menu_configuration" |
||||
|
action="action_payment_type"/> |
||||
|
</odoo> |
@ -0,0 +1,60 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Form view for policy details--> |
||||
|
<record id="policy_details_view_form" model="ir.ui.view"> |
||||
|
<field name="name">policy.details.view.form</field> |
||||
|
<field name="model">policy.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Policy Details Form"> |
||||
|
<sheet> |
||||
|
<div class="oe_title"> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="policy_type_id"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="payment_type_ids" |
||||
|
widget="many2many_tags" |
||||
|
options="{'no_create': True}"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="amount"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<notebook> |
||||
|
<page string="Extra Notes"> |
||||
|
<field name="note_field"/> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Tree view for policy details--> |
||||
|
<record id="policy_details_view_tree" model="ir.ui.view"> |
||||
|
<field name="name">policy.details.view.tree</field> |
||||
|
<field name="model">policy.details</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Policy Details Tree"> |
||||
|
<field name="name"/> |
||||
|
<field name="policy_type_id"/> |
||||
|
<field name="currency_id" invisible="1"/> |
||||
|
<field name="amount"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action for policy details--> |
||||
|
<record id="policy_details_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Policy Management</field> |
||||
|
<field name="res_model">policy.details</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="oe_view_nocontent_create"> |
||||
|
You haven't created any policy yet. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,42 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Form view for policy types--> |
||||
|
<record id="policy_type_view_form" model="ir.ui.view"> |
||||
|
<field name="name">policy.type.view.form</field> |
||||
|
<field name="model">policy.type</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Policy Type"> |
||||
|
<sheet> |
||||
|
<group colspan="1" col="4" name="main"> |
||||
|
<field name="name"/> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Tree view for policy types--> |
||||
|
<record id="policy_type_view_tree" model="ir.ui.view"> |
||||
|
<field name="name">policy.type.view.tree</field> |
||||
|
<field name="model">policy.type</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Policy Type Tree"> |
||||
|
<field name="name"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action for policy types--> |
||||
|
<record id="policy_type_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Policy Types</field> |
||||
|
<field name="res_model">policy.type</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="oe_view_nocontent_create"> |
||||
|
You haven't created any policy yet. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Parent Menu item for Policy type--> |
||||
|
<menuitem id="policy_type_menu_action" name="Policy Type" |
||||
|
parent="insurance_management_menu_configuration" |
||||
|
action="policy_type_action" sequence="50"/> |
||||
|
</odoo> |