[IMP] Clean for 6.0
bzr revid: mra@mra-laptop-20100707070442-ztxuj718txuro9u1
This commit is contained in:
parent
82c108841c
commit
e4ed76cd59
|
@ -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:
|
|
@ -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,[]))]
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
<field name="department_id"/>
|
||||
<field name="job_id"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="coach_id" invisible="1" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -150,9 +151,20 @@
|
|||
<!--
|
||||
=======================
|
||||
Employee marital status
|
||||
=======================
|
||||
=======================
|
||||
-->
|
||||
|
||||
<record id="hr_hr_employee_marital_status_tree" model="ir.ui.view">
|
||||
<field name="name">hr.hr.employee.marital.status.tree</field>
|
||||
<field name="model">hr.employee.marital.status</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Marital Status">
|
||||
<field name="name" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_hr_employee_marital_status_form" model="ir.ui.view">
|
||||
<field name="name">hr.hr.employee.marital.status</field>
|
||||
<field name="model">hr.employee.marital.status</field>
|
||||
|
@ -171,6 +183,7 @@
|
|||
<field name="res_model">hr.employee.marital.status</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="hr_hr_employee_marital_status_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_hr_marital_status" id="hr_menu_marital_status"
|
||||
|
@ -307,6 +320,7 @@
|
|||
<group col="6" colspan="4">
|
||||
<field name="name" />
|
||||
<field name="department_id" />
|
||||
<newline/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="expected_employees"/>
|
||||
<field name="no_of_employee"/>
|
||||
|
@ -358,7 +372,7 @@
|
|||
<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>
|
||||
|
|
Loading…
Reference in New Issue