[IMP] Clean hr_* module (Still need to done)

bzr revid: mra@mra-laptop-20100703102152-4ulrrzbkorpd7xei
This commit is contained in:
Mustufa Rangwala 2010-07-03 15:51:52 +05:30
parent 91d266a1d6
commit c179005fc7
67 changed files with 833 additions and 814 deletions

View File

@ -46,9 +46,10 @@
'hr_data.xml',
'board_hr_view.xml',
],
'demo_xml': ['hr_demo.xml',
'hr_department_demo.xml'],
'demo_xml': [
'hr_demo.xml',
'hr_department_demo.xml'
],
'test': ['test/test_hr.yml'],
'installable': True,
'active': False,

View File

@ -27,7 +27,6 @@ from tools.translate import _
class hr_employee_category(osv.osv):
_name = "hr.employee.category"
_description = "Employee Category"
_columns = {
'name': fields.char("Category", size=64, required=True),
'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True),
@ -60,6 +59,7 @@ class hr_employee_marital_status(osv.osv):
hr_employee_marital_status()
class hr_job(osv.osv):
def _no_of_employee(self, cr, uid, ids, name, args, context=None):
res = {}
for emp in self.browse(cr, uid, ids):
@ -80,9 +80,9 @@ class hr_job(osv.osv):
'state': fields.selection([('open', 'Open'),('old', 'Old'),('recruit', 'In Recruitement')], 'State', required=True),
}
_defaults = {
'expected_employees': lambda *a: 1,
'expected_employees': 1,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
'state': lambda *args: 'open'
'state': 'open'
}
hr_job()

View File

@ -1,6 +1,7 @@
<?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>
@ -14,5 +15,6 @@
<record id="hr_employee_marital_status_widower" model="hr.employee.marital.status">
<field name="name">Widower</field>
</record>
</data>
</openerp>

View File

@ -25,6 +25,8 @@ import tools
class hr_department(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['name','parent_id'], context)
@ -36,7 +38,7 @@ class hr_department(osv.osv):
res.append((record['id'], name))
return res
def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context):
def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
res = self.name_get(cr, uid, ids, context)
return dict(res)
@ -51,13 +53,19 @@ class hr_department(osv.osv):
'manager_id': fields.many2one('res.users', 'Manager', required=True),
'member_ids': fields.many2many('res.users', 'hr_department_user_rel', 'department_id', 'user_id', 'Members'),
}
def _get_members(self,cr, uid, context={}):
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.department', context=c),
}
def _get_members(self,cr, uid, context=None):
mids = self.search(cr, uid, [('manager_id', '=', uid)])
result = {uid:1}
for m in self.browse(cr, uid, mids, context):
for user in m.member_ids:
result[user.id] = 1
return result.keys()
def _check_recursion(self, cr, uid, ids):
level = 100
while len(ids):
@ -78,18 +86,17 @@ hr_department()
class ir_action_window(osv.osv):
_inherit = 'ir.actions.act_window'
def read(self, cr, uid, ids, fields=None, context=None,
load='_classic_read'):
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
if context is None:
context = {}
select = ids
if isinstance(ids, (int, long)):
select = [ids]
res = super(ir_action_window, self).read(cr, uid, select, fields=fields,
context=context, load=load)
res = super(ir_action_window, self).read(cr, uid, select, fields=fields, context=context, load=load)
for r in res:
mystring = 'department_users_get()'
if mystring in (r.get('domain', '[]') or ''):
r['domain'] = r['domain'].replace(mystring, str(
self.pool.get('hr.department')._get_members(cr, uid)))
r['domain'] = r['domain'].replace(mystring, str(self.pool.get('hr.department')._get_members(cr, uid)))
if isinstance(ids, (int, long)):
if res:
return res[0]
@ -103,7 +110,7 @@ class res_users(osv.osv):
_inherit = 'res.users'
_description = 'User'
def _parent_compute(self, cr, uid, ids, name, args, context={}):
def _parent_compute(self, cr, uid, ids, name, args, context=None):
result = {}
obj_dept = self.pool.get('hr.department')
for user_id in ids:
@ -125,10 +132,12 @@ class res_users(osv.osv):
return [('id', 'in', [0])]
return [('id', 'in', child_ids.get(uid,[]))]
def _child_compute(self, cr, uid, ids, name, args, context={}):
def _child_compute(self, cr, uid, ids, name, args, context=None):
obj_dept = self.pool.get('hr.department')
obj_user = self.pool.get('res.users')
result = {}
if context is None:
context = {}
for manager_id in ids:
child_ids = []
mgnt_dept_ids = obj_dept.search(cr, uid, [('manager_id', '=', manager_id)])
@ -140,7 +149,6 @@ class res_users(osv.osv):
childs = obj_user.search(cr, uid, [('id', 'in', childs),('active', '=', True)])
if manager_id in childs:
childs.remove(manager_id)
child_ids.extend(tools.flatten(childs))
set = {}
map(set.__setitem__, child_ids, [])
@ -150,7 +158,7 @@ class res_users(osv.osv):
result[manager_id] = child_ids
return result
def _child_search(self, cr, uid, obj, name, args, context):
def _child_search(self, cr, uid, obj, name, args, context=None):
parent = []
for arg in args:
if arg[0] == 'child_ids':
@ -165,5 +173,7 @@ class res_users(osv.osv):
'child_ids': fields.function(_child_compute, relation='res.users', fnct_search=_child_search, method=True, string="Subordinates", type='many2many'),
'context_department_id': fields.many2one('hr.department', 'Departments'),
}
res_users()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_installer" model="ir.ui.view">
<field name="name">hr.installer.view</field>
<field name="model">hr.installer</field>
@ -10,15 +12,13 @@
<form position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
</separator>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>
</xpath>
<xpath expr="//label[@string='description']"
position="attributes">
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">The base Human Resources addon will help you manage your employee roster, but you can enhance it even further by installing a few HR-related applications.</attribute>
</xpath>
<group colspan="8">
@ -51,6 +51,7 @@
<field name="action_id" ref="action_hr_installer"/>
<field name="sequence">3</field>
</record>
<record id="hr_ir_actions_todo_tree" model="ir.ui.view">
<field name="model">ir.actions.todo</field>
<field name="name">hr_installer_action_replace</field>
@ -62,5 +63,6 @@
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -1,32 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="menu_hr_root"
icon="terp-hr"
name="Human Resources"
sequence="15"/>
<menuitem
id="menu_hr_main"
parent="menu_hr_root"
name="Human Resources"
sequence="0"/>
<menuitem
id="menu_hr_configuration"
name="Configuration"
parent="hr.menu_hr_root"
groups="group_hr_manager"
sequence="50" />
<menuitem
id="menu_hr_management"
name="Human Resources"
parent="hr.menu_hr_configuration"
groups="group_hr_manager"
sequence="1" />
<menuitem
id="menu_view_employee_category_configuration_form"
parent="hr.menu_hr_management"
name="Employees"
<menuitem id="menu_hr_root" icon="terp-hr" name="Human Resources" sequence="15"/>
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="group_hr_manager" sequence="50" />
<menuitem id="menu_hr_management" name="Human Resources" parent="hr.menu_hr_configuration" groups="group_hr_manager" sequence="1" />
<menuitem id="menu_view_employee_category_configuration_form" parent="hr.menu_hr_management" name="Employees"
sequence="1"/>
<!--
@ -112,14 +92,14 @@
</tree>
</field>
</record>
<record id="view_employee_filter" model="ir.ui.view">
<field name="name">Employees</field>
<field name="model">hr.employee</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Employees">
<filter icon="terp-personal-" domain="[('active','=',False)]" string="Unactive"
groups="base.group_extended"/>
<filter icon="terp-personal-" domain="[('active','=',False)]" string="Unactive" groups="base.group_extended"/>
<field name="name"/>
<field name="department_id" widget="selection"/>
<field name="job_id" widget="selection"/>
@ -135,6 +115,7 @@
</search>
</field>
</record>
<record id="open_view_employee_tree" model="ir.actions.act_window">
<field name="name">Employees Structure</field>
<field name="res_model">hr.employee</field>
@ -153,6 +134,7 @@
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_employee_filter"/>
</record>
<record id="open_view_employee_list_my" model="ir.actions.act_window">
<field name="name">Employees</field>
<field name="res_model">hr.employee</field>
@ -162,17 +144,14 @@
<field name="view_id" ref="view_employee_tree"/>
<field name="search_view_id" ref="view_employee_filter"/>
</record>
<menuitem
action="open_view_employee_list_my"
id="menu_open_view_employee_list_my"
sequence="3"
parent="menu_hr_main"/>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/>
<!--
=======================
Employee marital status
======================= -->
=======================
-->
<record id="hr_hr_employee_marital_status_form" model="ir.ui.view">
<field name="name">hr.hr.employee.marital.status</field>
@ -194,17 +173,15 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem
action="action_hr_marital_status"
id="hr_menu_marital_status"
<menuitem action="action_hr_marital_status" id="hr_menu_marital_status"
parent="hr.menu_view_employee_category_configuration_form" sequence="3"/>
<!--
=======================
Employee architecture
=======================
-->
<record id="view_partner_tree2" model="ir.ui.view">
<field name="name">hr.employee.tree</field>
<field name="model">hr.employee</field>
@ -216,10 +193,10 @@
<field name="ssnid"/>
<field name="user_id"/>
<field name="address_id"/>
</tree>
</field>
</record>
<record id="action2" model="ir.actions.act_window">
<field name="name">Employee Hierarchy</field>
<field name="type">ir.actions.act_window</field>
@ -228,6 +205,7 @@
<field name="view_type">tree</field>
<field name="view_id" ref="view_partner_tree2"/>
</record>
<ir_set>
<field eval="'action'" name="key"/>
<field eval="'client_action_multi'" name="key2"/>
@ -255,6 +233,7 @@
</form>
</field>
</record>
<record id="view_employee_category_list" model="ir.ui.view">
<field name="name">hr.employee.category.list</field>
<field name="model">hr.employee.category</field>
@ -267,6 +246,7 @@
</tree>
</field>
</record>
<record id="view_employee_category_tree" model="ir.ui.view">
<field name="name">hr.employee.category.tree</field>
<field name="model">hr.employee.category</field>
@ -278,6 +258,7 @@
</tree>
</field>
</record>
<record id="open_view_categ_form" model="ir.actions.act_window">
<field name="name">Categories of Employee</field>
<field name="res_model">hr.employee.category</field>
@ -285,10 +266,8 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem action="open_view_categ_form"
id="menu_view_employee_category_form"
parent="menu_view_employee_category_configuration_form" sequence="1"
groups="base.group_extended"/>
<menuitem action="open_view_categ_form" id="menu_view_employee_category_form"
parent="menu_view_employee_category_configuration_form" sequence="1" groups="base.group_extended"/>
<record id="open_view_categ_tree" model="ir.actions.act_window">
<field name="name">Categories structure</field>
@ -316,9 +295,7 @@
<field eval="True" name="object"/>
</record>
<menuitem
action="open_view_categ_tree"
groups="base.group_extended"
<menuitem action="open_view_categ_tree" groups="base.group_extended"
id="menu_view_employee_category_tree" parent="hr.menu_view_employee_category_form"/>
<record id="view_hr_job_form" model="ir.ui.view">
@ -350,6 +327,7 @@
</form>
</field>
</record>
<record id="view_hr_job_tree" model="ir.ui.view">
<field name="name">hr.job.tree</field>
<field name="model">hr.job</field>
@ -364,35 +342,28 @@
</tree>
</field>
</record>
<record id="view_job_filter" model="ir.ui.view">
<field name="name">Job</field>
<field name="model">hr.job</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Jobs">
<filter icon="terp-check"
domain="[('state','in',('open','recruit'))]"
string="Current"
<filter icon="terp-check" domain="[('state','in',('open','recruit'))]" string="Current"
help="Open and in recruitment positions"/>
<filter icon="terp-personal+"
domain="[('state','=','recruit')]"
string="Recruitment"
<filter icon="terp-personal+" domain="[('state','=','recruit')]" string="Recruitment"
help="In Recruitment"/>
<filter icon="terp-camera_test"
domain="[('state','=','open')]"
string="Open"
<filter icon="terp-camera_test" domain="[('state','=','open')]" string="Open"
help="Open Positions"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="department_id" widget="selection">
<filter icon="terp-gtk-select-all"
domain="[('department_id','=',context.get('department_id',False))]"
help="My Departments Jobs"/>
<filter icon="terp-gtk-select-all" domain="[('department_id','=',context.get('department_id',False))]" help="My Departments Jobs"/>
</field>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_hr_job">
<field name="name">Job Positions</field>
<field name="res_model">hr.job</field>
@ -400,14 +371,8 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Recruitment"
id="base.menu_crm_case_job_req_main"
parent="menu_hr_root"/>
<menuitem
parent="base.menu_crm_case_job_req_main"
id="menu_hr_job"
action="action_hr_job" sequence="2"/>
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root"/>
<menuitem parent="base.menu_crm_case_job_req_main" id="menu_hr_job" action="action_hr_job" sequence="2"/>
</data>
</openerp>

