[FIX]:fix a bug related to the twise Marital status

complete move to hr module instead of hr_contract

lp bug: https://launchpad.net/bugs/520992 fixed

bzr revid: mga@tinyerp.com-20100216070246-jq8d9zf6aogz1lt8
This commit is contained in:
Mantavya Gajjar 2010-02-16 12:32:46 +05:30
parent f67408389d
commit c72753bfa1
9 changed files with 60 additions and 51 deletions

View File

@ -44,7 +44,8 @@
'hr_view.xml',
'hr_department_view.xml',
'process/hr_process.xml',
'hr_installer.xml'
'hr_installer.xml',
'hr_data.xml'
],
'demo_xml': ['hr_demo.xml',
'hr_department_demo.xml'],

View File

@ -52,6 +52,15 @@ class hr_employee_category(osv.osv):
hr_employee_category()
class hr_employee_marital_status(osv.osv):
_name = "hr.employee.marital.status"
_description = "Employee Marital Status"
_columns = {
'name' : fields.char('Marital Status', size=30, required=True),
'description' : fields.text('Status Description'),
}
hr_employee_marital_status()
class hr_employee(osv.osv):
_name = "hr.employee"
_description = "Employee"
@ -63,7 +72,7 @@ class hr_employee(osv.osv):
'sinid': fields.char('SIN No', size=32),
'otherid': fields.char('Other ID', size=32),
'gender': fields.selection([('',''),('male','Male'),('female','Female')], 'Gender'),
'marital': fields.selection([('married','Married'),('unmarried','Unmarried'),('divorced','Divorced'),('other','Other')],'Marital Status', size=32),
'marital': fields.many2one('hr.employee.marital.status', 'Marital Status'),
'address_id': fields.many2one('res.partner.address', 'Working Address'),
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),

18
addons/hr/hr_data.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Employee Marital Statusses -->
<record id="hr_employee_marital_status_single" model="hr.employee.marital.status">
<field name="name">Single</field>
</record>
<record id="hr_employee_marital_status_married" model="hr.employee.marital.status">
<field name="name">Married</field>
</record>
<record id="hr_employee_marital_status_divorced" model="hr.employee.marital.status">
<field name="name">Divorced</field>
</record>
<record id="hr_employee_marital_status_widower" model="hr.employee.marital.status">
<field name="name">Widower</field>
</record>
</data>
</openerp>

View File

@ -135,6 +135,35 @@
id="menu_open_view_employee_list_my"
parent="menu_hr_human_resources"/>
<!--
=======================
Employee marital status
=======================
-->
<record id="hr_hr_employee_marital_status_form" model="ir.ui.view">
<field name="name">hr.hr.employee.marital.status</field>
<field name="model">hr.employee.marital.status</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Marital Status">
<field colspan="4" name="name" nolabel="1" select="1"/>
<field colspan="4" name="description" nolabel="1"/>
</form>
</field>
</record>
<record id="action_hr_marital_status" model="ir.actions.act_window">
<field name="name">Marital Status</field>
<field name="res_model">hr.employee.marital.status</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
action="action_hr_marital_status"
id="hr_menu_marital_status"
parent="hr.menu_view_employee_category_configuration_form" sequence="3"/>
<!--
=======================
Employee architecture

View File

@ -4,3 +4,4 @@
"access_hr_department","hr.department","model_hr_department","hr.group_hr_user",1,0,0,0
"access_hr_employee_category_manager","hr.employee.category.manager","model_hr_employee_category","hr.group_hr_manager",1,1,1,1
"access_hr_department_manager","hr.department.manager","model_hr_department","hr.group_hr_manager",1,1,1,1
"access_hr_employee_marital_status","hr.employee.marital.status","model_hr_employee_marital_status","hr.group_hr_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
4 access_hr_department hr.department model_hr_department hr.group_hr_user 1 0 0 0
5 access_hr_employee_category_manager hr.employee.category.manager model_hr_employee_category hr.group_hr_manager 1 1 1 1
6 access_hr_department_manager hr.department.manager model_hr_department hr.group_hr_manager 1 1 1 1
7 access_hr_employee_marital_status hr.employee.marital.status model_hr_employee_marital_status hr.group_hr_user 1 1 1 1

View File

@ -23,15 +23,6 @@
from osv import fields, osv
import time
class hr_employee_marital_status(osv.osv):
_name = "hr.employee.marital.status"
_description = "Employee Marital Status"
_columns = {
'name' : fields.char('Marital Status', size=30, required=True),
'description' : fields.text('Status Description'),
}
hr_employee_marital_status()
class hr_employee(osv.osv):
_name = "hr.employee"
_description = "Employee"
@ -41,7 +32,6 @@ class hr_employee(osv.osv):
'medic_exam' : fields.date('Medical examination date'),
'audiens_num' : fields.char('AUDIENS Number', size=30),
'place_of_birth' : fields.char('Place of Birth', size=30),
'marital_status' : fields.many2one('hr.employee.marital.status', 'Marital Status'),
'children' : fields.integer('Number of children'),
'contract_ids' : fields.one2many('hr.contract', 'employee_id', 'Contracts'),
}

View File

@ -25,18 +25,5 @@
<field name="period_id" ref="hr_contract_wage_type_period_monthly"/>
</record>
<!-- Employee Marital Statusses -->
<record id="hr_employee_marital_status_single" model="hr.employee.marital.status">
<field name="name">Single</field>
</record>
<record id="hr_employee_marital_status_married" model="hr.employee.marital.status">
<field name="name">Married</field>
</record>
<record id="hr_employee_marital_status_divorced" model="hr.employee.marital.status">
<field name="name">Divorced</field>
</record>
<record id="hr_employee_marital_status_widower" model="hr.employee.marital.status">
<field name="name">Widower</field>
</record>
</data>
</openerp>

View File

@ -15,18 +15,6 @@
</record>
<record id="hr_hr_employee_marital_status_form" model="ir.ui.view">
<field name="name">hr.hr.employee.marital.status</field>
<field name="model">hr.employee.marital.status</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Marital Status">
<field colspan="4" name="name" nolabel="1" select="1"/>
<field colspan="4" name="description" nolabel="1"/>
</form>
</field>
</record>
<record id="hr_contract_wage_type_view_form" model="ir.ui.view">
<field name="name">hr.contract.wage.type.view.form</field>
<field name="model">hr.contract.wage.type</field>
@ -118,7 +106,6 @@
<field name="medic_exam" select="1"/>
<field name="audiens_num"/>
<field name="place_of_birth"/>
<field name="marital_status"/>
<field name="children"/>
</page>
</notebook>
@ -137,18 +124,6 @@
</field>
</record>
<record id="action_hr_marital_status" model="ir.actions.act_window">
<field name="name">Marital Status</field>
<field name="res_model">hr.employee.marital.status</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
action="action_hr_marital_status"
id="hr_menu_marital_status"
parent="hr.menu_view_employee_category_configuration_form" sequence="3"/>
<record id="hr_contract_view_form" model="ir.ui.view">
<field name="name">hr.contract.view.form</field>
<field name="model">hr.contract</field>

View File

@ -1,5 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_employee_marital_status","hr.employee.marital.status","model_hr_employee_marital_status","hr.group_hr_user",1,1,1,1
"access_hr_contract_wage_type_period_user","hr.contract.wage.type.period user","model_hr_contract_wage_type_period","hr.group_hr_user",1,0,0,0
"access_hr_contract_wage_type_period","hr.contract.wage.type.period","model_hr_contract_wage_type_period","hr.group_hr_manager",1,1,1,1
"access_hr_contract_wage_type_user","hr.contract.wage.type user","model_hr_contract_wage_type","hr.group_hr_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_hr_employee_marital_status hr.employee.marital.status model_hr_employee_marital_status hr.group_hr_user 1 1 1 1
2 access_hr_contract_wage_type_period_user hr.contract.wage.type.period user model_hr_contract_wage_type_period hr.group_hr_user 1 0 0 0
3 access_hr_contract_wage_type_period hr.contract.wage.type.period model_hr_contract_wage_type_period hr.group_hr_manager 1 1 1 1
4 access_hr_contract_wage_type_user hr.contract.wage.type user model_hr_contract_wage_type hr.group_hr_user 1 0 0 0