Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5945 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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


Imagine profil
Abandonează
Autor

Thank you so much Yenthe Van Ginneken