Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
9 Views

Hey Cyllo folks, anyone know why do we use `@api.model_create_multi` and how it works?

Avatar
Discard

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)

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!