diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py
index d4778237420..29e61ba5599 100755
--- a/addons/hr/__openerp__.py
+++ b/addons/hr/__openerp__.py
@@ -21,11 +21,11 @@
{
- "name" : "Human Resources",
- "version" : "1.1",
- "author" : "Tiny",
- "category" : "Generic Modules/Human Resources",
- "website" : "http://www.openerp.com",
+ "name": "Human Resources",
+ "version": "1.1",
+ "author": "Tiny",
+ "category": "Generic Modules/Human Resources",
+ "website": "http://www.openerp.com",
"description": """
Module for human resource management. You can manage:
* Employees and hierarchies : You can define your employee with User and display hierarchies
@@ -45,10 +45,11 @@
'hr_installer.xml',
'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,
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index b5db01ac512..372b5214f6f 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -27,9 +27,8 @@ 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),
+ 'name': fields.char("Category", size=64, required=True),
'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True),
'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories')
}
@@ -37,7 +36,7 @@ class hr_employee_category(osv.osv):
def _check_recursion(self, cr, uid, ids):
level = 100
while len(ids):
- cr.execute('select distinct parent_id from hr_employee_category where id IN %s',(tuple(ids),))
+ cr.execute('select distinct parent_id from hr_employee_category where id IN %s', (tuple(ids), ))
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
if not level:
return False
@@ -54,13 +53,14 @@ class hr_employee_marital_status(osv.osv):
_name = "hr.employee.marital.status"
_description = "Employee Marital Status"
_columns = {
- 'name' : fields.char('Marital Status', size=30, required=True),
- 'description' : fields.text('Status Description'),
+ 'name': fields.char('Marital Status', size=30, required=True),
+ 'description': fields.text('Status Description'),
}
hr_employee_marital_status()
class hr_job(osv.osv):
- def _no_of_employee(self, cr, uid, ids, name,args,context=None):
+
+ def _no_of_employee(self, cr, uid, ids, name, args, context=None):
res = {}
for emp in self.browse(cr, uid, ids):
res[emp.id] = len(emp.employee_ids or [])
@@ -70,19 +70,19 @@ class hr_job(osv.osv):
_description = "Job Description"
_columns = {
'name': fields.char('Job Name', size=128, required=True, select=True),
- 'expected_employees':fields.integer('Expected Employees', help='Required number of Employees'),
+ 'expected_employees': fields.integer('Expected Employees', help='Required number of Employees'),
'no_of_employee': fields.function(_no_of_employee, method=True, string='No of Employees', type='integer', help='Number of Employees selected'),
- 'employee_ids':fields.one2many('hr.employee', 'job_id','Employees'),
+ 'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'),
'description': fields.text('Job Description'),
- 'requirements':fields.text('Requirements'),
- 'department_id':fields.many2one('hr.department','Department'),
+ 'requirements': fields.text('Requirements'),
+ 'department_id': fields.many2one('hr.department', 'Department'),
'company_id': fields.many2one('res.company', 'Company'),
- 'state': fields.selection([('open','Open'),('old','Old'),('recruit','In Recruitement')], 'State', required=True),
+ '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()
@@ -90,17 +90,17 @@ hr_job()
class hr_employee(osv.osv):
_name = "hr.employee"
_description = "Employee"
- _inherits = {'resource.resource':"resource_id"}
+ _inherits = {'resource.resource': "resource_id"}
_columns = {
- 'country_id' : fields.many2one('res.country', 'Nationality'),
- 'birthday' : fields.date("Birthday"),
+ 'country_id': fields.many2one('res.country', 'Nationality'),
+ 'birthday': fields.date("Birthday"),
'ssnid': fields.char('SSN No', size=32, help='Social Security Number'),
'sinid': fields.char('SIN No', size=32),
'otherid': fields.char('Other ID', size=32),
- 'gender': fields.selection([('male','Male'),('female','Female')], 'Gender'),
+ 'gender': fields.selection([('male', 'Male'),('female', 'Female')], 'Gender'),
'marital': fields.many2one('hr.employee.marital.status', 'Marital Status'),
'bank_account': fields.char('Bank Account', size=56),
- 'partner_id' : fields.related('company_id', 'partner_id', type='many2one', relation='res.partner', readonly=True),
+ 'partner_id': fields.related('company_id', 'partner_id', type='many2one', relation='res.partner', readonly=True),
'department_id':fields.many2one('hr.department','Department'),
'address_id': fields.many2one('res.partner.address', 'Working Address'),
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),
@@ -109,8 +109,8 @@ class hr_employee(osv.osv):
'work_location': fields.char('Office Location', size=32),
'notes': fields.text('Notes'),
'parent_id': fields.many2one('hr.employee', 'Manager', select=True),
- 'category_id' : fields.many2one('hr.employee.category', 'Category'),
- 'child_ids': fields.one2many('hr.employee', 'parent_id','Subordinates'),
+ 'category_id': fields.many2one('hr.employee.category', 'Category'),
+ 'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'),
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade'),
'coach_id': fields.many2one('res.users', 'Coach'),
'job_id': fields.many2one('hr.job', 'Job'),
@@ -123,7 +123,7 @@ class hr_employee(osv.osv):
'rb') .read().encode('base64')
_defaults = {
- 'active' : 1,
+ 'active': 1,
'photo': _get_photo,
}
diff --git a/addons/hr/hr_data.xml b/addons/hr/hr_data.xml
index 7125afb17d4..f76d1457aa1 100644
--- a/addons/hr/hr_data.xml
+++ b/addons/hr/hr_data.xml
@@ -1,6 +1,7 @@
+
Single
@@ -14,5 +15,6 @@
Widower
+
diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py
index 9e190a2b0f7..d1e13e2f6ec 100644
--- a/addons/hr/hr_department.py
+++ b/addons/hr/hr_department.py
@@ -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={}):
- mids = self.search(cr, uid, [('manager_id','=',uid)])
+
+ _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)])
@@ -137,10 +146,9 @@ class res_users(osv.osv):
data_dept = obj_dept.read(cr, uid, ids_dept, ['member_ids'])
childs = map(lambda x: x['member_ids'], data_dept)
childs = tools.flatten(childs)
- childs = obj_user.search(cr, uid, [('id','in',childs),('active','=',True)])
+ 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':
@@ -161,9 +169,11 @@ class res_users(osv.osv):
return [('id', 'in', child_ids.get(uid,[]))]
_columns = {
- 'parent_id': fields.function(_parent_compute, relation='res.users',fnct_search=_parent_search, method=True, string="Managers", type='many2many'),
+ 'parent_id': fields.function(_parent_compute, relation='res.users', fnct_search=_parent_search, method=True, string="Managers", type='many2many'),
'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:
diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml
index 6859150e855..c0d388517eb 100644
--- a/addons/hr/hr_installer.xml
+++ b/addons/hr/hr_installer.xml
@@ -1,5 +1,7 @@
+
+
hr.installer.view
hr.installer
@@ -7,20 +9,18 @@
-
-
-
- Select Human Resources Modules To Install
-
-
+
+
+ Select Human Resources Modules To Install
+
+
-
-
- 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.
-
+
+
+ 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.
+
@@ -51,16 +51,18 @@
3
-
- ir.actions.todo
- hr_installer_action_replace
- tree
-
-
+
+
+ ir.actions.todo
+ hr_installer_action_replace
+ tree
+
+
-
+
+
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index f03058dccc7..161064723f9 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -1,32 +1,12 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -112,29 +92,30 @@
+
Employees
hr.employee
search
-
+
-
-
-
-
-
+
+
+
+
+
+
Employees Structure
hr.employee
@@ -153,7 +134,8 @@
-
+
+
Employees
hr.employee
form
@@ -162,17 +144,14 @@
-
+
+ =======================
+ -->
hr.hr.employee.marital.status
@@ -194,17 +173,15 @@
tree,form
-
-
+
hr.employee.tree
hr.employee
@@ -216,10 +193,10 @@
-
+
Employee Hierarchy
ir.actions.act_window
@@ -228,6 +205,7 @@
tree
+
@@ -255,6 +233,7 @@
+
hr.employee.category.list
hr.employee.category
@@ -267,6 +246,7 @@
+
hr.employee.category.tree
hr.employee.category
@@ -278,6 +258,7 @@
+
Categories of Employee
hr.employee.category
@@ -285,10 +266,8 @@
tree,form
-
+
Categories structure
@@ -316,9 +295,7 @@
-
@@ -328,11 +305,11 @@
+
hr.job.tree
hr.job
@@ -364,35 +342,28 @@
+
Job
hr.job
search
-
-
-
-
-
-
+
+
+
Job Positions
hr.job
@@ -400,14 +371,8 @@
tree,form
-
-
+
+
diff --git a/addons/hr/installer.py b/addons/hr/installer.py
index bc3dd7d0b71..277a315edac 100644
--- a/addons/hr/installer.py
+++ b/addons/hr/installer.py
@@ -23,29 +23,28 @@ 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',
+ 'hr_holidays': fields.boolean('Holidays / Leaves Management',
help="Tracks employee leaves allocations, requests and planning."
"\n\nCan also plug into OpenERP's agendas and calendars "
"applications in order to display accepted leaves requests on"
" OpenERP's calendars."),
- 'hr_expense':fields.boolean('Expenses',
+ 'hr_expense': fields.boolean('Expenses',
help="Tracks and manages employee expenses, and can "
"automatically re-invoice clients if the expenses are "
"project-related."),
- 'hr_recruitment':fields.boolean('Recruitment Process',
+ 'hr_recruitment': fields.boolean('Recruitment Process',
help="Helps you manage and streamline your recruitment process."),
'hr_timesheet_sheet':fields.boolean('Timesheets',
help="Tracks and helps employees encode and validate timesheets "
"and attendance."),
- 'hr_contract':fields.boolean("Employee's Contracts",
+ 'hr_contract': fields.boolean("Employee's Contracts",
help="Extends employee profiles to help manage their contracts."),
- 'hr_evaluation':fields.boolean('Periodic Evaluations',
+ 'hr_evaluation': fields.boolean('Periodic Evaluations',
help="Lets you create and manage the periodic evaluation and "
"performance review of employees."),
- 'hr_attendance':fields.boolean('Attendances (Sign In/Out)',
+ 'hr_attendance': fields.boolean('Attendances (Sign In/Out)',
help="Simplifies the management of employee attendances."),
}
_defaults = {
@@ -55,4 +54,4 @@ class hr_installer(osv.osv_memory):
hr_installer()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml
index c79aae15dab..bc8e7ec2496 100644
--- a/addons/hr/security/hr_security.xml
+++ b/addons/hr/security/hr_security.xml
@@ -1,11 +1,14 @@
+
Human Resources / Manager
+
Human Resources / User
+
diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py
index c0db422b997..1e40f35891b 100644
--- a/addons/hr_attendance/__openerp__.py
+++ b/addons/hr_attendance/__openerp__.py
@@ -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.
""",
@@ -42,7 +41,7 @@
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
'wizard/hr_attendance_sign_in_out_view.xml',
- ],
+ ],
'demo_xml': ['hr_attendance_demo.xml'],
'test': ['test/test_hr_attendance.yml'],
'installable': True,
diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py
index e14a91df084..b8892837310 100644
--- a/addons/hr_attendance/hr_attendance.py
+++ b/addons/hr_attendance/hr_attendance.py
@@ -19,7 +19,6 @@
#
##############################################################################
-from mx import DateTime
import time
from osv import fields, osv
@@ -29,16 +28,16 @@ class hr_action_reason(osv.osv):
_name = "hr.action.reason"
_description = "Action Reason"
_columns = {
- 'name' : fields.char('Reason', size=64, required=True, help='Specifies the reason for Signing In/Signing Out.'),
- 'action_type' : fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action's type"),
+ 'name': fields.char('Reason', size=64, required=True, help='Specifies the reason for Signing In/Signing Out.'),
+ '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()
def _employee_get(obj, cr, uid, context=None):
- ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
+ ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if ids:
return ids[0]
return False
@@ -51,18 +50,18 @@ 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),
- 'action_desc' : fields.many2one("hr.action.reason", "Action reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
- 'employee_id' : fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
- 'day' : fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32),
+ 'name': fields.datetime('Date', required=True, select=1),
+ 'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
+ 'action_desc': fields.many2one("hr.action.reason", "Action reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
+ 'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
+ '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'),
- 'employee_id' : _employee_get,
+ 'name': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'employee_id': _employee_get,
}
def _altern_si_so(self, cr, uid, ids):
@@ -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):
+ if isinstance(type, dict):
type = type.get('type','action')
-
if type == 'sign_in':
warning_sign = "Sign In"
elif type == 'sign_out':
@@ -135,15 +132,15 @@ class hr_employee(osv.osv):
if not self._action_check(cr, uid, emp['id'], dt, context):
raise osv.except_osv(_('Warning'), _('You tried to %s with a date anterior to another event !\nTry to contact the administrator to correct attendances.')%(warning_sign,))
- res = {'action' : type, 'employee_id' : emp['id']}
+ res = {'action': type, 'employee_id': emp['id']}
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()
diff --git a/addons/hr_attendance/hr_attendance_demo.xml b/addons/hr_attendance/hr_attendance_demo.xml
index 93908662470..372e9112269 100644
--- a/addons/hr_attendance/hr_attendance_demo.xml
+++ b/addons/hr_attendance/hr_attendance_demo.xml
@@ -7,100 +7,120 @@
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
sign_in
+
sign_out
+
diff --git a/addons/hr_attendance/hr_attendance_report.xml b/addons/hr_attendance/hr_attendance_report.xml
index 329ca641377..d3e9448ead3 100644
--- a/addons/hr_attendance/hr_attendance_report.xml
+++ b/addons/hr_attendance/hr_attendance_report.xml
@@ -1,6 +1,8 @@
+
+
diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml
index 68c4ad60926..08331823667 100644
--- a/addons/hr_attendance/hr_attendance_view.xml
+++ b/addons/hr_attendance/hr_attendance_view.xml
@@ -8,13 +8,14 @@
form
+
hr.attendance.tree
hr.attendance
@@ -51,9 +52,9 @@
-
-
-
+
+
+
@@ -74,12 +75,8 @@
-
-
+
+
hr.action.reason.form
@@ -87,11 +84,12 @@
form
+
hr.action.reason.tree
hr.action.reason
@@ -103,6 +101,7 @@
+
Attendance Reasons
ir.actions.act_window
@@ -111,6 +110,7 @@
tree,form
+
diff --git a/addons/hr_attendance/hr_attendance_wizard.xml b/addons/hr_attendance/hr_attendance_wizard.xml
index dad6a918447..3fc43bce7c5 100644
--- a/addons/hr_attendance/hr_attendance_wizard.xml
+++ b/addons/hr_attendance/hr_attendance_wizard.xml
@@ -13,9 +13,7 @@
groups="group_hr_attendance"/>-->
-
diff --git a/addons/hr_attendance/report/attendance_errors.py b/addons/hr_attendance/report/attendance_errors.py
index 0c21892dc5c..2c0455e10d8 100644
--- a/addons/hr_attendance/report/attendance_errors.py
+++ b/addons/hr_attendance/report/attendance_errors.py
@@ -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({
@@ -80,14 +80,13 @@ class attendance_print(report_sxw.rml_parse):
total2 += r['delay']
result_dict = {
- 'total' : total and str(total).split('.')[0],
- 'total2' : total2 and str(total2).split('.')[0]
+ 'total': total and str(total).split('.')[0],
+ 'total2': total2 and str(total2).split('.')[0]
}
# return (self._sign(total),total2 and self._sign(total2))
return [result_dict]
-report_sxw.report_sxw('report.hr.attendance.error', 'hr.employee', 'addons/hr_attendance/report/attendance_errors.rml',parser=attendance_print, header=2)
-
+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:
diff --git a/addons/hr_attendance/report/bymonth.py b/addons/hr_attendance/report/bymonth.py
index cfebc640777..fc646e089ac 100644
--- a/addons/hr_attendance/report/bymonth.py
+++ b/addons/hr_attendance/report/bymonth.py
@@ -30,7 +30,7 @@ from report.interface import report_rml
from report.interface import toxml
one_day = DateTime.RelativeDateTime(days=1)
-month2name = [0,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
+month2name = [0, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
def hour2str(h):
hours = int(h)
@@ -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 = ['%s' % month2name[month.month], '%s' % month.year]
for employee_id in ids:
@@ -67,7 +70,7 @@ class report_custom(report_rml):
if attendences and attendences[0]['action'] == 'sign_out':
attendences.insert(0, {'name': today.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_in'})
if attendences and attendences[-1]['action'] == 'sign_in':
- attendences.append({'name' : tomor.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
+ attendences.append({'name': tomor.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
# sum up the attendances' durations
for att in attendences:
dt = DateTime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
@@ -88,7 +91,6 @@ class report_custom(report_rml):
%s
''' % '\n'.join(user_xml)
-
return xml
report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')
diff --git a/addons/hr_attendance/report/timesheet.py b/addons/hr_attendance/report/timesheet.py
index 7319c366298..8b5bbdff5e7 100644
--- a/addons/hr_attendance/report/timesheet.py
+++ b/addons/hr_attendance/report/timesheet.py
@@ -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
@@ -73,9 +72,9 @@ class report_custom(report_rml):
# Fake sign ins/outs at week ends, to take attendances across week ends into account
# XXX this is wrong for the first sign-in ever and the last sign out to this date
if attendances and attendances[0]['action'] == 'sign_out':
- attendances.insert(0, {'name': monday.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_in'})
+ attendances.insert(0, {'name': monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_in'})
if attendances and attendances[-1]['action'] == 'sign_in':
- attendances.append({'name' : n_monday.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
+ attendances.append({'name': n_monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_out'})
# sum up the attendances' durations
for att in attendances:
dt = DateTime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
diff --git a/addons/hr_attendance/security/hr_security.xml b/addons/hr_attendance/security/hr_security.xml
index 7973239ebcf..fd6ad2e0ccb 100644
--- a/addons/hr_attendance/security/hr_security.xml
+++ b/addons/hr_attendance/security/hr_security.xml
@@ -1,8 +1,10 @@
-
-
- Human Resources / Attendances User
-
-
+
+
+
+ Human Resources / Attendances User
+
+
+
diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth.py b/addons/hr_attendance/wizard/hr_attendance_bymonth.py
index 2b2c33cf5eb..f66e7892601 100644
--- a/addons/hr_attendance/wizard/hr_attendance_bymonth.py
+++ b/addons/hr_attendance/wizard/hr_attendance_bymonth.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
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',
@@ -49,4 +51,4 @@ class hr_attendance_bymonth(osv.osv_memory):
hr_attendance_bymonth()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml b/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml
index 725ce7b5004..6518202ac36 100644
--- a/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml
+++ b/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml
@@ -9,9 +9,9 @@
-
\ No newline at end of file
+
diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py
index 30c63d69f2b..9ef48f29fff 100644
--- a/addons/hr_attendance/wizard/hr_attendance_byweek.py
+++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py
@@ -28,11 +28,11 @@ class hr_attendance_byweek(osv.osv_memory):
_columns = {
'init_date': fields.date('Starting Date', required=True),
'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):
datas = {
@@ -47,4 +47,4 @@ class hr_attendance_byweek(osv.osv_memory):
}
hr_attendance_byweek()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml b/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml
index 220ceef2e48..1e536334675 100644
--- a/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml
+++ b/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml
@@ -9,10 +9,10 @@
+
hr_evaluation.evaluation_search
hr_evaluation.evaluation
@@ -243,22 +231,17 @@
-
-
-
-
-
+
+
+
+
+
-
+ help="Evaluations that overpassed the deadline" domain="[('date','>=',(datetime.date.today()))]" />
-
-
+
+
@@ -278,9 +261,8 @@
tree,form,graph
-
@@ -293,10 +275,8 @@
-
-
+
+
@@ -327,10 +307,8 @@
-
-
+
+
@@ -369,17 +347,13 @@
-
-
-
+
+
diff --git a/addons/hr_evaluation/report/__init__.py b/addons/hr_evaluation/report/__init__.py
index 507f8d6715b..f8ddaab3486 100644
--- a/addons/hr_evaluation/report/__init__.py
+++ b/addons/hr_evaluation/report/__init__.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
import hr_evaluation_report
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_evaluation/report/hr_evaluation_report.py b/addons/hr_evaluation/report/hr_evaluation_report.py
index 7c97ff5055e..56af08e4598 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report.py
+++ b/addons/hr_evaluation/report/hr_evaluation_report.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
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:
+
diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
index 2a5cbe21ad9..a0f46170518 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml
+++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
@@ -1,6 +1,7 @@
-
+
+
hr.evaluation.report.tree
hr.evaluation.report
@@ -43,33 +44,18 @@
-
-
+ domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date', '>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 365 days"/>
+
+
-
-
-
-
+
@@ -86,13 +72,13 @@
-
+
-
-
-
-
-
+
+
+
+
+
@@ -110,5 +96,5 @@
-
+
diff --git a/addons/hr_evaluation/wizard/__init__.py b/addons/hr_evaluation/wizard/__init__.py
index 367cabbe90b..1a855087bbc 100644
--- a/addons/hr_evaluation/wizard/__init__.py
+++ b/addons/hr_evaluation/wizard/__init__.py
@@ -21,5 +21,4 @@
import hr_evaluation_mail
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
index 42b0654de1b..97dd1ca01c7 100644
--- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py
+++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
@@ -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:
@@ -40,4 +40,4 @@ class hr_evaluation_reminder(osv.osv_memory):
hr_evaluation_reminder()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml b/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml
index 2e06e47505e..9319b8d88fd 100644
--- a/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml
+++ b/addons/hr_evaluation/wizard/hr_evaluation_mail_view.xml
@@ -1,36 +1,36 @@
-
-
- hr.evaluation.send.mail
- hr.evaluation.reminder
- form
-
-
+
+
- Evaluation Send Mail
- hr.evaluation.reminder
- ir.actions.act_window
- form
- tree,form
-
- {'record_id':active_id}
- new
-
+ Evaluation Send Mail
+ hr.evaluation.reminder
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ new
+
diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py
index dda5cd0f8a3..3be26d8ff72 100644
--- a/addons/hr_expense/__openerp__.py
+++ b/addons/hr_expense/__openerp__.py
@@ -51,10 +51,11 @@
'process/hr_expense_process.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
- ],
- 'demo_xml': ['hr_expense_demo.xml',
-# 'hr.expense.expense.csv'
- ],
+ ],
+ 'demo_xml': [
+ 'hr_expense_demo.xml',
+# 'hr.expense.expense.csv'
+ ],
'test': ['test/test_hr_expense.yml'],
'installable': True,
'active': False,
diff --git a/addons/hr_expense/board_hr_expense_view.xml b/addons/hr_expense/board_hr_expense_view.xml
index 797e258cb31..cc5488a8f2e 100644
--- a/addons/hr_expense/board_hr_expense_view.xml
+++ b/addons/hr_expense/board_hr_expense_view.xml
@@ -1,6 +1,7 @@
+
My Expenses
hr.expense.expense
@@ -20,5 +21,6 @@
+
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index d32a136e0d2..d1d151c08f3 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -25,7 +25,7 @@ from osv import fields, osv
from tools.translate import _
def _employee_get(obj, cr, uid, context=None):
- ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
+ ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if ids:
return ids[0]
return False
@@ -34,15 +34,15 @@ class hr_expense_expense(osv.osv):
def copy(self, cr, uid, id, default=None, context=None):
if not default: default = {}
- default.update( {'invoice_id':False,'date_confirm':False,'date_valid':False,'user_valid':False})
+ 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):
- 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),))
+ 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)
+ 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)
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),))
@@ -204,11 +203,11 @@ class hr_expense_line(osv.osv):
'analytic_account': fields.many2one('account.analytic.account','Analytic account'),
'ref': fields.char('Reference', size=32),
'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"
def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None):
@@ -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
diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml
index 148ab026a0f..da348b02ab4 100644
--- a/addons/hr_expense/hr_expense_demo.xml
+++ b/addons/hr_expense/hr_expense_demo.xml
@@ -58,6 +58,7 @@
+
Basic PC - Server for Seagate
2010-05-03
@@ -68,7 +69,9 @@
+
+
@@ -79,6 +82,7 @@
2010-04-20
draft
+
Hotel Expenses - Thymbra
2010-05-03
@@ -89,17 +93,17 @@
-
- Bruxelles - Paris
- 2010-05-03
-
-
-
-
-
-
-
+
+ Bruxelles - Paris
+ 2010-05-03
+
+
+
+
+
+
+
diff --git a/addons/hr_expense/hr_expense_report.xml b/addons/hr_expense/hr_expense_report.xml
index 9d5f0c3e2c1..5defbfec330 100644
--- a/addons/hr_expense/hr_expense_report.xml
+++ b/addons/hr_expense/hr_expense_report.xml
@@ -1,6 +1,8 @@
+
+
diff --git a/addons/hr_expense/hr_expense_sequence.xml b/addons/hr_expense/hr_expense_sequence.xml
index 4350faecb47..e7de7eb1350 100644
--- a/addons/hr_expense/hr_expense_sequence.xml
+++ b/addons/hr_expense/hr_expense_sequence.xml
@@ -1,15 +1,18 @@
+
Expense invoice
hr.expense.invoice
+
Expense invoice
hr.expense.invoice
EXP/
3
+
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 9c5ebf49953..6b92e792ad5 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -81,8 +81,8 @@
-
-
+
+
@@ -126,28 +126,17 @@
-
+
-
-
-
-
+
@@ -171,23 +160,20 @@
-
-
-
+
+
- product.product.expense.form
- product.product
-
- form
-
+ product.product.expense.form
+ product.product
+
+ form
+
-
-
+
+
diff --git a/addons/hr_expense/hr_expense_workflow.xml b/addons/hr_expense/hr_expense_workflow.xml
index 57163b6df5f..972cdcaab8f 100644
--- a/addons/hr_expense/hr_expense_workflow.xml
+++ b/addons/hr_expense/hr_expense_workflow.xml
@@ -27,18 +27,21 @@
function
write({'state': 'draft'})
+
confirm
function
expense_confirm()
+
accepted
function
expense_accept()
+
paid
@@ -46,6 +49,7 @@
expense_paid()
True
+
refused
@@ -53,6 +57,7 @@
expense_canceled()
+
invoice
@@ -66,24 +71,28 @@
confirm
+
validate
+
+
refuse
+
@@ -96,33 +105,39 @@
refuse
+
draft
+
invoice
+
subflow.paid
+
subflow.cancel
+
draft
+
diff --git a/addons/hr_expense/report/__init__.py b/addons/hr_expense/report/__init__.py
index 4ddd1d33933..ad0c48a0819 100644
--- a/addons/hr_expense/report/__init__.py
+++ b/addons/hr_expense/report/__init__.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
import expense
import hr_expense_report
diff --git a/addons/hr_expense/report/expense.py b/addons/hr_expense/report/expense.py
index ae368e8ef8e..7078c23d244 100644
--- a/addons/hr_expense/report/expense.py
+++ b/addons/hr_expense/report/expense.py
@@ -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)
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index c97c5d2594d..1a21de08ee2 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -1,6 +1,7 @@
+
hr.expense.report.tree
hr.expense.report
@@ -58,27 +59,15 @@
name="month"
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last month"/>
-
+
-
-
+
-
-
@@ -105,20 +94,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_holidays/__init__.py b/addons/hr_holidays/__init__.py
index 9fc701068ef..7144aa19ba8 100644
--- a/addons/hr_holidays/__init__.py
+++ b/addons/hr_holidays/__init__.py
@@ -22,5 +22,6 @@
import hr_holidays
import report
import wizard
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py
index 10e533203ba..e322a2d8786 100644
--- a/addons/hr_holidays/__openerp__.py
+++ b/addons/hr_holidays/__openerp__.py
@@ -21,11 +21,11 @@
{
- "name" : "Human Resources: Holidays management",
- "version" : "1.5",
- "author" : "Tiny & Axelor",
- "category" : "Generic Modules/Human Resources",
- "website" : "http://www.openerp.com",
+ "name": "Human Resources: Holidays management",
+ "version": "1.5",
+ "author": "Tiny & Axelor",
+ "category": "Generic Modules/Human Resources",
+ "website": "http://www.openerp.com",
"description": """Human Ressources: Holidays tracking and workflow
This module allows you to manage leaves and leaves requests.
@@ -64,7 +64,7 @@
'wizard/hr_holidays_summary_employees_view.xml',
'board_hr_holidays_view.xml',
#'process/hr_holidays_process.xml'
- ],
+ ],
'demo_xml': ['hr_holidays_demo.xml',],
'test': ['test/test_hr_holiday.yml'],
'installable': True,
diff --git a/addons/hr_holidays/board_hr_holidays_view.xml b/addons/hr_holidays/board_hr_holidays_view.xml
index 026552f9801..4f3f2142447 100644
--- a/addons/hr_holidays/board_hr_holidays_view.xml
+++ b/addons/hr_holidays/board_hr_holidays_view.xml
@@ -8,7 +8,7 @@
hr.holidays
form
tree,form
- [('user_id','=',uid)]
+ [('user_id','=',uid)]
@@ -21,6 +21,7 @@
[('user_id','=',uid)]
+
board.hr.holidays.form
board.board
diff --git a/addons/hr_holidays/hr_bel_holidays_2008.xml b/addons/hr_holidays/hr_bel_holidays_2008.xml
index 0c09586cb0c..7b9a305704b 100644
--- a/addons/hr_holidays/hr_bel_holidays_2008.xml
+++ b/addons/hr_holidays/hr_bel_holidays_2008.xml
@@ -8,59 +8,69 @@
2008-01-01 18:00
+
Easter Monday
2008-03-24 08:00
2008-03-24 18:00
+
Labour Day
2008-05-01 08:00
2008-05-01 18:00
+
Ascension
2008-05-02 08:00
2008-05-02 18:00
+
Pentecost Monday
2008-05-12 08:00
2008-05-12 18:00
+
National Day
2008-07-21 08:00
2008-07-21 18:00
+
Assumption Day
2008-08-15 08:00
2008-08-15 18:00
+
All Saints
2008-11-01 08:00
2008-11-01 18:00
+
Armistice
2008-11-11 08:00
2008-11-11 18:00
+
Christmas
2008-12-25 08:00
2008-12-25 18:00
+
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 9e3bfca0660..a5ffdbdfc49 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -20,6 +20,7 @@
# along with this program. If not, see .
#
##############################################################################
+
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
@@ -100,7 +102,7 @@ class hr_holidays_status(osv.osv):
_defaults = {
'color_name': 'red',
'active': True,
- }
+ }
hr_holidays_status()
@@ -110,22 +112,22 @@ class hr_holidays(osv.osv):
_order = "type desc, date_from asc"
def _employee_get(obj, cr, uid, context=None):
- ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
+ ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if ids:
return ids[0]
return False
_columns = {
- 'name' : fields.char('Description', required=True, readonly=True, size=64, states={'draft':[('readonly',False)]}),
+ 'name': fields.char('Description', required=True, readonly=True, size=64, states={'draft':[('readonly',False)]}),
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Validation'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Validation'), ('validate', 'Validated'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Validation\'.\
If the admin accepts it, the state is \'Validated\'. If it is refused, the state is \'Refused\'.'),
- 'date_from' : fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
+ 'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
'user_id':fields.many2one('res.users', 'User', states={'draft':[('readonly',False)]}, select=True, readonly=True),
- 'date_to' : fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
+ 'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
'holiday_status_id' : fields.many2one("hr.holidays.status", " Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
'employee_id' : fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
- 'manager_id' : fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
- 'notes' : fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
+ 'manager_id': fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
+ 'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'case_id': fields.many2one('crm.meeting', 'Case'),
@@ -140,13 +142,13 @@ class hr_holidays(osv.osv):
}
_defaults = {
- 'employee_id' : _employee_get ,
- 'state' : 'draft',
+ 'employee_id': _employee_get ,
+ 'state': 'draft',
'type': 'remove',
'allocation_type': 'employee',
'user_id': lambda obj, cr, uid, context: uid,
'holiday_type': 'employee'
- }
+ }
def _create_resource_leave(self, cr, uid, vals, context=None):
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
@@ -215,10 +217,10 @@ class hr_holidays(osv.osv):
self.unlink(cr, uid, list_ids)
def _check_date(self, cr, uid, ids):
- for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to', 'type']):
+ for rec in self.read(cr, uid, ids, ['number_of_days_temp', 'date_from','date_to', 'type']):
if rec['number_of_days_temp'] < 0:
return False
- if rec['type']=='add':
+ if rec['type'] == 'add':
continue
date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S')
date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S')
@@ -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]
@@ -263,7 +265,7 @@ class hr_holidays(osv.osv):
def set_to_draft(self, cr, uid, ids, *args):
wf_service = netsvc.LocalService("workflow")
self.write(cr, uid, ids, {
- 'state':'draft',
+ 'state': 'draft',
'manager_id': False,
'number_of_days': 0,
})
@@ -274,7 +276,7 @@ class hr_holidays(osv.osv):
def holidays_validate2(self, cr, uid, ids, *args):
vals = {'state':'validate1'}
self.check_holidays(cr, uid, ids)
- ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
+ ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if ids2:
vals['manager_id'] = ids2[0]
else:
@@ -287,17 +289,17 @@ class hr_holidays(osv.osv):
data_holiday = self.browse(cr, uid, ids)
self.check_holidays(cr, uid, ids)
vals = {'state':'validate'}
- ids2 = obj_emp.search(cr, uid, [('user_id','=', uid)])
+ ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
if ids2:
if data_holiday[0].state == 'validate1':
vals['manager_id2'] = ids2[0]
else:
vals['manager_id'] = ids2[0]
else:
- raise osv.except_osv(_('Warning !'),_('No user related to the selected employee.'))
+ raise osv.except_osv(_('Warning !'), _('No user related to the selected employee.'))
self.write(cr, uid, ids, vals)
for record in data_holiday:
- if record.holiday_type=='employee' and record.type=='remove':
+ if record.holiday_type == 'employee' and record.type == 'remove':
vals = {
'name': record.name,
'date_from': record.date_from,
@@ -308,7 +310,7 @@ class hr_holidays(osv.osv):
'holiday_id': record.id
}
self._create_resource_leave(cr, uid, vals)
- elif record.holiday_type=='category' and record.type=='remove':
+ elif record.holiday_type == 'category' and record.type == 'remove':
emp_ids = obj_emp.search(cr, uid, [('category_id', '=', record.category_id.id)])
for emp in obj_emp.browse(cr, uid, emp_ids):
vals = {
@@ -327,13 +329,13 @@ class hr_holidays(osv.osv):
for record in self.browse(cr, uid, ids):
user_id = False
leave_asked = record.number_of_days_temp
- if record.holiday_type=='employee' and record.type == 'remove':
+ if record.holiday_type == 'employee' and record.type == 'remove':
if record.employee_id and not record.holiday_status_id.limit:
leaves_rest = self.pool.get('hr.holidays.status').get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
if leaves_rest < leave_asked:
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for %s while available leaves are less than asked leaves.' %(record.employee_id.name)))
nb = -(record.number_of_days_temp)
- elif record.holiday_type=='category' and record.type == 'remove':
+ elif record.holiday_type == 'category' and record.type == 'remove':
if record.category_id and not record.holiday_status_id.limit:
leaves_rest = self.pool.get('hr.holidays.status').get_days_cat( cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
if leaves_rest < leave_asked:
@@ -342,20 +344,14 @@ class hr_holidays(osv.osv):
else:
nb = record.number_of_days_temp
- if record.holiday_type=='employee' and record.employee_id:
+ 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,22 +360,18 @@ 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):
for record in self.browse(cr, uid, ids):
if not record.number_of_days:
- raise osv.except_osv(_('Warning!'),_('Wrong leave definition.'))
+ raise osv.except_osv(_('Warning!'), _('Wrong leave definition.'))
if record.holiday_type=='employee' and record.employee_id:
leave_asked = record.number_of_days
if leave_asked < 0.00:
@@ -387,7 +379,7 @@ class hr_holidays(osv.osv):
leaves_rest = self.pool.get('hr.holidays.status').get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
if leaves_rest < -(leave_asked):
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
- elif record.holiday_type=='category' and record.category_id:
+ elif record.holiday_type == 'category' and record.category_id:
leave_asked = record.number_of_days
if leave_asked < 0.00:
if not record.holiday_status_id.limit:
@@ -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)
@@ -444,7 +436,7 @@ class hr_holidays(osv.osv):
'date' : record.date_from,
}
case_id = self.pool.get('crm.meeting').create(cr, uid, vals)
- self.write(cr, uid, ids, {'case_id':case_id})
+ self.write(cr, uid, ids, {'case_id': case_id})
return True
@@ -455,8 +447,8 @@ class resource_calendar_leaves(osv.osv):
_description = "Leave Detail"
_columns = {
'holiday_id': fields.many2one("hr.holidays", "Holiday"),
- }
+ }
resource_calendar_leaves()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/hr_holidays_report.xml b/addons/hr_holidays/hr_holidays_report.xml
index 88670544ebf..4c8ec39a1af 100644
--- a/addons/hr_holidays/hr_holidays_report.xml
+++ b/addons/hr_holidays/hr_holidays_report.xml
@@ -1,6 +1,7 @@
+
+
hr.holidays.filter
hr.holidays
@@ -16,8 +17,7 @@
+ domain="[('department_id.manager_id','=',uid)]" />
@@ -44,21 +44,21 @@
-
-
+
+
-
+
-
+
-
+
-
-
+
+
@@ -66,7 +66,7 @@
-
+
@@ -89,15 +89,15 @@
-
-
+
+
-
+
-
+
@@ -110,7 +110,7 @@
-
+
@@ -130,8 +130,7 @@
hr.holidays
tree
-
+
@@ -151,22 +150,22 @@
form
-
-
+
+
+
+-->
-
-
+
+
-
+
@@ -207,8 +206,7 @@
hr.holidays
tree
-
+
@@ -271,10 +269,7 @@
-
@@ -301,10 +296,7 @@
-
@@ -331,15 +323,16 @@
form
-
+
-
+
+
hr.holidays.status.tree
hr.holidays.status
@@ -352,6 +345,7 @@
+
Leave Type
ir.actions.act_window
diff --git a/addons/hr_holidays/hr_holidays_wizard.xml b/addons/hr_holidays/hr_holidays_wizard.xml
index 3c40d073853..4374e2b461a 100644
--- a/addons/hr_holidays/hr_holidays_wizard.xml
+++ b/addons/hr_holidays/hr_holidays_wizard.xml
@@ -6,6 +6,7 @@
name="Reporting"
parent="hr.menu_hr_root"
sequence="10" />
+
.
#
##############################################################################
+
from osv import fields, osv
import tools
@@ -32,19 +33,19 @@ class available_holidays_report(osv.osv):
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'employee_id': fields.many2one ('hr.employee', "Employee's Name", readonly=True),
- 'category_id' : fields.many2one('hr.employee.category', "Category's Name", readonly=True),
+ 'category_id': fields.many2one('hr.employee.category', "Category's Name", readonly=True),
'holiday_status_id': fields.many2one('hr.holidays.status', 'Leave Type', readonly=True),
'max_leave': fields.float('Allocated Leaves', readonly=True),
'taken_leaves': fields.float('Taken Leaves', readonly=True),
- 'remaining_leave': fields.float('Remaining Leaves',readonly=True),
- 'department_id':fields.many2one('hr.department','Department',readonly=True),
- 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'remaining_leave': fields.float('Remaining Leaves', readonly=True),
+ 'department_id': fields.many2one('hr.department', 'Department', readonly=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True),
}
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:
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index 327cdab032b..111d8d2f8a6 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -48,38 +48,28 @@
-
+ domain="[('employee_id', '=', False)]" help="Leaves by category"/>
-
-
+
+
-
-
+
-
-
+
+
@@ -96,8 +86,6 @@
-
-
Available Holidays
available.holidays.report
@@ -112,20 +100,17 @@
tree
-
-
+
graph
-
-
+
-
diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py
index 31fbe91a5a2..a0fa2cdd131 100644
--- a/addons/hr_holidays/report/holidays_summary_report.py
+++ b/addons/hr_holidays/report/holidays_summary_report.py
@@ -234,8 +234,8 @@ class report_custom(report_rml):
continue
dept_done=0
for d in range(0,len(result)):
- emp_id[d]=pooler.get_pool(cr.dbname).get('hr.employee').search(cr, uid, [('user_id','=',result[d][0])])
- items = pooler.get_pool(cr.dbname).get('hr.employee').read(cr, uid, emp_id[d], ['id','name'])
+ emp_id[d]=pooler.get_pool(cr.dbname).get('hr.employee').search(cr, uid, [('user_id', '=', result[d][0])])
+ items = pooler.get_pool(cr.dbname).get('hr.employee').read(cr, uid, emp_id[d], ['id', 'name'])
for item in items:
# if item['id'] in done:
# continue
@@ -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:
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index 38995351a32..8f8ec56ffeb 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
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
)
""")
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index 7f42982eaad..a367506bce5 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -45,37 +45,23 @@
-
-
-
-
+ domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Leaves in this year"/>
+
+
-
-
-
@@ -96,18 +82,14 @@
-
-
+
@@ -122,7 +104,7 @@
hr.holidays.report
form
tree,graph
- {"search_default_user_id": uid, 'search_default_month':1,'search_default_Employee':1,'group_by':[]}
+ {"search_default_user_id": uid, 'search_default_month':1, 'search_default_Employee':1, 'group_by':[]}
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
index 9c6d1447f89..af9c92d9f59 100644
--- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
@@ -31,12 +31,12 @@ class hr_holidays_summary_dept(osv.osv_memory):
'date_from': fields.date('From', required=True),
'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'),
'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Select Holiday Type', required=True)
- }
+ }
_defaults = {
'date_from': time.strftime('%Y-%m-%d'),
'holiday_type': 'Validated'
- }
+ }
def print_report(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, [])[0]
@@ -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:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
index 1452c864c7f..8ca69ef9274 100644
--- a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
@@ -30,12 +30,12 @@ class hr_holidays_summary_employee(osv.osv_memory):
'date_from': fields.date('From', required=True),
'emp': fields.many2many('hr.employee', 'summary_emp_rel', 'sum_id', 'emp_id', 'Employee(s)'),
'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Select Holiday Type', required=True)
- }
+ }
_defaults = {
'date_from': time.strftime('%Y-%m-%d'),
'holiday_type': 'Validated',
- }
+ }
def print_report(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, [])[0]
@@ -53,4 +53,4 @@ class hr_holidays_summary_employee(osv.osv_memory):
hr_holidays_summary_employee()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: