Skip to content

Conversation

@cawo-odoo
Copy link
Contributor

The iter_browse class already loads records in chunks, but the iterator returned by __iter__ always yields single records. Here we add a flag to the constructor (default False) that when set to True will make __iter__ return an iterator that yields chunks of the same size as it is loading (i.e. chunk_size).

@cawo-odoo cawo-odoo requested review from a team and filisbits December 2, 2025 13:32
@robodoo
Copy link
Contributor

robodoo commented Dec 2, 2025

Pull request status dashboard

@KangOl
Copy link
Contributor

KangOl commented Dec 2, 2025

Can you add a test?

upgradeci retry with always only base

@cawo-odoo cawo-odoo force-pushed the master-imp_iter_browse_yield_chunks-cawo branch from f94d79f to b38c54d Compare December 3, 2025 10:19
The `iter_browse` class already loads records in chunks, but the iterator
returned by `__iter__` always yields single records. Here we add a flag to the
constructor (default `False`) that when set to `True` will make `__iter__`
return an iterator that yields chunks of the same size as it is loading (i.e.
`chunk_size`).
@cawo-odoo cawo-odoo force-pushed the master-imp_iter_browse_yield_chunks-cawo branch from b38c54d to a017851 Compare December 3, 2025 10:31
@cawo-odoo cawo-odoo requested a review from KangOl December 3, 2025 13:10
Copy link
Contributor

@KangOl KangOl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robodoo
Copy link
Contributor

robodoo commented Dec 4, 2025

I'm sorry, @KangOl. I'm afraid I can't do that.

@nseinlet
Copy link
Contributor

nseinlet commented Dec 4, 2025

robodoo r+

@robodoo
Copy link
Contributor

robodoo commented Dec 4, 2025

@cawo-odoo @nseinlet linked pull request(s) odoo/upgrade#8987 not ready. Linked PRs are not staged until all of them are ready.

robodoo pushed a commit that referenced this pull request Dec 4, 2025
The `iter_browse` class already loads records in chunks, but the iterator
returned by `__iter__` always yields single records. Here we add a flag to the
constructor (default `False`) that when set to `True` will make `__iter__`
return an iterator that yields chunks of the same size as it is loading (i.e.
`chunk_size`).

closes #362

Related: odoo/upgrade#8987
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
@robodoo robodoo closed this in 9a1be7d Dec 4, 2025
@robodoo robodoo added the 19.1 label Dec 4, 2025
@cawo-odoo cawo-odoo deleted the master-imp_iter_browse_yield_chunks-cawo branch December 5, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants