[IMP] mail: improve default channel picture

Purpose is to avoid having void image in systray when there are notifications
linked to channels that have no picture. Two small improvements are done on
channel model
 * change default picture for channel to be more inline with Odoo design
   guidelines;
 * override create to ensure there is a default image when creating the
   channel through the discuss interface;

This commit is linked to task ID 48228.
This commit is contained in:
Thibault Delavallée
2018-05-30 15:00:01 +02:00
parent 7558dfe4e9
commit fbec51f476
2 changed files with 5 additions and 0 deletions
+5
View File
@@ -115,6 +115,11 @@ class Channel(models.Model):
@api.model
def create(self, vals):
# ensure image at quick create
if not vals.get('image'):
defaults = self.default_get(['image'])
vals['image'] = defaults['image']
tools.image_resize_images(vals)
# Create channel and alias
channel = super(Channel, self.with_context(
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB