Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5864 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Autor

Thank you so much Yenthe Van Ginneken