[REM]Unused inherit on res.users adding availability
bzr revid: dle@openerp.com-20121227151710-wta91bk3kxz0i9wd
This commit is contained in:
parent
ee6e5cfc46
commit
68db5f8684
|
@ -1747,57 +1747,4 @@ class virtual_report_spool(web_services.report_spool):
|
|||
|
||||
virtual_report_spool()
|
||||
|
||||
class res_users(osv.osv):
|
||||
_inherit = 'res.users'
|
||||
|
||||
def _get_user_avail(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Get User Availability
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user's ID for security checks,
|
||||
@param ids: List of res user's IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
current_datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
res = {}
|
||||
attendee_obj = self.pool.get('calendar.attendee')
|
||||
attendee_ids = attendee_obj.search(cr, uid, [
|
||||
# ('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime),
|
||||
('state', '=', 'accepted'), ('user_id', 'in', ids)
|
||||
])
|
||||
|
||||
for attendee_data in attendee_obj.read(cr, uid, attendee_ids, ['user_id']):
|
||||
user_id = attendee_data['user_id']
|
||||
status = 'busy'
|
||||
res.update({user_id:status})
|
||||
|
||||
#TOCHECK: Delegated Event
|
||||
for user_id in ids:
|
||||
if user_id not in res:
|
||||
res[user_id] = 'free'
|
||||
|
||||
return res
|
||||
|
||||
def _get_user_avail_fun(self, cr, uid, ids, name, args, context=None):
|
||||
"""
|
||||
Get User Availability Function
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user's ID for security checks,
|
||||
@param ids: List of res user's IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
return self._get_user_avail(cr, uid, ids, context=context)
|
||||
|
||||
_columns = {
|
||||
'availability': fields.function(_get_user_avail_fun, type='selection', \
|
||||
selection=[('free', 'Free'), ('busy', 'Busy')], \
|
||||
string='Free/Busy'),
|
||||
}
|
||||
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue