[FIX] website_slides: default values for all compute fields.
closes odoo/odoo#40263 X-original-commit: 2cab75b41763fed0b86d919e005d9a65cd3b85ac Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -265,7 +265,7 @@ class Slide(models.Model):
|
||||
# Do not use dict.fromkeys(self.ids, dict()) otherwise it will use the same dictionnary for all keys.
|
||||
# Therefore, when updating the dict of one key, it updates the dict of all keys.
|
||||
keys = ['nbr_%s' % slide_type for slide_type in self.env['slide.slide']._fields['slide_type'].get_values(self.env)]
|
||||
default_vals = dict((key, 0) for key in keys)
|
||||
default_vals = dict((key, 0) for key in keys + ['total_slides'])
|
||||
|
||||
res = self.env['slide.slide'].read_group(
|
||||
[('is_published', '=', True), ('category_id', 'in', self.ids), ('is_category', '=', False)],
|
||||
|
||||
Reference in New Issue
Block a user