diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 372b5214f6f..41aecc0bce0 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -33,7 +33,7 @@ class hr_employee_category(osv.osv): 'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories') } - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from hr_employee_category where id IN %s', (tuple(ids), )) @@ -53,9 +53,10 @@ 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), + 'name': fields.char('Marital Status', size=32, required=True), 'description': fields.text('Status Description'), } + hr_employee_marital_status() class hr_job(osv.osv): @@ -95,11 +96,11 @@ class hr_employee(osv.osv): '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), + 'sinid': fields.char('SIN No', size=32, help="Social Insurance Number"), 'otherid': fields.char('Other ID', size=32), '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), + 'bank_account': fields.char('Bank Account', size=64), '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'), @@ -127,7 +128,7 @@ class hr_employee(osv.osv): 'photo': _get_photo, } - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from hr_employee where id IN %s',(tuple(ids),)) @@ -143,4 +144,4 @@ class hr_employee(osv.osv): hr_employee() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index d1e13e2f6ec..0a21e8aecee 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -39,7 +39,7 @@ class hr_department(osv.osv): return res def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - res = self.name_get(cr, uid, ids, context) + res = self.name_get(cr, uid, ids, context=context) return dict(res) _name = "hr.department" @@ -53,20 +53,20 @@ 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'), } - - _defaults = { + + _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): + result = {uid: 1} + for m in self.browse(cr, uid, mids, context=context): for user in m.member_ids: result[user.id] = 1 return result.keys() - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from hr_department where id IN %s',(tuple(ids),)) @@ -122,12 +122,12 @@ class res_users(osv.osv): result[user_id] = parent_ids return result - def _parent_search(self, cr, uid, obj, name, args, context): + def _parent_search(self, cr, uid, obj, name, args, context=None): parent = [] for arg in args: if arg[0] == 'parent_id': parent = arg[2] - child_ids = self._child_compute(cr, uid, parent, name, args, {}) + child_ids = self._child_compute(cr, uid, parent, name, args, context=context) if not child_ids: return [('id', 'in', [0])] return [('id', 'in', child_ids.get(uid,[]))] @@ -163,7 +163,7 @@ class res_users(osv.osv): for arg in args: if arg[0] == 'child_ids': parent = arg[2] - child_ids = self._child_compute(cr, uid, parent, name, args, {}) + child_ids = self._child_compute(cr, uid, parent, name, args, context=context) if not child_ids: return [('id', 'in', [0])] return [('id', 'in', child_ids.get(uid,[]))] diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 161064723f9..402df16939e 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -89,6 +89,7 @@ + @@ -150,9 +151,20 @@ + + hr.hr.employee.marital.status.tree + hr.employee.marital.status + tree + + + + + + + hr.hr.employee.marital.status hr.employee.marital.status @@ -171,6 +183,7 @@ hr.employee.marital.status form tree,form + + @@ -358,7 +372,7 @@ - +