Hi all, Could you tell me what is this function (self.env.cr.split_for_in_conditions) do ? in odoo 12
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
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
Thank you so much Yenthe Van Ginneken
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up