Browse Source

[ADD] Initial Commit

pull/72/head
Sreejith P 7 years ago
parent
commit
29447038c8
  1. 39
      hr_insurance/README.rst
  2. 6
      hr_insurance/RELEASE_NOTES.md
  3. 24
      hr_insurance/__init__.py
  4. 49
      hr_insurance/__manifest__.py
  5. 25
      hr_insurance/models/__init__.py
  6. BIN
      hr_insurance/models/__init__.pyc
  7. 120
      hr_insurance/models/employee_insurance.py
  8. BIN
      hr_insurance/models/employee_insurance.pyc
  9. 33
      hr_insurance/models/policy_details.py
  10. BIN
      hr_insurance/models/policy_details.pyc
  11. 16
      hr_insurance/security/hr_insurance_security.xml
  12. 8
      hr_insurance/security/ir.model.access.csv
  13. BIN
      hr_insurance/static/description/HRMS-BUTTON.png
  14. BIN
      hr_insurance/static/description/banner.jpg
  15. BIN
      hr_insurance/static/description/cybro-service.png
  16. BIN
      hr_insurance/static/description/cybro_logo.png
  17. BIN
      hr_insurance/static/description/employee.png
  18. BIN
      hr_insurance/static/description/icon.png
  19. 120
      hr_insurance/static/description/index.html
  20. BIN
      hr_insurance/static/description/insurance.png
  21. BIN
      hr_insurance/static/description/payslip.png
  22. BIN
      hr_insurance/static/description/policy.png
  23. 105
      hr_insurance/views/employee_insurance_view.xml
  24. 41
      hr_insurance/views/insurance_salary_stucture.xml
  25. 59
      hr_insurance/views/policy_management.xml

39
hr_insurance/README.rst

@ -0,0 +1,39 @@
OHRMS Employee Insurance Management v10
=======================================
Employee insurance management for Open HRMS.
Depends
=======
[hr] addon Odoo
Tech
====
* [Python] - Models
* [XML] - Odoo views
Installation
============
- www.odoo.com/documentation/10.0/setup/install.html
- Install our custom addon
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 <https://www.cybrosys.com>
Author
------
Developer: Treesa Maria Jude @ cybrosys, treesa@cybrosys.in
Maintainer
----------
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.

6
hr_insurance/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module hr_insurance
#### 21.04.2018
#### Version 11.0.1.0.0
##### ADD
- Initial commit for OpenHrms Project

24
hr_insurance/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models

