[FIX] website_event_track: use image_medium avatar
The default image field is usally too large for use as a speaker avatar. The implementation of the field should have been a simple "related" field too, instead of a custom computed field.
This commit is contained in:
@@ -53,15 +53,7 @@ class event_track(models.Model):
|
||||
('0', 'Low'), ('1', 'Medium'),
|
||||
('2', 'High'), ('3', 'Highest')],
|
||||
'Priority', required=True, default='1')
|
||||
image = fields.Binary('Image', compute='_compute_image', store=True, attachment=True)
|
||||
|
||||
@api.one
|
||||
@api.depends('speaker_ids.image')
|
||||
def _compute_image(self):
|
||||
if self.speaker_ids:
|
||||
self.image = self.speaker_ids[0].image
|
||||
else:
|
||||
self.image = False
|
||||
image = fields.Binary('Image', related='speaker_ids.image_medium', store=True, attachment=True)
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
|
||||
Reference in New Issue
Block a user