[IMP] rating: support batch creation
See merge commit for more details. Task ID-2330149 COM PR odoo/odoo#61246 ENT PR odoo/enterprise#14561
This commit is contained in:
committed by
Thibault Delavallée
parent
9c87db3c62
commit
c1ac7b89f9
@@ -125,11 +125,12 @@ class Rating(models.Model):
|
||||
else:
|
||||
rating.rating_text = 'no_rating'
|
||||
|
||||
@api.model
|
||||
def create(self, values):
|
||||
if values.get('res_model_id') and values.get('res_id'):
|
||||
values.update(self._find_parent_data(values))
|
||||
return super(Rating, self).create(values)
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for values in vals_list:
|
||||
if values.get('res_model_id') and values.get('res_id'):
|
||||
values.update(self._find_parent_data(values))
|
||||
return super().create(vals_list)
|
||||
|
||||
def write(self, values):
|
||||
if values.get('res_model_id') and values.get('res_id'):
|
||||
|
||||
Reference in New Issue
Block a user