49
hr_insurance/__manifest__.py

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of Open HRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'Open HRMS Employee Insurance',
'version': '11.0.1.0.0',
'summary': """Employee Insurance Management for Open HRMS.""",
'description': """Manages insurance amounts for employees to be deducted from salary""",
'category': 'Human Resources',
'author': 'Cybrosys Techno solutions',
'maintainer': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'https://www.openhrms.com',
'depends': [
'base', 'hr', 'hr_payroll',
],
'data': [
'security/ir.model.access.csv',
'security/hr_insurance_security.xml',
'views/employee_insurance_view.xml',
'views/insurance_salary_stucture.xml',
'views/policy_management.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

25
hr_insurance/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import policy_details
from . import employee_insurance

BIN
hr_insurance/models/__init__.pyc

Binary file not shown.

120
hr_insurance/models/employee_insurance.py

@ -0,0 +1,120 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
import time
from datetime import datetime
from dateutil import relativedelta
from odoo import models, fields, api, _
class EmployeeInsurance(models.Model):
_name = 'hr.insurance'
_description = 'HR Insurance'
_rec_name = 'employee_id'
employee_id = fields.Many2one('hr.employee', string='Employee', required=True)
policy_id = fields.Many2one('insurance.policy', string='Policy', required=True)
amount = fields.Float(string='Policy Amount', required=True)
sum_insured = fields.Float(string="Sum Insured", required=True)
policy_coverage = fields.Selection([('monthly', 'Monthly'), ('yearly', 'Yearly')],
required=True, default='monthly',
string='Policy Coverage',)
date_from = fields.Date(string='Date From',
default=time.strftime('%Y-%m-%d'), readonly=True)
date_to = fields.Date(string='Date To', readonly=True,
default=str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10])
state = fields.Selection([('active', 'Active'),
('expired', 'Expired'), ],
default='active', string="State",compute='get_status')
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id)
def get_status(self):
current_datetime = datetime.now()
for i in self:
x = datetime.strptime(i.date_from, '%Y-%m-%d')
y = datetime.strptime(i.date_to, '%Y-%m-%d')
if x <= current_datetime and y >= current_datetime:
i.state = 'active'
else:
i.state = 'expired'
@api.constrains('policy_coverage')
@api.onchange('policy_coverage')
def get_policy_period(self):
if self.policy_coverage == 'monthly':
self.date_to = str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10]
if self.policy_coverage == 'yearly':
self.date_to = str(datetime.now() + relativedelta.relativedelta(months=+12))[:10]
class HrInsurance(models.Model):
_inherit = 'hr.employee'
insurance_percentage = fields.Float(string="Company Percentage ")
deduced_amount_per_month = fields.Float(string="Salary deduced per month", compute="get_deduced_amount")
deduced_amount_per_year = fields.Float(string="Salary deduced per year", compute="get_deduced_amount")
insurance = fields.One2many('hr.insurance', 'employee_id', string="Insurance",
domain=[('state', '=', 'active')])
def get_deduced_amount(self):
current_datetime = datetime.now()
for emp in self:
ins_amount = 0
for ins in emp.insurance:
x = datetime.strptime(ins.date_from, '%Y-%m-%d')
y = datetime.strptime(ins.date_to, '%Y-%m-%d')
if x < current_datetime and y > current_datetime:
if ins.policy_coverage == 'monthly':
ins_amount = ins_amount + (ins.amount*12)
else:
ins_amount = ins_amount + ins.amount
emp.deduced_amount_per_year = ins_amount-((ins_amount*emp.insurance_percentage)/100)
emp.deduced_amount_per_month = emp.deduced_amount_per_year/12
class InsuranceRuleInput(models.Model):
_inherit = 'hr.payslip'
# insurance_amount = fields.Float("Insurance amount", compute='get_inputs')
def get_inputs(self, contract_ids, date_from, date_to):
"""This Compute the other inputs to employee payslip.
"""
res = super(InsuranceRuleInput, self).get_inputs(contract_ids, date_from, date_to)
contract_obj = self.env['hr.contract']
for i in contract_ids:
if contract_ids[0]:
emp_id = contract_obj.browse(i[0].id).employee_id
for result in res:
if emp_id.deduced_amount_per_month != 0 and result.get('code') == 'INSUR':
result['amount'] = emp_id.deduced_amount_per_month
return res

BIN
hr_insurance/models/employee_insurance.pyc

Binary file not shown.

33
hr_insurance/models/policy_details.py

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import models, fields, api
class InsurancePolicy(models.Model):
_name = 'insurance.policy'
name = fields.Char(string='Name', required=True)
note_field = fields.Html(string='Comment')
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id)

BIN
hr_insurance/models/policy_details.pyc

Binary file not shown.

16
hr_insurance/security/hr_insurance_security.xml

@ -0,0 +1,16 @@
<?xml version="1.0" ?>
<odoo>
<record id="property_rule_hr_shift" model="ir.rule">
<field name="name">Hr Insurancy Company</field>
<field name="model_id" ref="model_hr_insurance"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="property_rule_hr_shift_generate" model="ir.rule">
<field name="name">Hr Insurance Policy company</field>
<field name="model_id" ref="model_insurance_policy"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</odoo>

8
hr_insurance/security/ir.model.access.csv

@ -0,0 +1,8 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_insurance_policy_officer,hr.insurance_policy.officer,hr_insurance.model_insurance_policy,hr.group_hr_user,1,1,1,1
access_hr_insurance_policy_employee,hr.insurance_policy.employee,hr_insurance.model_insurance_policy,hr.group_hr_manager,1,1,1,1
access_hr_insurance_policy_manager,hr.insurance_policy.manager,hr_insurance.model_insurance_policy,base.group_user,1,0,0,0
access_hr_insurance_officer,hr.insurance.officer,hr_insurance.model_hr_insurance,hr.group_hr_user,1,1,1,1
access_hr_insurance_employee,hr.insurance.employee,hr_insurance.model_hr_insurance,hr.group_hr_manager,1,1,1,1
access_hr_insurance_manager,hr.insurance.manager,hr_insurance.model_hr_insurance,base.group_user,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_insurance_policy_officer hr.insurance_policy.officer hr_insurance.model_insurance_policy hr.group_hr_user 1 1 1 1
3 access_hr_insurance_policy_employee hr.insurance_policy.employee hr_insurance.model_insurance_policy hr.group_hr_manager 1 1 1 1
4 access_hr_insurance_policy_manager hr.insurance_policy.manager hr_insurance.model_insurance_policy base.group_user 1 0 0 0
5 access_hr_insurance_officer hr.insurance.officer hr_insurance.model_hr_insurance hr.group_hr_user 1 1 1 1
6 access_hr_insurance_employee hr.insurance.employee hr_insurance.model_hr_insurance hr.group_hr_manager 1 1 1 1
7 access_hr_insurance_manager hr.insurance.manager hr_insurance.model_hr_insurance base.group_user 1 0 0 0

BIN
hr_insurance/static/description/HRMS-BUTTON.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
hr_insurance/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
hr_insurance/static/description/cybro-service.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

BIN
hr_insurance/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
hr_insurance/static/description/employee.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
hr_insurance/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

120
hr_insurance/static/description/index.html

@ -0,0 +1,120 @@
<section class="oe_container bg-gray-lighter" xmlns="http://www.w3.org/1999/html">
<div class="oe_row">
<div class="oe_span">
<h2 class="oe_slogan">OpenHRMS</h2>
<h3 class="oe_slogan">Most advanced open source HR management software</h3>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced oe_mt32">
<div class="oe_span">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.openhrms.com/#request-demo">
<img src="HRMS-BUTTON.png">
</a>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">OHRMS Employee Insurance Management</h2>
<h3 class="oe_slogan">Employee Insurance Management for OHRMS</h3>
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4>
<p class='oe_mt32'>
This module allows tracking the insurance details allowed for employees. Also
efficiently manages the insurance allowances with the salary. You can manage
the percentage of insurance amount to be deduced from the salary.
</p>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_padded">
<h2 class="oe_slogan">Set Insurance For Employees</h2>
<div class="oe_span12">
</div>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="insurance.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<h2 class="oe_slogan">Policy Management</h2>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="policy.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_padded">
<div class="oe_span12">
<h2 class="oe_slogan">Employee Insurance Details</h2>
</div>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="employee.png">
</div>
</div></div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<div class="oe_span12">
<h2 class="oe_slogan">Amount Deduced On Payslip</h2>
</div>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="payslip.png">
</div>
</div></div>
</section>
<div class="row section-content">
<div class="col-md-6 img-content">
<h3>Our Odoo Services</h3>
</div> <div class="bc-span col-md-12"><div class="inner-span"><a target="_blank" href="https://www.openhrms.com"><img class="img-border img-responsive thumbnail" src="cybro-service.png"></a></div></div>
</div>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</div>
</section>

BIN
hr_insurance/static/description/insurance.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
hr_insurance/static/description/payslip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
hr_insurance/static/description/policy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

