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
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
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