Skip to content

Commit e500bcc

Browse files
committed
[IMP]Product_profile: Support Create multi
Fixes the warning "The model odoo.addons.product_profile is not overriding the create method in batch" Fixup! Update product_profile
1 parent 6d8f855 commit e500bcc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

product_profile/models/product_profile.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,12 @@ def _onchange_from_profile(self):
212212
except Exception as e:
213213
raise UserError(format_except_message(e, field, self)) from e
214214

215-
@api.model
216-
def create(self, vals):
217-
if vals.get("profile_id"):
218-
vals.update(self._get_vals_from_profile(vals, ignore_defaults=False))
219-
return super().create(vals)
215+
@api.model_create_multi
216+
def create(self, vals_list):
217+
for vals in vals_list:
218+
if vals.get("profile_id"):
219+
vals.update(self._get_vals_from_profile(vals, ignore_defaults=False))
220+
return super().create(vals_list)
220221

221222
def write(self, vals):
222223
profile_changed = vals.get("profile_id")

0 commit comments

Comments
 (0)