Skip to Content
Menu
This question has been flagged
1 Reply
5037 Views

Hi all, Could you tell me what is this function (self.env.cr.split_for_in_conditions) do ?  in odoo 12

Avatar
Discard
Best Answer

Hi Tith,

The split_for_in_conditions is a built-in function in the Odoo core. You can find it in odoo/sql_db.py. See https://github.com/odoo/odoo/blob/12.0/odoo/sql_db.py#L254 

This method will call a function in the Odoo tools named "split_every". In short this function will split a list of identifiers into smaller tuples, which will give safer IN conditions when Odoo queries the database. Otherwise it would handle one huge set of data to do an IN SQL query, now it splits them up and does smaller (and thus more reliable) queries. You can find the code for this tool function at https://github.com/odoo/odoo/blob/659ff0da13951d0b940c24a070a4a7e51b0897bb/odoo/tools/misc.py#L689-L702


Regards,
Yenthe


Avatar
Discard
Author

Thank you so much Yenthe Van Ginneken