[REM]silly mistake.
bzr revid: vme@tinyerp.com-20140324063121-7wap2zutyu7d4hqs
This commit is contained in:
@@ -134,6 +134,10 @@ class event_track(osv.osv):
|
||||
#
|
||||
class event_event(osv.osv):
|
||||
_inherit = "event.event"
|
||||
def _tz_get(self,cr,uid, context=None):
|
||||
# put POSIX 'Etc/*' entries at the end to avoid confusing users - see bug 1086728
|
||||
return [(tz,tz) for tz in sorted(pytz.all_timezones, key=lambda tz: tz if not tz.startswith('Etc/') else '_')]
|
||||
|
||||
def _get_tracks_tag_ids(self, cr, uid, ids, field_names, arg=None, context=None):
|
||||
res = dict.fromkeys(ids, [])
|
||||
for event in self.browse(cr, uid, ids, context=context):
|
||||
@@ -141,6 +145,7 @@ class event_event(osv.osv):
|
||||
res[event.id] += [tag.id for tag in track.tag_ids]
|
||||
res[event.id] = list(set(res[event.id]))
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'tag_ids': fields.many2many('event.tag', string='Tags'),
|
||||
'track_ids': fields.one2many('event.track', 'event_id', 'Tracks'),
|
||||
@@ -151,11 +156,13 @@ class event_event(osv.osv):
|
||||
'show_blog': fields.boolean('News'),
|
||||
'tracks_tag_ids': fields.function(_get_tracks_tag_ids, type='one2many', relation='event.track.tag', string='Tags of Tracks'),
|
||||
'allowed_track_tag_ids': fields.many2many('event.track.tag', string='Accepted Tags', help="List of available tags for track proposals."),
|
||||
'timezone_of_event': fields.selection(_tz_get, 'Timezone of Event', size=64),
|
||||
}
|
||||
_defaults = {
|
||||
'show_track_proposal': False,
|
||||
'show_tracks': False,
|
||||
'show_blog': False,
|
||||
'timezone_of_event':lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).tz,
|
||||
}
|
||||
def _get_new_menu_pages(self, cr, uid, event, context=None):
|
||||
context = context or {}
|
||||
@@ -194,19 +201,4 @@ class event_sponsors(osv.osv):
|
||||
|
||||
def has_access_to_partner(self, cr, uid, ids, context=None):
|
||||
partner_ids = [sponsor.partner_id.id for sponsor in self.browse(cr, uid, ids, context=context)]
|
||||
return len(partner_ids) == self.pool.get("res.partner").search(cr, uid, [("id", "in", partner_ids)], count=True, context=context)
|
||||
|
||||
class event_event(osv.osv):
|
||||
_inherit = 'event.event'
|
||||
|
||||
def _tz_get(self,cr,uid, context=None):
|
||||
# put POSIX 'Etc/*' entries at the end to avoid confusing users - see bug 1086728
|
||||
return [(tz,tz) for tz in sorted(pytz.all_timezones, key=lambda tz: tz if not tz.startswith('Etc/') else '_')]
|
||||
|
||||
_columns = {
|
||||
'timezone_of_event': fields.selection(_tz_get, 'Timezone of Event', size=64),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'timezone_of_event':lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).tz
|
||||
}
|
||||
return len(partner_ids) == self.pool.get("res.partner").search(cr, uid, [("id", "in", partner_ids)], count=True, context=context)
|
||||
Reference in New Issue
Block a user