[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:
Olivier Dony
2016-03-30 03:47:24 +02:00
parent 5b5324cb9f
commit 742c7b4c2f
+1 -9
View File
@@ -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):