105
hr_insurance/views/employee_insurance_view.xml

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="hr_employee_insurance_form" model="ir.ui.view">
<field name="name">hr.employee.Insurance_form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='hr_settings']" position="after">
<page name="insurance" string="Insurance">
<group>
<group>
<field name="insurance_percentage">%</field>
</group>
<group>
<field name="deduced_amount_per_year"/>
<field name="deduced_amount_per_month"/>
</group>
</group>
<field name="insurance" context="{'default_employee_id':id}"/>
</page>
</xpath>
</field>
</record>
<record id="employee_insurance__details_form" model="ir.ui.view">
<field name="name">Employee Insurance</field>
<field name="model">hr.insurance</field>
<field name="arch" type="xml">
<form string="Employee Insurance">
<header>
<field name="state" widget="statusbar" statusbar_visible="active,expired"/>
</header>
<sheet>
<!--<header>-->
<!--<field name="state" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}'/>-->
<!--</header>-->
<group>
<group>
<field name="employee_id"/>
<field name="policy_coverage"/>
<label for="date_from" string="Policy Period"/>
<div>
<field name="date_from" class="oe_inline" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
-
<field name="date_to" class="oe_inline" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
</div>
</group>
<group>
<field name="policy_id"/>
<field name="sum_insured"/>
<field name="amount"/>
<field name="company_id"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="employee_insurance_details_tree" model="ir.ui.view">
<field name="name">Employee Insurance</field>
<field name="model">hr.insurance</field>
<field name="arch" type="xml">
<tree string="Employee Insurance">
<field name="employee_id"/>
<field name="policy_id"/>
<field name="policy_coverage"/>
<field name="sum_insured"/>
<field name="amount"/>
<field name="date_from" />
<field name="date_to"/>
<field name="company_id"/>
</tree>
</field>
</record>
<record id="action_employee_insurance_details" model="ir.actions.act_window">
<field name="name">Employee Insurance</field>
<field name="res_model">hr.insurance</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
You have'nt created any policy yet.
</p>
</field>
</record>
<menuitem
id="hr_insurance_main_menu"
parent ="hr.menu_hr_root"
name="HR Insurance"/>
<menuitem
id="hr_employee_insurance_menu"
name="Employee Insurance"
parent="hr_insurance_main_menu"
action="action_employee_insurance_details"/>
</data>
</odoo>

41
hr_insurance/views/insurance_salary_stucture.xml

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<!--<record id="hr_payslip_rule_insurance" model="hr.salary.rule">-->
<!--<field name="code">INSUR</field>-->
<!--<field name="name">Insurance Amount</field>-->
<!--<field name="category_id" ref="hr_payroll.DED"/>-->
<!--<field name="amount_select">code</field>-->
<!--<field name="amount_python_compute">result = -(payslip.insurance_amount)</field>-->
<!--<field name="appears_on_payslip" eval="True"/>-->
<!--<field name="sequence" eval="190"/>-->
<!--</record>-->
<!--&lt;!&ndash;<record id="hr_payroll.structure_base" model="hr.payroll.structure">&ndash;&gt;-->
<!--&lt;!&ndash;<field eval="[(4, ref('hr_payslip_rule_warning')), (4, ref('hr_payslip_rule_reward'))]"&ndash;&gt;-->
<!--&lt;!&ndash;name="rule_ids"/>&ndash;&gt;-->
<!--&lt;!&ndash;</record>&ndash;&gt;-->
<!-- Insurance rule -->
<record id="hr_payslip_rule_insurance" model="hr.salary.rule">
<field name="code">INSUR</field>
<field name="name">Insurance Amount</field>
<field name="category_id" ref="hr_payroll.DED"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = -(inputs.INSUR.amount)</field>
<field name="appears_on_payslip" eval="True"/>
<field name="sequence" eval="190"/>
</record>
<record id="hr_rule_input_insurance" model="hr.rule.input">
<field name="code">INSUR</field>
<field name="name">Insurance Amount</field>
<field name="input_id" ref="hr_payslip_rule_insurance"/>
</record>
<record id="hr_payroll.structure_base" model="hr.payroll.structure">
<field eval="[(4, ref('hr_payslip_rule_insurance'))]"
name="rule_ids"/>
</record>
</data></odoo>

59
hr_insurance/views/policy_management.xml

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="insurance_policy_details_form" model="ir.ui.view">
<field name="name">Insurance Policy Details</field>
<field name="model">insurance.policy</field>
<field name="arch" type="xml">
<form string="Policy Details">
<sheet>
<group>
<group>
<field name="name"/>
</group>
<group>
<field name="company_id"/>
</group>
</group>
<notebook>
<page string="Extra Notes">
<field name="note_field"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="insurance_policy_details_tree" model="ir.ui.view">
<field name="name">Insurance Policy Details</field>
<field name="model">insurance.policy</field>
<field name="arch" type="xml">
<tree string="Policy Details">
<field name="name"/>
<field name="company_id"/>
</tree>
</field>
</record>
<record id="action_insurance_policy_management" model="ir.actions.act_window">
<field name="name">Insurance Policy </field>
<field name="res_model">insurance.policy</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
You have'nt created any policy yet.
</p>
</field>
</record>
<menuitem
id="policy_management_menu"
name="Policy"
parent="hr_insurance_main_menu"
action="action_insurance_policy_management"/>
</data>
</odoo>
Loading…
Cancel
Save