As we all know, @api.model_create_multi allows us to insert or create values at once from a list, instead of doing it one by one. As example, if we have:
values = [{...}, {...}]
Doing
record.create(values)
is better than
for val in values:
record.create(val)
The other thing to take into consideration is that regarding the res.partner model, everywhere there is a create() method, it has the decorator @api.model_create_multi which allows us to pass a list of values to res.partner when we want to create records.
Now, the problem we are facing (only in odoo.sh) is that we are creating some partners from some data we take to another system via a connector. Those data are coming fine, and we have a list of all required data we are passing to the create().
If we have 5 contacts, the action we are calling will create only one contact and then one other, and then another one, etc... but in our local it's working fine, all the 5 contacts are created at once.
Here is the code: https://gist.github.com/nasser-bloopark/dfe8c5b42d6f2bd84ae37aafc0e4f468
After some investigations, we found that the issue is in the line destination_model.create(create_values).
Note that we didn't override the method create() anywhere, and we are using the OCA module partner_firstname as dependency to this custom module.
So, my question is: is there something I missed here or some other tips we can use from the ORM to fix this issue ?