Exemplo n.º 1
0
 def _url_fields(self):
     """Add social networks fields to inital list of url fields."""
     fields = super(ResPartner, self)._url_fields
     fields.extend([
         'twitter',
         'facebook',
         'linkedin',
         'wikipedia',
         # 'art_of_fx',
     ])
     return fields
Exemplo n.º 2
0
 def _url_fields(self):
     """Add social networks fields to inital list of url fields."""
     fields = super(ResPartner, self)._url_fields
     fields.extend([
         'twitter',
         'youtube',
         'vimeo',
         'facebook',
         'linkedin',
         # 'wikipedia', 'art_of_fx',
     ])
     return fields
Exemplo n.º 3
0
 def read(self, fields=None, load='_classic_read'):
     """
     Every time an offer is read check if it didn't expire.
     """
     if fields:
         fields.extend(['remaining_days', 'state'])
     vals = super(Offer, self).read(fields=fields, load=load)
     for rec in vals:
         if rec['state'] in ('published', 'unpublished') and rec['remaining_days'] < 0:
             # Expired! Change the state.
             self.browse([rec['id']]).state = 'archive'
             rec['state'] = 'archive'
     return vals
Exemplo n.º 4
0
 def read(self, fields=None, load='_classic_read'):
     """
     Every time an offer is read check if it didn't expire.
     """
     if fields:
         fields.extend(['remaining_days', 'state'])
     vals = super(Offer, self).read(fields=fields, load=load)
     for rec in vals:
         if rec['state'] in ('published', 'unpublished') and rec['remaining_days'] < 0:
             # Expired! Change the state.
             self.browse([rec['id']]).state = 'archive'
             rec['state'] = 'archive'
     return vals