View File

@ -23,7 +23,6 @@ from osv import fields, osv
class hr_installer(osv.osv_memory):
_name = 'hr.installer'
_inherit = 'res.config.installer'
_columns = {
# Human Resources Management
'hr_holidays': fields.boolean('Holidays / Leaves Management',

View File

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="group_hr_manager" model="res.groups">
<field name="name">Human Resources / Manager</field>
</record>
<record id="group_hr_user" model="res.groups">
<field name="name">Human Resources / User</field>
</record>
</data>
</openerp>

View File

@ -26,7 +26,6 @@
'category': 'Generic Modules/Human Resources',
'description': """
This module aims to manage employee's attendances.
Keeps account of the attendances of the employees on the basis of the
actions(Sign in/Sign out) performed by them.
""",

View File

@ -19,7 +19,6 @@
#
##############################################################################
from mx import DateTime
import time
from osv import fields, osv
@ -33,7 +32,7 @@ class hr_action_reason(osv.osv):
'action_type': fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action's type"),
}
_defaults = {
'action_type' : lambda *a: 'sign_in',
'action_type': 'sign_in',
}
hr_action_reason()
@ -51,8 +50,8 @@ class hr_attendance(osv.osv):
res = dict.fromkeys(ids, '')
for obj in self.browse(cr, uid, ids, context=context):
res[obj.id] = time.strftime('%Y-%m-%d', time.strptime(obj.name, '%Y-%m-%d %H:%M:%S'))
return res
_columns = {
'name': fields.datetime('Date', required=True, select=1),
'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
@ -61,7 +60,7 @@ class hr_attendance(osv.osv):
'day': fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32),
}
_defaults = {
'name' : lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'name': time.strftime('%Y-%m-%d %H:%M:%S'),
'employee_id': _employee_get,
}
@ -75,7 +74,6 @@ class hr_attendance(osv.osv):
and name <= (select name from hr_attendance where id=%s)
order by name desc
limit 2 '''
cr.execute(sql,(id,id))
atts = cr.fetchall()
if not ((len(atts)==1 and atts[0][0] == 'sign_in') or (atts[0][0] != atts[1][0] and atts[0][1] != atts[1][1])):
@ -113,19 +111,18 @@ class hr_employee(osv.osv):
'state': fields.function(_state, method=True, type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Attendance'),
}
def _action_check(self, cr, uid, emp_id, dt=False,context={}):
def _action_check(self, cr, uid, emp_id, dt=False, context=None):
cr.execute('select max(name) from hr_attendance where employee_id=%s', (emp_id,))
res = cr.fetchone()
return not (res and (res[0]>=(dt or time.strftime('%Y-%m-%d %H:%M:%S'))))
def attendance_action_change(self, cr, uid, ids, type='action', context={}, dt=False, *args):
def attendance_action_change(self, cr, uid, ids, type='action', context=None, dt=False, *args):
id = False
warning_sign = 'sign'
#Special case when button calls this method :type=context
if isinstance(type, dict):
type = type.get('type','action')
if type == 'sign_in':
warning_sign = "Sign In"
elif type == 'sign_out':
@ -139,11 +136,11 @@ class hr_employee(osv.osv):
if dt:
res['name'] = dt
id = self.pool.get('hr.attendance').create(cr, uid, res, context=context)
if type != 'action':
return id
return True
hr_employee()

View File

@ -7,100 +7,120 @@
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance2" model="hr.attendance">
<field eval="time.strftime('%Y-%m-01 11:51')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance3" model="hr.attendance">
<field eval="time.strftime('%Y-%m-02 12:47')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance4" model="hr.attendance">
<field eval="time.strftime('%Y-%m-02 19:53')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance5" model="hr.attendance">
<field eval="time.strftime('%Y-%m-03 07:32')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance6" model="hr.attendance">
<field eval="time.strftime('%Y-%m-03 12:32')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance7" model="hr.attendance">
<field eval="time.strftime('%Y-%m-04 14:01')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance8" model="hr.attendance">
<field eval="time.strftime('%Y-%m-04 17:21')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance9" model="hr.attendance">
<field eval="time.strftime('%Y-%m-05 09:10')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance10" model="hr.attendance">
<field eval="time.strftime('%Y-%m-05 12:42')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance11" model="hr.attendance">
<field eval="time.strftime('%Y-%m-06 13:10')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance12" model="hr.attendance">
<field eval="time.strftime('%Y-%m-06 18:34')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance13" model="hr.attendance">
<field eval="time.strftime('%Y-%m-07 08:21')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance14" model="hr.attendance">
<field eval="time.strftime('%Y-%m-07 18:21')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance15" model="hr.attendance">
<field eval="time.strftime('%Y-%m-08 08:21')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance16" model="hr.attendance">
<field eval="time.strftime('%Y-%m-08 12:54')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance17" model="hr.attendance">
<field eval="time.strftime('%Y-%m-09 13:32')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance18" model="hr.attendance">
<field eval="time.strftime('%Y-%m-09 19:31')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance19" model="hr.attendance">
<field eval="time.strftime('%Y-%m-10 07:10')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance20" model="hr.attendance">
<field eval="time.strftime('%Y-%m-10 12:34')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
</data>
</openerp>

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="attendance_error_report" keyword="client_print_multi" menu="False" model="hr.employee" multi="True" name="report.hr.timesheet.attendance.error" rml="hr_attendance/report/attendance_errors.rml" string="Attendance Error Report"/>
</data>
</openerp>

View File

@ -8,13 +8,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Employee attendance">
<field name="employee_id" select="1"/>
<field name="name" select="1"/>
<field name="action" select="1"/>
<field name="action_desc" select="1"/>
<field name="employee_id" />
<field name="name" />
<field name="action" />
<field name="action_desc" />
</form>
</field>
</record>
<record id="view_attendance_tree" model="ir.ui.view">
<field name="name">hr.attendance.tree</field>
<field name="model">hr.attendance</field>
@ -51,9 +52,9 @@
<filter icon="terp-stock_align_left_24" string="My Attendances" domain="[('employee_id.user_id.id', '=', uid)]" />
<filter icon="terp-go-today" string="Today" domain="[('name::date','=',current_date)]" />
<separator orientation="vertical"/>
<field name="employee_id" select="1" />
<field name="name" select="1" />
<field name="action" select="1" />
<field name="employee_id" />
<field name="name" />
<field name="action" />
<newline/>
<group expand="0" string="Group By...">
<filter name="employee" string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
@ -74,12 +75,8 @@
<!--<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root"
groups="group_hr_attendance"/>-->
<menuitem
id="menu_hr_time_tracking"
name="Time Tracking"
parent="hr.menu_hr_root" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance"
parent="menu_hr_time_tracking" groups="hr.group_hr_manager" sequence="3"/>
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_time_tracking" groups="hr.group_hr_manager" sequence="3"/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
@ -87,11 +84,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Define attendance reason">
<field colspan="4" name="name" select="1"/>
<field name="action_type" select="1"/>
<field colspan="4" name="name" />
<field name="action_type" />
</form>
</field>
</record>
<record id="view_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.tree</field>
<field name="model">hr.action.reason</field>
@ -103,6 +101,7 @@
</tree>
</field>
</record>
<record id="open_view_attendance_reason" model="ir.actions.act_window">
<field name="name">Attendance Reasons</field>
<field name="type">ir.actions.act_window</field>
@ -111,6 +110,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_attendance_reason"/>
</record>
<menuitem sequence="9" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
<menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_config"/>

View File

@ -13,9 +13,7 @@
groups="group_hr_attendance"/>-->
<!--Time Tracking menu for Project Management-->
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
<menuitem
id="base.menu_project_management_time_tracking"
name="Time Tracking"
<menuitem id="base.menu_project_management_time_tracking" name="Time Tracking"
parent="base.menu_main_pm" sequence="3"/>
<!--<menuitem action="hr_attendance.si_so" id="menu_project_management_si_so" parent="base.menu_project_management_time_tracking" type="wizard" sequence="9"/>
-->

View File

@ -19,13 +19,13 @@
#
##############################################################################
import time
from report import report_sxw
import pooler
import datetime
class attendance_print(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(attendance_print, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
@ -88,6 +88,5 @@ class attendance_print(report_sxw.rml_parse):
report_sxw.report_sxw('report.hr.attendance.error', 'hr.employee', 'addons/hr_attendance/report/attendance_errors.rml', parser=attendance_print, header=2)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -38,7 +38,10 @@ def hour2str(h):
return '%02dh%02d' % (hours, minutes)
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context):
def create_xml(self, cr, uid, ids, datas, context=None):
if context is None:
context = {}
month = DateTime.DateTime(datas['form']['year'], datas['form']['month'], 1)
user_xml = ['<month>%s</month>' % month2name[month.month], '<year>%s</year>' % month.year]
for employee_id in ids:
@ -88,7 +91,6 @@ class report_custom(report_rml):
%s
</report>
''' % '\n'.join(user_xml)
return xml
report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')

View File

@ -22,7 +22,7 @@
from mx import DateTime
from mx.DateTime import now
import netsvc
import pooler
from report.interface import report_rml
@ -35,13 +35,12 @@ def to_hour(h):
return int(h), int(round((h - int(h)) * 60, 0))
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context):
def create_xml(self, cr, uid, ids, datas, context=None):
start_date = DateTime.strptime(datas['form']['init_date'], '%Y-%m-%d')
end_date = DateTime.strptime(datas['form']['end_date'], '%Y-%m-%d')
first_monday = start_date - DateTime.RelativeDateTime(days=start_date.day_of_week)
last_monday = end_date + DateTime.RelativeDateTime(days=7 - end_date.day_of_week)
if last_monday < first_monday:
first_monday, last_monday = last_monday, first_monday

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="group_hr_attendance" model="res.groups">
<field name="name">Human Resources / Attendances User</field>
</record>
</data>
</openerp>

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
@ -26,16 +27,17 @@ class hr_attendance_bymonth(osv.osv_memory):
_name = 'hr.attendance.month'
_description = 'Print Monthly Attendance Report'
_columns = {
'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')],
'Month', required=True),
'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], 'Month', required=True),
'year': fields.integer('Year', required=True)
}
_defaults = {
'month': lambda * a: time.gmtime()[1],
'year': lambda * a: time.gmtime()[0],
'month': time.gmtime()[1],
'year': time.gmtime()[0],
}
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
datas = {
'ids': [],
'model': 'hr.employee',

View File

@ -30,8 +30,8 @@ class hr_attendance_byweek(osv.osv_memory):
'end_date': fields.date('Ending Date', required=True)
}
_defaults = {
'init_date': lambda *a: time.strftime('%Y-%m-%d'),
'end_date': lambda *a: time.strftime('%Y-%m-%d'),
'init_date': time.strftime('%Y-%m-%d'),
'end_date': time.strftime('%Y-%m-%d'),
}
def print_report(self, cr, uid, ids, context=None):

View File

@ -31,15 +31,16 @@ class hr_attendance_error(osv.osv_memory):
'init_date': fields.date('Starting Date', required=True),
'end_date': fields.date('Ending Date', required=True),
'max_delay': fields.integer('Max. Delay (Min)', required=True)
}
_defaults = {
'init_date': lambda *a: time.strftime('%Y-%m-%d'),
'end_date': lambda *a: time.strftime('%Y-%m-%d'),
'init_date': time.strftime('%Y-%m-%d'),
'end_date': time.strftime('%Y-%m-%d'),
'max_delay': 120,
}
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
emp_ids = []
data_error = self.read(cr, uid, ids)[0]
date_from = data_error['init_date']

View File

@ -20,7 +20,6 @@
##############################################################################
import time
import netsvc
from osv import osv, fields
from tools.translate import _
@ -32,7 +31,10 @@ class hr_si_so_ask(osv.osv_memory):
'last_time': fields.datetime('Your last sign out', required=True),
'emp_id': fields.char('Empoyee ID', size=32, required=True, readonly=True),
}
def _get_empname(self, cr, uid, context=None):
if context is None:
context = {}
emp_id = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
if emp_id:
employee = self.pool.get('hr.employee').browse(cr, uid, emp_id, context=context)[0].name
@ -152,11 +154,8 @@ class hr_sign_in_out(osv.osv_memory):
if 'last_time' in data:
if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
raise osv.except_osv(_('UserError'), _('The sign-out date must be in the past'))
self.pool.get('hr.attendance').create(cr, uid, {
'name': data['last_time'],
'action': 'sign_out',
'employee_id': emp_id
})
self.pool.get('hr.attendance').create(cr, uid, {'name': data['last_time'], 'action': 'sign_out',
'employee_id': emp_id})
try:
success = self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_in')
except:

View File

@ -45,8 +45,7 @@
<field name="target">new</field>
</record>
<menuitem action="action_hr_attendance_sigh_in_out"
id="menu_hr_attendance_sigh_in_out"
<menuitem action="action_hr_attendance_sigh_in_out" id="menu_hr_attendance_sigh_in_out"
parent="menu_hr_time_tracking" sequence="4"/>
<record id="view_hr_attendance_so_ask" model="ir.ui.view">
@ -87,6 +86,5 @@
</field>
</record>
</data>
</openerp>

View File

