Hey Cyllo folks, anyone know why do we use `@api.model_create_multi` and how it works?
Welcome!
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
This question has been flagged
1
Reply
9
Views
Here's how you can use the `@api.model_create_multi` decorator for efficient creation of multiple records in Odoo. It significantly improves performance by batching database operations. @api.model_create_multi def create(self, vals_list): # Optimized creation of multiple records return super(CustomModel, self).create(vals_list) class CustomModel(models.Model): _name = 'custom.model' @api.model_create_multi def create(self, vals_list): # Optimized creation of multiple records return super(CustomModel, self).create(vals_list)