@ -29,7 +29,6 @@
* Martial status,
* Security number,
* Place of birth, birth date, ...
You can assign several contracts per employee.
""",
'author': 'Tiny',

View File

@ -46,7 +46,7 @@ class hr_contract_wage_type_period(osv.osv):
'factor_days': fields.float('Hours in the period', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the price of an hour of work wased on the contract of the employee')
}
_defaults = {
'factor_days': lambda *args: 168.0
'factor_days': 168.0
}
hr_contract_wage_type_period()
@ -61,8 +61,8 @@ class hr_contract_wage_type(osv.osv):
'factor_type': fields.float('Factor for hour cost', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the price of an hour of work wased on the contract of the employee')
}
_defaults = {
'type' : lambda *a : 'gross',
'factor_type': lambda *args: 1.8
'type': 'gross',
'factor_type': 1.8
}
hr_contract_wage_type()
@ -95,8 +95,9 @@ class hr_contract(osv.osv):
'notes': fields.text('Notes'),
}
_defaults = {
'date_start' : lambda *a : time.strftime("%Y-%m-%d"),
'date_start': time.strftime("%Y-%m-%d"),
}
hr_contract()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,6 +19,7 @@
<field name="type">gross</field>
<field name="period_id" ref="hr_contract_wage_type_period_monthly"/>
</record>
<record id="hr_contract_monthly_net" model="hr.contract.wage.type">
<field name="name">Monthly Net Wage</field>
<field name="type">net</field>

View File

@ -58,7 +58,6 @@
</record>
<menuitem id="next_id_56" name="Contract" parent="hr.menu_hr_management" sequence="5"/>
<menuitem action="action_hr_contract_wage_type" id="hr_menu_contract_wage_type" parent="next_id_56"/>
<record id="hr_contract_wage_type_period_view_form" model="ir.ui.view">
@ -94,12 +93,9 @@
<field name="search_view_id" ref="hr_contract_wage_type_period_view_search"/>
</record>
<menuitem
action="action_hr_contract_wage_type_period"
id="hr_menu_contract_wage_type_period"
<menuitem action="action_hr_contract_wage_type_period" id="hr_menu_contract_wage_type_period"
parent="hr_contract.next_id_56"/>
<record id="hr_hr_employee_view_form2" model="ir.ui.view">
<field name="name">hr.hr.employee.view.form2</field>
<field name="model">hr.employee</field>
@ -115,13 +111,13 @@
</group>
<group colspan="2" col="2">
<separator string="Job Info" colspan="2"/>
<field name="manager" select="1"/>
<field name="vehicle" select="1"/>
<field name="vehicle_distance" select="1"/>
<field name="manager" />
<field name="vehicle" />
<field name="vehicle_distance" />
</group>
<group colspan="2" col="2">
<separator string="Others Info" colspan="2"/>
<field name="medic_exam" select="1"/>
<field name="medic_exam" />
</group>
</page>
</notebook>
@ -155,8 +151,8 @@
<field name="arch" type="xml">
<form string="Contract">
<group colspan="3" col="6">
<field name="name" select="1"/>
<field name="employee_id" select="1"/>
<field name="name" />
<field name="employee_id" />
<field name="job_id"/>
<field name="wage"/>
<field name="wage_type_id" widget="selection"/>
@ -166,8 +162,8 @@
<page string="Main Data">
<group col="2" colspan="2">
<separator colspan="2" string="Duration"/>
<field name="date_start" select="1"/>
<field name="date_end" select="1"/>
<field name="date_start" />
<field name="date_end" />
<field name="working_hours"/>
</group>
<group col="2" colspan="2">
@ -254,13 +250,12 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="hr_contract_type_view_search"/>
</record>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56"/>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56"/>
<menuitem action="action_hr_contract" id="hr_menu_contract" parent="hr.menu_hr_main" name="Contracts" sequence="4"/>
<!-- Contracts Button on Employee Form -->
<act_window domain="[('employee_id', '=', active_id)]" id="act_hr_employee_2_hr_contract" name="Contracts" res_model="hr.contract" src_model="hr.employee"/>
</data>
</openerp>

View File

@ -33,7 +33,8 @@
in which various surveys can be created and it can be defined which
level of employee hierarchy fills what and final review and evaluation
is done by the manager.Every evaluation filled by the employees can be viewed
in the form of.Implements a dashboard for My Current Evaluations """,
in the form of.Implements a dashboard for My Current Evaluations
""",
"init_xml": [],
"demo_xml": ["hr_evaluation_demo.xml",
],
@ -41,7 +42,8 @@
"security/ir.model.access.csv",
"wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml"],
"report/hr_evaluation_report_view.xml"
],
"test": ["test/test_hr_evaluation.yml"],
"active": False,
"installable": True

View File

@ -75,7 +75,7 @@ class hr_evaluation_plan_phase(osv.osv):
'email_subject':fields.text('char')
}
_defaults = {
'sequence' : lambda *a: 1,
'sequence' : 1,
'email_subject': _('''Regarding '''),
'mail_body' : lambda *a:_('''
Date : %(date)s
@ -93,8 +93,6 @@ Thanks,
'''),
}
hr_evaluation_plan_phase()
class hr_employee(osv.osv):
@ -106,6 +104,8 @@ class hr_employee(osv.osv):
}
def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
if context is None:
context = {}
for id in self.browse(cr, uid, self.search(cr, uid, [], context=context), context=context):
if id.evaluation_plan_id and id.evaluation_date:
if (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
@ -113,7 +113,7 @@ class hr_employee(osv.osv):
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id.id, 'plan_id': id.evaluation_plan_id}, context)
return True
def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context={}):
def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context=None):
evaluation_date = evaluation_date or False
evaluation_plan_obj=self.pool.get('hr_evaluation.plan')
if evaluation_plan_id:
@ -130,7 +130,7 @@ class hr_employee(osv.osv):
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context)
return {'value': {'evaluation_date': evaluation_date}}
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
id = super(hr_employee, self).create(cr, uid, vals, context=context)
if vals.get('evaluation_plan_id', False):
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context)
@ -183,7 +183,7 @@ class hr_evaluation(osv.osv):
res.append((record['id'], name))
return res
def onchange_employee_id(self, cr, uid, ids, employee_id, context={}):
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
employee_obj=self.pool.get('hr.employee')
evaluation_plan_id=''
if employee_id:
@ -193,7 +193,7 @@ class hr_evaluation(osv.osv):
employee_ids=employee_obj.search(cr, uid, [('parent_id','=',employee.id)], context=context)
return {'value': {'plan_id':evaluation_plan_id}}
def button_plan_in_progress(self, cr, uid, ids, context={}):
def button_plan_in_progress(self, cr, uid, ids, context=None):
apprai_id = []
for evaluation in self.browse(cr, uid, ids, context):
wait = False
@ -224,13 +224,8 @@ class hr_evaluation(osv.osv):
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [int_id], context=context)
if (not wait) and phase.mail_feature:
body = phase.mail_body % {
'employee_name': child.name,
'user_signature': user.signature,
'eval_name': phase.survey_id.title,
'date': time.strftime('%Y-%m-%d'),
'time': time
}
body = phase.mail_body % {'employee_name': child.name, 'user_signature': user.signature,
'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time }
sub = phase.email_subject
dest = [child.work_email]
if dest:
@ -239,7 +234,7 @@ class hr_evaluation(osv.osv):
self.write(cr, uid, ids, {'state':'wait'}, context=context)
return True
def button_final_validation(self, cr, uid, ids, context={}):
def button_final_validation(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'progress'})
request_obj = self.pool.get('hr.evaluation.interview')
for id in self.browse(cr, uid ,ids,context=context):
@ -247,11 +242,11 @@ class hr_evaluation(osv.osv):
raise osv.except_osv(_('Warning !'),_("You cannot change state, because some appraisal in waiting answer or draft state"))
return True
def button_done(self,cr, uid, ids, context={}):
def button_done(self,cr, uid, ids, context=None):
self.write(cr,uid,ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
return True
def button_cancel(self, cr, uid, ids, context={}):
def button_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids,{'state':'cancel'}, context=context)
return True
@ -281,7 +276,7 @@ class hr_evaluation_interview(osv.osv):
'is_evaluation': True,
}
def survey_req_waiting_answer(self, cr, uid, ids, context={}):
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state' : 'waiting_answer'})
return True
@ -310,11 +305,11 @@ class hr_evaluation_interview(osv.osv):
self.write(cr, uid, ids, { 'state': 'done'})
return True
def survey_req_draft(self, cr, uid, ids, context={}):
def survey_req_draft(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state': 'draft'}, context=context)
return True
def survey_req_cancel(self, cr, uid, ids, context={}):
def survey_req_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state': 'cancel'}, context=context)
return True
@ -331,12 +326,12 @@ class hr_evaluation_interview(osv.osv):
"""
if not context:
context = {}
record = self.browse(cr, uid, ids, context)
record = record and record[0]
context.update({'survey_id': record.survey_id.id, 'response_id': [record.response.id], 'response_no':0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
return value
hr_evaluation_interview()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="survey_2" model="survey">
<field name="title">Employee Evaluation</field>
<field name="max_response_limit">20</field>
@ -10,6 +11,7 @@
<field name="response_user">5</field>
</record>
</data>
<data>
<record id="survey_3" model="survey">
<field name="title">Employee Opinion</field>
@ -20,6 +22,7 @@
<field name="response_user">5</field>
</record>
</data>
<data>
<record id="survey_page_1" model="survey.page">
<field name="title">Employee Evaluation Form</field>
@ -27,6 +30,7 @@
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_page_2" model="survey.page">
<field name="title">Process</field>
@ -42,6 +46,7 @@
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_page_6" model="survey.page">
<field name="title">Employee Performance In Key Areas</field>
@ -81,8 +86,6 @@
</record>
</data>
<data>
<record id="survey_question_0" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -132,6 +135,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_3" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -156,6 +160,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_4" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -203,6 +208,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<!--record id="survey_question_7" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -227,6 +233,7 @@
<field eval="0" name="allow_comment"/>
</record-->
</data>
<data>
<record id="survey_question_8" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -304,8 +311,6 @@
</record>
</data>
<data>
<record id="survey_question_14" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -331,7 +336,6 @@
</record>
</data>
<data>
<record id="survey_question_17" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -356,6 +360,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_18" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -381,8 +386,6 @@
</record>
</data>
<data>
<record id="survey_question_23" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -436,6 +439,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_40" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -460,6 +464,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_41" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -502,7 +507,6 @@
<field name="type">descriptive_text</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field name="descriptive_text">* It is the joint responsibility of the employee and the supervisor (appraiser) to establish a feasible work plan for the coming year, including major employee responsibilities and corresponding benchmarks against which results will be evaluated.
* Critical or key elements of performance and professional development needs (if any), should also be noted at this time</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
@ -583,7 +587,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<!--data>
<record id="survey_question_42" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -727,6 +730,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_4" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -735,6 +739,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_5" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -743,6 +748,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_6" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -751,6 +757,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_7" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -759,6 +766,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_8" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -767,6 +775,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_9" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -775,6 +784,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_10" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -783,6 +793,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_11" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -791,6 +802,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_12" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -799,6 +811,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_13" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -807,6 +820,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_14" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -815,6 +829,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_15" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -823,6 +838,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_16" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -831,6 +847,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_17" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -839,6 +856,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_18" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -847,6 +865,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_19" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -855,6 +874,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_20" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -863,6 +883,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_21" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -871,6 +892,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_22" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -879,6 +901,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_23" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -887,6 +910,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_24" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -895,6 +919,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_25" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -903,6 +928,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_26" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -911,6 +937,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_27" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -919,6 +946,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_28" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -927,6 +955,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_29" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -935,6 +964,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_30" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -943,6 +973,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_31" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -951,6 +982,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_32" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -959,6 +991,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_33" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -967,6 +1000,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_34" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -975,6 +1009,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_35" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -983,6 +1018,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_36" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -991,6 +1027,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_37" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -999,6 +1036,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_38" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1007,6 +1045,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_39" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1015,6 +1054,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_40" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1023,6 +1063,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_41" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1031,6 +1072,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_42" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1039,6 +1081,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_43" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1056,6 +1099,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_1" model="survey.answer">
<field name="answer">Name</field>
@ -1064,6 +1108,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_2" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1072,6 +1117,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_3" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1080,6 +1126,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_4" model="survey.answer">
<field name="in_visible_answer_type">0</field>
@ -1089,6 +1136,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_5" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1097,6 +1145,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_6" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1105,6 +1154,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_7" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1113,6 +1163,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_8" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1121,6 +1172,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_9" model="survey.answer">
<field name="in_visible_answer_type">0</field>
@ -1130,6 +1182,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_10" model="survey.answer">
<field name="answer">Position Title</field>
@ -1138,6 +1191,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_11" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1146,6 +1200,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_12" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1154,6 +1209,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_13" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1162,6 +1218,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_14" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1170,6 +1227,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_15" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1178,6 +1236,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_16" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1187,6 +1246,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_17" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1195,6 +1255,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_18" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1203,6 +1264,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_19" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1211,6 +1273,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_20" model="survey.answer">
<field name="answer">Appraisal for Period</field>
@ -1219,6 +1282,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_21" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1227,6 +1291,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_22" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1235,6 +1300,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_23" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1243,6 +1309,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_24" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1251,6 +1318,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_25" model="survey.answer">
<field name="answer">Date of Review</field>
@ -1259,6 +1327,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_26" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1267,6 +1336,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_27" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1276,8 +1346,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<data>
<record id="survey_answer_31" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1287,7 +1355,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<data>
<record id="survey_answer_43" model="survey.answer">
<field name="answer">Appraiser</field>
@ -1296,6 +1363,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_44" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1304,6 +1372,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_45" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1312,6 +1381,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_46" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1320,6 +1390,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_47" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1328,6 +1399,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_48" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1336,6 +1408,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_49" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1344,6 +1417,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_50" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1352,6 +1426,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_51" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1360,6 +1435,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_52" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1377,6 +1453,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_68" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1385,6 +1462,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_69" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1393,6 +1471,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_70" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1401,6 +1480,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_71" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1409,6 +1489,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_72" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1417,6 +1498,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_73" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1425,6 +1507,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_74" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1433,6 +1516,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_75" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1441,6 +1525,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_76" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1449,6 +1534,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_77" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1457,6 +1543,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_78" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1483,6 +1570,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_9"/>
</record>
</data>
<data>
<record id="survey_tbl_column_heading_results0" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1491,6 +1579,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_9"/>
</record>
</data>
<data>
<record id="survey_tbl_column_heading_comments0" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1500,7 +1589,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<!-- <data noupdate="1">-->
<!-- <record id="survey_request_1" model="survey.request">-->
<!-- <field name="state">waiting_answer</field>-->
@ -1510,6 +1598,7 @@ Once the form had been filled, the employee send it to his supervisor.
<!-- <field name="date_deadline">2010-02-21</field>-->
<!-- </record>-->
<!-- </data>-->
<data noupdate="1">
<record id="hr_evaluation_plan_managersevaluationplan0" model="hr_evaluation.plan">
<field eval="1" name="active"/>
@ -1519,6 +1608,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="company_id" ref="base.main_company"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtosubordinates0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1534,6 +1624,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="wait"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtomanagers0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1549,6 +1640,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="wait"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtoemployee0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1564,6 +1656,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="wait"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_finalinterviewwithmanager0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1603,8 +1696,7 @@ Once the form had been filled, the employee send it to his supervisor.
<!-- </data>-->
<data>
<record forcecreate="True" id="ir_cron_scheduler_evaluation"
model="ir.cron">
<record forcecreate="True" id="ir_cron_scheduler_evaluation" model="ir.cron">
<field name="name">Run Employee Evaluation</field>
<field eval="True" name="active" />
<field name="user_id" ref="base.user_root" />

View File

@ -61,13 +61,10 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Evaluations" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="6"/>
<menuitem
name="Periodic Evaluations" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4"/>
<menuitem
parent="menu_eval_hr_config"
id="menu_open_view_hr_evaluation_plan_tree"
<menuitem name="Evaluations" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="6"/>
<menuitem name="Periodic Evaluations" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4"/>
<menuitem parent="menu_eval_hr_config" id="menu_open_view_hr_evaluation_plan_tree"
action="open_view_hr_evaluation_plan_tree"/>
<record model="ir.ui.view" id="view_hr_evaluation_plan_phase_form">
@ -185,30 +182,19 @@
<newline/>
<group col="6" colspan="4">
<field name="state"/>
<button name="button_plan_in_progress"
string="Start Evaluation"
states="draft"
type="object"
<button name="button_plan_in_progress" string="Start Evaluation" states="draft" type="object"
icon="gtk-execute"/>
<button name="button_final_validation"
string="Final Validation"
states="wait"
type="object"
<button name="button_final_validation" string="Final Validation" states="wait" type="object"
icon="gtk-execute"/>
<button name="button_done"
string="Done"
states="progress"
type="object"
<button name="button_done" string="Done" states="progress" type="object"
icon="gtk-jump-to"/>
<button name="button_cancel"
string="Cancel"
states="draft,wait,progress"
type="object"
<button name="button_cancel" string="Cancel" states="draft,wait,progress" type="object"
icon="gtk-cancel"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_tree">
<field name="name">hr_evaluation.evaluation.tree</field>
<field name="model">hr_evaluation.evaluation</field>
@ -225,6 +211,7 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_graph">
<field name="name">hr_evaluation.evaluation.graph</field>
<field name="model">hr_evaluation.evaluation</field>
@ -236,6 +223,7 @@
</graph>
</field>
</record>
<record id="hr_evaluation.evaluation_search" model="ir.ui.view">
<field name="name">hr_evaluation.evaluation_search</field>
<field name="model">hr_evaluation.evaluation</field>
@ -247,18 +235,13 @@
<filter icon="terp-check" string="In progress" domain="[('state','=','wait')]"/>
<filter icon="terp-dialog-close" string="Final Step" domain="[('state','=','progress')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-week" string="7 Days"
help="Evaluations to close within the next 7 days"
domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
/>
<filter icon="terp-go-week" string="7 Days" help="Evaluations to close within the next 7 days"
domain="[('date', '&gt;=', (datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" />
<filter icon="terp-gnome-cpu-frequency-applet+" string="Overpassed"
help="Evaluations that overpassed the deadline"
domain="[('date','&gt;=',(datetime.date.today()))]"
/>
help="Evaluations that overpassed the deadline" domain="[('date','&gt;=',(datetime.date.today()))]" />
<separator orientation="vertical"/>
<field name="employee_id" select="1"/>
<field name="plan_id" widget="selection" select="1"/>
<field name="employee_id" />
<field name="plan_id" widget="selection" />
</group>
<newline/>
<group expand='0' string='Group by...'>
@ -278,9 +261,8 @@
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
</record>
<menuitem
name="Evaluation" parent="menu_eval_hr"
id="menu_open_view_hr_evaluation_tree"
<menuitem name="Evaluation" parent="menu_eval_hr" id="menu_open_view_hr_evaluation_tree"
action="open_view_hr_evaluation_tree"/>
<record model="ir.ui.view" id="view_hr_evaluation_interview_form">
@ -293,10 +275,8 @@
<field name="survey_id"/>
<field name="evaluation_id"/>
<group col="2" colspan="2">
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel"
icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done"
icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
</group>
<field name="date_deadline"/>
<field name="response" readonly="1"/>
@ -327,10 +307,8 @@
<field name="user_id" string="Interviewer"/>
<field name="user_to_review_id"/>
<field name="response" readonly="1" invisible="True"/>
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel"
icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done"
icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0}" attrs="{'readonly':[('response','=',False)]}" />
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0}" attrs="{'readonly':[('response','=',False)]}" />
<field name="state"/>
</tree>
</field>
@ -369,17 +347,13 @@
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
</record>
<menuitem
name="Interview Requests" parent="menu_eval_hr"
id="menu_open_hr_evaluation_interview_requests"
<menuitem name="Interview Requests" parent="menu_eval_hr" id="menu_open_hr_evaluation_interview_requests"
action="action_hr_evaluation_interview_tree"/>
<menuitem name="Evaluation Reminders" parent="menu_eval_hr"
id="menu_eval_send_mail"
action="action_hr_evaluation_send_mail"
sequence="45"/>
<menuitem name="Evaluation Reminders" parent="menu_eval_hr" id="menu_eval_send_mail"
action="action_hr_evaluation_send_mail" sequence="45"/>
<!-- Evaluation Interviews Button on Employee Form -->
<act_window domain="[('user_to_review_id', '=', active_id)]" id="act_hr_employee_2_hr__evaluation_interview" name="Evaluation Interviews" res_model="hr.evaluation.interview" src_model="hr.employee"/>
</data>
</openerp>

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import hr_evaluation_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import tools
from osv import fields,osv
@ -75,9 +76,9 @@ class hr_evaluation_report(osv.osv):
s.state
from
hr_evaluation_interview l
left join
LEFT JOIN
hr_evaluation_evaluation s on (s.id=l.evaluation_id)
group by
GROUP BY
s.create_date,
date_trunc('day',s.create_date),
to_char(s.create_date, 'YYYY-MM-DD'),
@ -92,5 +93,8 @@ class hr_evaluation_report(osv.osv):
s.plan_id
)
""")
hr_evaluation_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_evaluation_report_tree" model="ir.ui.view">
<field name="name">hr.evaluation.report.tree</field>
<field name="model">hr.evaluation.report</field>
@ -43,33 +44,18 @@
<search string="Evaluations Analysis">
<group>
<filter icon="terp-go-year" string="365 Days"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in last 365 days"/>
<filter icon="terp-go-month" string="30 Days"
name="month"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in last 30 days"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Tasks during last 7 days"/>
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date', '&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 365 days"/>
<filter icon="terp-go-month" string="30 Days" name="month" domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 30 days"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Tasks during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-document-new"
domain="[('state','=','draft')]"
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]"
help = "Draft Evaluations"/>
<filter string="Plan In Progress"
icon="terp-camera_test"
domain="[('state', '=' ,'wait')]"
<filter string="Plan In Progress" icon="terp-camera_test" domain="[('state', '=' ,'wait')]"
help = "In progress Evaluations"/>
<filter string="Final Validation"
icon="terp-check"
domain="[('state','=','progress')]"
<filter string="Final Validation" icon="terp-check" domain="[('state','=','progress')]"
help = "Final Validation Evaluations"/>
<filter icon="terp-dialog-close"
string="Done"
domain="[('state','=','done')]"/>
<filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="employee_id" widget="selection"/>
<field name="plan_id" widget="selection"/>

View File

@ -21,5 +21,4 @@
import hr_evaluation_mail
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,7 +28,7 @@ class hr_evaluation_reminder(osv.osv_memory):
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluations', required=True)
}
def send_mail(self, cr, uid, ids, context={}):
def send_mail(self, cr, uid, ids, context=None):
hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation')
evaluation_data = self.read(cr, uid, ids, context=context)[0]
for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids:

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_evaluation_send_mail" model="ir.ui.view">
<field name="name">hr.evaluation.send.mail</field>
<field name="model">hr.evaluation.reminder</field>

View File

@ -52,7 +52,8 @@
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
],
'demo_xml': ['hr_expense_demo.xml',
'demo_xml': [
'hr_expense_demo.xml',
# 'hr.expense.expense.csv'
],
'test': ['test/test_hr_expense.yml'],

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_my_expense" model="ir.actions.act_window">
<field name="name">My Expenses</field>
<field name="res_model">hr.expense.expense</field>
@ -20,5 +21,6 @@
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -37,12 +37,12 @@ class hr_expense_expense(osv.osv):
default.update({'invoice_id': False, 'date_confirm': False, 'date_valid': False, 'user_valid': False})
return super(hr_expense_expense, self).copy(cr, uid, id, default, context)
def _amount(self, cr, uid, ids, field_name, arg, context):
def _amount(self, cr, uid, ids, field_name, arg, context=None):
cr.execute("SELECT s.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_expense s LEFT OUTER JOIN hr_expense_line l ON (s.id=l.expense_id) WHERE s.id IN %s GROUP BY s.id ", (tuple(ids),))
res = dict(cr.fetchall())
return res
def _get_currency(self, cr, uid, context):
def _get_currency(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, [uid])[0]
if user.company_id:
return user.company_id.currency_id.id
@ -158,18 +158,17 @@ class hr_expense_expense(osv.osv):
'fiscal_position': exp.employee_id.address_id.partner_id.property_account_position.id
}
if payment_term_id:
to_update = invoice_obj.onchange_payment_term_date_invoice(cr, uid, [],
payment_term_id, None)
to_update = invoice_obj.onchange_payment_term_date_invoice(cr, uid, [], payment_term_id, None)
if to_update:
inv.update(to_update['value'])
if exp.journal_id:
inv['journal_id']=exp.journal_id.id
inv_id = invoice_obj.create(cr, uid, inv, {'type': 'in_invoice'})
invoice_obj.button_compute(cr, uid, [inv_id], {'type':'in_invoice'},
set_total=True)
invoice_obj.button_compute(cr, uid, [inv_id], {'type': 'in_invoice'}, set_total=True)
self.write(cr, uid, [exp.id], {'invoice_id': inv_id, 'state': 'invoiced'})
res = inv_id
return res
hr_expense_expense()
class product_product(osv.osv):
@ -184,7 +183,7 @@ class hr_expense_line(osv.osv):
_name = "hr.expense.line"
_description = "Expense Line"
def _amount(self, cr, uid, ids, field_name, arg, context):
def _amount(self, cr, uid, ids, field_name, arg, context=None):
if not len(ids):
return {}
cr.execute("SELECT l.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_line l WHERE id IN %s GROUP BY l.id ",(tuple(ids),))
@ -206,8 +205,8 @@ class hr_expense_line(osv.osv):
'sequence' : fields.integer('Sequence', help="Gives the sequence order when displaying a list of expense lines."),
}
_defaults = {
'unit_quantity': lambda *a: 1,
'date_value' : lambda *a: time.strftime('%Y-%m-%d'),
'unit_quantity': 1,
'date_value': time.strftime('%Y-%m-%d'),
}
_order = "sequence"
@ -218,13 +217,11 @@ class hr_expense_line(osv.osv):
if product_id:
product=self.pool.get('product.product').browse(cr, uid, product_id, context=context)
v['name']=product.name
# Compute based on pricetype of employee company
pricetype_id = self.pool.get('hr.employee').browse(cr, uid, employee_id).user_id.company_id.property_valuation_price_type.id
context['currency_id']=self.pool.get('hr.employee').browse(cr, uid, employee_id).user_id.company_id.currency_id.id
pricetype=self.pool.get('product.price.type').browse(cr, uid, pricetype_id)
amount_unit=product.price_get(pricetype.field, context)[product.id]
v['unit_amount']=amount_unit
if not uom_id:
v['uom_id']=product.uom_id.id

View File

@ -58,6 +58,7 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_basicpcserverforseagate0" model="hr.expense.line">
<field name="name">Basic PC - Server for Seagate</field>
<field name="date_value">2010-05-03</field>
@ -68,7 +69,9 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
</data>
<data noupdate="1">
<record id="hr_expense_expense_septemberexpenses1" model="hr.expense.expense">
<field name="currency_id" ref="base.EUR"/>
@ -79,6 +82,7 @@
<field name="date">2010-04-20</field>
<field name="state">draft</field>
</record>
<record id="hr_expense_line_hotelexpensesthymbra0" model="hr.expense.line">
<field name="name">Hotel Expenses - Thymbra</field>
<field name="date_value">2010-05-03</field>
@ -89,6 +93,7 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="5.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_car_travel" model="hr.expense.line">
<field name="name">Bruxelles - Paris</field>
<field name="date_value">2010-05-03</field>
@ -100,6 +105,5 @@
<field eval="622.0" name="unit_quantity"/>
</record>
</data>
</openerp>

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="hr_expenses" model="hr.expense.expense" name="hr.expense" rml="hr_expense/report/expense.rml" string="HR expenses"/>
</data>
</openerp>

View File

@ -1,15 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="seq_type_hr_expense_invoice" model="ir.sequence.type">
<field name="name">Expense invoice</field>
<field name="code">hr.expense.invoice</field>
</record>
<record id="seq_hr_expense_invoice" model="ir.sequence">
<field name="name">Expense invoice</field>
<field name="code">hr.expense.invoice</field>
<field name="prefix">EXP/</field>
<field name="padding">3</field>
</record>
</data>
</openerp>

View File

@ -81,8 +81,8 @@
<form string="Expense Lines">
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)"/>
<field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)" widget="selection"/>
<field name="name" select="1"/>
<field name="date_value" select="1"/>
<field name="name" />
<field name="date_value" />
<field name="unit_quantity"/>
<field name="unit_amount"/>
<field name="ref"/>
@ -126,28 +126,17 @@
<field name="arch" type="xml">
<search string="Expense">
<group>
<filter
icon="terp-document-new"
domain="[('state','=','draft')]"
string="Draft"
help="Draft Expense"/>
<filter icon="terp-document-new" domain="[('state','=','draft')]" string="Draft" help="Draft Expense"/>
<separator orientation="vertical"/>
<filter
icon="terp-gtk-go-back-rtl"
domain="[('state','=','confirm')]"
string="To Validate"
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','confirm')]" string="To Validate"
help="Confirmed Expense"/>
<filter
icon="terp-gtk-go-back-rtl"
domain="[('state','=','accepted')]"
string="To Pay"
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','accepted')]" string="To Pay"
help="Expenses to Invoice"/>
<separator orientation="vertical"/>
<field name="name" select='1'/>
<field name="date" select='1'/>
<field name="user_id" select="1" string="User">
<filter icon="terp-personal+"
domain="[('department_id','=',context.get('department_id',False))]"
<field name="user_id" string="User">
<filter icon="terp-personal+" domain="[('department_id','=',context.get('department_id',False))]"
string="Expenses of My Department"/>
</field>
<field name="department_id" widget="selection" groups="base.group_extended"/>
@ -171,11 +160,8 @@
<field name="search_view_id" ref="view_hr_expense_filter"/>
</record>
<menuitem id="next_id_49" name="Expenses" sequence="4"
parent="hr.menu_hr_root"/>
<menuitem action="expense_all" id="menu_expense_all" name="Expenses"
parent="next_id_49" groups="hr.group_hr_manager"/>
<menuitem id="next_id_49" name="Expenses" sequence="4" parent="hr.menu_hr_root"/>
<menuitem action="expense_all" id="menu_expense_all" name="Expenses" parent="next_id_49" groups="hr.group_hr_manager"/>
<record id="view_product_hr_expense_form" model="ir.ui.view">
<field name="name">product.product.expense.form</field>

View File

@ -27,18 +27,21 @@
<field name="kind">function</field>
<field name="action">write({'state': 'draft'})</field>
</record>
<record id="act_confirm" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
<field name="name">confirm</field>
<field name="kind">function</field>
<field name="action">expense_confirm()</field>
</record>
<record id="act_accepted" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
<field name="name">accepted</field>
<field name="kind">function</field>
<field name="action">expense_accept()</field>
</record>
<record id="act_paid" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
<field name="name">paid</field>
@ -46,6 +49,7 @@
<field name="action">expense_paid()</field>
<field name="flow_stop">True</field>
</record>
<record id="act_refused" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
<field name="name">refused</field>
@ -53,6 +57,7 @@
<field name="action">expense_canceled()</field>
<!-- <field name="flow_stop">True</field>-->
</record>
<record id="act_invoice" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
<field name="name">invoice</field>
@ -66,24 +71,28 @@
<field name="act_to" ref="act_confirm"/>
<field name="signal">confirm</field>
</record>
<record id="t2" model="workflow.transition">
<field name="act_from" ref="act_confirm"/>
<field name="act_to" ref="act_accepted"/>
<field name="signal">validate</field>
<field name="role_id" ref="HR"/>
</record>
<!--record model="workflow.transition" id="t3">
<field name="act_from" ref="act_accepted" />
<field name="act_to" ref="act_paid" />
<field name="signal">paid</field>
<field name="role_id" ref="HR"/>
</record-->
<record id="t4" model="workflow.transition">
<field name="act_from" ref="act_confirm"/>
<field name="act_to" ref="act_refused"/>
<field name="signal">refuse</field>
<field name="role_id" ref="HR"/>
</record>
<record id="t5" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_refused"/>
@ -96,33 +105,39 @@
<field name="signal">refuse</field>
<field name="role_id" ref="HR"/>
</record>
<record id="t7" model="workflow.transition">
<field name="act_from" ref="act_confirm"/>
<field name="act_to" ref="act_draft"/>
<field name="signal">draft</field>
<field name="role_id" ref="HR"/>
</record>
<record id="t8" model="workflow.transition">
<field name="act_from" ref="act_accepted"/>
<field name="act_to" ref="act_invoice"/>
<field name="signal">invoice</field>
<field name="role_id" ref="HR_INV"/>
</record>
<record id="t9" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
<field name="act_to" ref="act_paid"/>
<field name="signal">subflow.paid</field>
</record>
<record id="t10" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
<field name="act_to" ref="act_refused"/>
<field name="signal">subflow.cancel</field>
</record>
<record id="t11" model="workflow.transition">
<field name="act_from" ref="act_refused"/>
<field name="act_to" ref="act_draft"/>
<field name="signal">draft</field>
<field name="role_id" ref="HR"/>
</record>
</data>
</openerp>

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import expense
import hr_expense_report

View File

@ -24,11 +24,10 @@ from report import report_sxw
import datetime
class expense(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(expense, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
})
self.localcontext.update({'time': time, })
report_sxw.report_sxw('report.hr.expense', 'hr.expense.expense', 'addons/hr_expense/report/expense.rml',parser=expense)

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_expense_report_tree" model="ir.ui.view">
<field name="name">hr.expense.report.tree</field>
<field name="model">hr.expense.report</field>
@ -58,27 +59,15 @@
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last month"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last 7 days"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Expenses during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-document-new"
domain="[('state','=','draft')]"
help = "Draft Expenses"/>
<filter string="Waiting"
icon="terp-gtk-media-pause"
domain="[('state', '=' ,'confirm')]"
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft Expenses"/>
<filter string="Waiting" icon="terp-gtk-media-pause" domain="[('state', '=' ,'confirm')]"
help = "Confirm Expenses"/>
<filter string="Accepted"
icon="terp-camera_test"
domain="[('state','=','accepted')]"
<filter string="Accepted" icon="terp-camera_test" domain="[('state','=','accepted')]"
help = "Accepted Expenses"/>
<filter string="Cancelled"
icon="terp-dialog-close"
domain="[('state','=','cancelled')]"
<filter string="Cancelled" icon="terp-dialog-close" domain="[('state','=','cancelled')]"
help = "Cancelled Expenses"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
@ -118,7 +107,6 @@
<field name="date"/>
<field name="date_confirm"/>
<field name="date_valid"/>
</group>
</search>
</field>

View File

@ -22,5 +22,6 @@
import hr_holidays
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,6 +21,7 @@
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_id" ref="hr_holidays.view_hr_holidays_remaining_leaves_user_graph"/>
</record>
<record id="board_hr_holidays_form" model="ir.ui.view">
<field name="name">board.hr.holidays.form</field>
<field name="model">board.board</field>

View File

@ -8,59 +8,69 @@
<field name="date_to">2008-01-01 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Easter Monday</field>
<field name="date_from">2008-03-24 08:00</field>
<field name="date_to">2008-03-24 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Labour Day</field>
<field name="date_from">2008-05-01 08:00</field>
<field name="date_to">2008-05-01 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Ascension</field>
<field name="date_from">2008-05-02 08:00</field>
<field name="date_to">2008-05-02 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Pentecost Monday</field>
<field name="date_from">2008-05-12 08:00</field>
<field name="date_to">2008-05-12 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">National Day</field>
<field name="date_from">2008-07-21 08:00</field>
<field name="date_to">2008-07-21 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Assumption Day</field>
<field name="date_from">2008-08-15 08:00</field>
<field name="date_to">2008-08-15 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">All Saints</field>
<field name="date_from">2008-11-01 08:00</field>
<field name="date_to">2008-11-01 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Armistice</field>
<field name="date_from">2008-11-11 08:00</field>
<field name="date_to">2008-11-11 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
<record model="hr.holidays">
<field name="name">Christmas</field>
<field name="date_from">2008-12-25 08:00</field>
<field name="date_to">2008-12-25 18:00</field>
<field name="holiday_status" ref="hr.jf" />
</record>
</data>
</openerp>

View File

@ -20,6 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import datetime
@ -69,6 +70,7 @@ class hr_holidays_status(osv.osv):
return_false = False
employee_id = False
res = {}
if context and context.has_key('employee_id'):
if not context['employee_id']:
return_false = True
@ -249,7 +251,7 @@ class hr_holidays(osv.osv):
def onchange_date_to(self, cr, uid, ids, date_from, date_to):
return self.onchange_date_from(cr, uid, ids, date_to, date_from)
def onchange_sec_id(self, cr, uid, ids, status, context={}):
def onchange_sec_id(self, cr, uid, ids, status, context=None):
warning = {}
if status:
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, [status])[0]
@ -345,17 +347,11 @@ class hr_holidays(osv.osv):
if record.holiday_type == 'employee' and record.employee_id:
user_id = record.employee_id.user_id and record.employee_id.user_id.id or uid
self.write(cr, uid, [record.id], {
'state':'confirm',
'number_of_days': nb,
'user_id': user_id
})
self.write(cr, uid, [record.id], {'state':'confirm', 'number_of_days': nb, 'user_id': user_id })
return True
def holidays_refuse(self, cr, uid, ids, *args):
vals = {
'state':'refuse',
}
vals = {'state': 'refuse'}
ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
if ids2:
vals['manager_id'] = ids2[0]
@ -364,16 +360,12 @@ class hr_holidays(osv.osv):
def holidays_cancel(self, cr, uid, ids, *args):
self._update_user_holidays(cr, uid, ids)
self.write(cr, uid, ids, {
'state':'cancel'
})
self.write(cr, uid, ids, {'state': 'cancel'})
self._remove_resouce_leave(cr, uid, ids)
return True
def holidays_draft(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'draft'
})
self.write(cr, uid, ids, {'state': 'draft'})
return True
def check_holidays(self, cr, uid, ids):
@ -415,7 +407,7 @@ class hr_holidays(osv.osv):
user_id = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
if user_id:
vals['user_id'] = user_id[0]
holiday_ids.append(self.create(cr, uid, vals, context={}))
holiday_ids.append(self.create(cr, uid, vals, context=None))
self.holidays_confirm(cr, uid, holiday_ids)
self.holidays_validate(cr, uid, holiday_ids)

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<report id="report_holidays_summary"
string="Summary Of Leaves"
model="hr.holidays"

View File

@ -1,6 +1,7 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record id="view_hr_holidays_filter" model="ir.ui.view">
<field name="name">hr.holidays.filter</field>
<field name="model">hr.holidays</field>
@ -16,8 +17,7 @@
<field name="user_id"/>
<field name="department_id" widget="selection">
<filter icon="terp-personal+" help="My Department Holidays"
domain="[('department_id.manager_id','=',uid)]"
/>
domain="[('department_id.manager_id','=',uid)]" />
</field>
<field name="holiday_status_id" widget="selection"/>
</group>
@ -44,21 +44,21 @@
<field name="arch" type="xml">
<form string="Leave Request">
<group col="8" colspan="4">
<field name="name" select="1"/>
<field name="name" />
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130"/>
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
<field name="category_id" select="1" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
</group>
<group attrs="{'invisible':[('holiday_type','=','category')]}">
<field name="employee_id" select="1" attrs="{'required':[('holiday_type','=','employee')]}"/>
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}"/>
</group>
</group>
<notebook colspan="4">
<page string="General">
<field name="holiday_status_id" select="1" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
<field name="department_id"/>
<field name="date_from" select="1" on_change="onchange_date_from(date_to, date_from)" required="1"/>
<field name="date_to" select="1" on_change="onchange_date_to(date_from, date_to)" required="1"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
<field name="date_to" on_change="onchange_date_to(date_from, date_to)" required="1"/>
<field name="number_of_days_temp"/>
<newline/>
<field name="manager_id"/>
@ -66,7 +66,7 @@
<separator string="Notes" colspan="4"/>
<field name="notes" nolabel="1" colspan="4"/>
<newline/>
<field name="state" select="1" colspan="2"/>
<field name="state" colspan="2"/>
<group colspan="2">
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
<button string="Validate" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
@ -89,15 +89,15 @@
<field name="arch" type="xml">
<form string="Allocation Request">
<group col="4" colspan="4">
<field name="name" select="1"/>
<field name="holiday_status_id" select="1"/>
<field name="name" />
<field name="holiday_status_id" />
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Type"/>
<group col="2" colspan="2">
<group attrs="{'invisible':[('holiday_type','=','category')]}">
<field name="employee_id" select="1" attrs="{'required':[('holiday_type','=','employee')]}"/>
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}"/>
</group>
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
<field name="category_id" select="1" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
</group>
</group>
</group>
@ -110,7 +110,7 @@
<separator string="Notes" colspan="4"/>
<field name="notes" nolabel="1" colspan="4" />
<newline/>
<field name="state" select="1" colspan="2"/>
<field name="state" colspan="2"/>
<group colspan="2">
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
<button string="Validate" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
@ -130,8 +130,7 @@
<field name="model">hr.holidays</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Leaves"
colors="red:state == 'refuse';grey:state == 'cancel'">
<tree string="Leaves" colors="red:state == 'refuse';grey:state == 'cancel'">
<field name="employee_id"/>
<field name="department_id"/>
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
@ -151,22 +150,22 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Leaves Management">
<field name="name" select="1"/>
<field name="holiday_status_id" select="1"/>
<field name="name" />
<field name="holiday_status_id" />
<!-- <field name="holiday_type"/>
<field name="category_id" select="1" required="1"/>
--> <field name="employee_id" select="1" />
<field name="category_id" required="1"/>
--> <field name="employee_id" />
<!--<field name="department_id"/>-->
<field name="type"/>
<field name="date_from" select="1" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="date_to" select="1" on_change="onchange_date_to(date_from, date_to)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="date_to" on_change="onchange_date_to(date_from, date_to)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
<field name="number_of_days_temp"/>
<notebook colspan="4">
<page string="General">
<field name="manager_id"/>
<field name="notes" colspan="4"/>
<newline/>
<field name="state" select="1" colspan="2"/>
<field name="state" colspan="2"/>
<group colspan="2">
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
<button string="Validate" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
@ -207,8 +206,7 @@
<field name="model">hr.holidays</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Leaves"
colors="red:state == 'refuse';grey:state == 'cancel'">
<tree string="Leaves" colors="red:state == 'refuse';grey:state == 'cancel'">
<field name="employee_id"/>
<field name="department_id"/>
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
@ -271,10 +269,7 @@
<field name="act_window_id" ref="open_ask_holidays"/>
</record>
<menuitem
name="Leave Requests"
parent="menu_open_ask_holidays"
id="menu_open_ask_holidays_new"
<menuitem name="Leave Requests" parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new"
action="open_ask_holidays"/>
<record model="ir.actions.act_window" id="open_allocation_holidays">
@ -301,10 +296,7 @@
<field name="act_window_id" ref="open_allocation_holidays"/>
</record>
<menuitem
name="Allocation Requests"
parent="menu_open_ask_holidays"
id="menu_open_allocation_holidays"
<menuitem name="Allocation Requests" parent="menu_open_ask_holidays" id="menu_open_allocation_holidays"
action="open_allocation_holidays"/>
<record model="ir.actions.act_window" id="open_company_allocation">
@ -331,15 +323,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Leave Type">
<field colspan="4" name="name" select="1"/>
<field colspan="4" name="name" />
<field name="limit"/>
<field name="active"/>
<field name="categ_id" select="1" widget="selection"/>
<field name="categ_id" widget="selection"/>
<field name="color_name"/>
<field name="double_validation" />
</form>
</field>
</record>
<record model="ir.ui.view" id="view_holiday_status_tree">
<field name="name">hr.holidays.status.tree</field>
<field name="model">hr.holidays.status</field>
@ -352,6 +345,7 @@
</tree>
</field>
</record>
<record id="open_view_holiday_status" model="ir.actions.act_window">
<field name="name">Leave Type</field>
<field name="type">ir.actions.act_window</field>

View File

@ -6,6 +6,7 @@
name="Reporting"
parent="hr.menu_hr_root"
sequence="10" />
<menuitem
id="menu_hr_reporting_holidays"
name="Holidays"

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
import tools
@ -43,8 +44,8 @@ class available_holidays_report(osv.osv):
def init(self, cr):
tools.drop_view_if_exists(cr, 'available_holidays_report')
cr.execute("""
create or replace view available_holidays_report as (
select
CREATE or REPLACE view available_holidays_report as (
SELECT
min(h.id) as id,
date_trunc('day',h.create_date) as date,
to_char(s.create_date, 'YYYY') as year,
@ -67,15 +68,16 @@ class available_holidays_report(osv.osv):
and employee_id=h.employee_id
and holiday_status_id=h.holiday_status_id
and state='validate') as max_leave
from hr_holidays h
left join hr_holidays_status s on (s.id = h.holiday_status_id)
where h.state='validate'
FROM hr_holidays h
LEFT JOIN hr_holidays_status s on (s.id = h.holiday_status_id)
WHERE h.state='validate'
and s.active <> 'f'
group by h.holiday_status_id, h.employee_id,
GROUP BY h.holiday_status_id, h.employee_id,
date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'), to_char(s.create_date, 'YYYY-MM-DD'), h.user_id,h.state, h.category_id, h.department_id
)""")
available_holidays_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -48,32 +48,22 @@
<field name="arch" type="xml">
<search string="Leaves">
<group>
<filter icon="terp-personal" string="Employee"
domain="[('category_id', '=', False)]"
<filter icon="terp-personal" string="Employee" domain="[('category_id', '=', False)]"
help="Leaves by empolyee"/>
<filter icon="terp-stock_symbol-selection" string="Category"
domain="[('employee_id', '=', False)]"
help="Leaves by category"/>
domain="[('employee_id', '=', False)]" help="Leaves by category"/>
<separator orientation="vertical"/>
<filter icon="terp-go-year" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this year"/>
<filter icon="terp-go-month" string="This Month"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this month"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Leaves during last 7 days"/>
<filter icon="terp-go-month" string="This Month" name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]" help="Leaves in this month"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Leaves during last 7 days"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-personal"
string="My Leaves"
domain="[('user_id','=',uid)]"/>
<filter icon="terp-personal" string="My Leaves" domain="[('user_id','=',uid)]"/>
</field>
</group>
<newline/>
@ -96,8 +86,6 @@
</field>
</record>
<record id="action_hr_available_holidays_report" model="ir.actions.act_window">
<field name="name">Available Holidays</field>
<field name="res_model">available.holidays.report</field>
@ -114,7 +102,6 @@
<field name="act_window_id" ref="action_hr_available_holidays_report"/>
</record>
<record model="ir.actions.act_window.view" id="action_hr_available_holidays_report_graph">
<field name="sequence" eval="2"/>
<field name="view_mode">graph</field>
@ -122,10 +109,8 @@
<field name="act_window_id" ref="action_hr_available_holidays_report"/>
</record>
<menuitem name="Available Holidays" id="menu_hr_available_holidays_report_tree" action="action_hr_available_holidays_report" parent="menu_hr_reporting_holidays"/>
</data>
</openerp>

View File

@ -261,5 +261,6 @@ class report_custom(report_rml):
return xml
report_custom('report.holidays.summary', 'hr.holidays', '', 'addons/hr_holidays/report/holidays_summary.xsl')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import tools
from osv import fields,osv
@ -70,8 +71,8 @@ class hr_holidays_report(osv.osv):
s.state
from
hr_holidays s
where type='remove'
group by
WHERE type='remove'
GROUP BY
s.create_date,s.state,s.date_from,s.date_to,
s.employee_id,s.user_id,s.holiday_status_id,
s.department_id, s.category_id
@ -89,26 +90,26 @@ class hr_holidays_remaining_leaves_user(osv.osv):
'no_of_leaves': fields.integer('Remaining leaves'),
'user_id': fields.many2one('res.users', 'User'),
'leave_type': fields.char('Leave Type', size=64),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_holidays_remaining_leaves_user')
cr.execute("""
create or replace view hr_holidays_remaining_leaves_user as (
select
CREATE or REPLACE view hr_holidays_remaining_leaves_user as (
SELECT
min(hrs.id) as id,
rr.name as name,
sum(hrs.number_of_days) as no_of_leaves,
rr.user_id as user_id,
hhs.name as leave_type
from
FROM
hr_holidays as hrs, hr_employee as hre,
resource_resource as rr,hr_holidays_status as hhs
where
WHERE
hrs.employee_id = hre.id and
hre.resource_id = rr.id and
hhs.id = hrs.holiday_status_id
group by
GROUP BY
rr.name,rr.user_id,hhs.name
)
""")

View File

@ -45,37 +45,23 @@
<field name="arch" type="xml">
<search string="Leaves">
<group>
<filter icon="terp-personal" string="Employee"
domain="[('category_id', '=', False)]"
<filter icon="terp-personal" string="Employee" domain="[('category_id', '=', False)]"
help="Leaves by empolyee"/>
<filter icon="terp-stock_symbol-selection" string="Category"
domain="[('employee_id', '=', False)]"
<filter icon="terp-stock_symbol-selection" string="Category" domain="[('employee_id', '=', False)]"
help="Leaves by category"/>
<separator orientation="vertical"/>
<filter icon="terp-go-year" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this year"/>
<filter icon="terp-go-month" string="This Month"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this month"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Leaves during last 7 days"/>
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Leaves in this year"/>
<filter icon="terp-go-month" string="This Month" name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]" help="Leaves in this month"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Leaves during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-document-new"
domain="[('state','=','draft')]"
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]"
help = "Draft Leaves"/>
<filter string="Waiting Validation"
icon="terp-gtk-media-pause"
domain="[('state', '=' ,'confirm')]"
<filter string="Waiting Validation" icon="terp-gtk-media-pause" domain="[('state', '=' ,'confirm')]"
help = "In progress Leaves"/>
<filter string="Validated"
icon="terp-camera_test"
domain="[('state','=','validate')]"
<filter string="Validated" icon="terp-camera_test" domain="[('state','=','validate')]"
help = "Pending Leaves"/>
<separator orientation="vertical"/>
<field name="employee_id" widget="selection"/>
@ -96,18 +82,14 @@
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-gtk-stop"
string="Refused"
name="done"
<filter icon="terp-gtk-stop" string="Refused" name="done"
domain="[('state','=','refuse')]"/>
<separator orientation="vertical"/>
<field name="date_from"/>
<separator orientation="vertical"/>
<field name="holiday_status_id" widget="selection"/>
<newline/>
<filter icon="terp-gtk-stop"
string="Cancelled"
domain="[('state','=','cancel')]"/>
<filter icon="terp-gtk-stop" string="Cancelled" domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<field name="date_to"/>
<separator orientation="vertical"/>

View File

@ -55,4 +55,5 @@ class hr_holidays_summary_dept(osv.osv_memory):
}
hr_holidays_summary_dept()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: