Skip to content

Commit

Permalink
[IMP] chunked: warn about untested versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivantodorovich committed Apr 10, 2024
1 parent 16f45d1 commit 8e235a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -3261,6 +3261,13 @@ def chunked(records, single=True):
"""Memory and performance friendly method to iterate over a potentially
large number of records. Yields either a whole chunk or a single record
at the time. Don't nest calls to this method."""
# Warning on possibly untested versions where chunked might not work as expected
if version_info[0] > 17: # unreleased version at this time
logger.warning(
f"chunked method might not work as expected in Odoo {version_info[0]}. "
"Please report any issue you may find and consider bumping this warning "
"to the next version otherwise."
)
# Before each iteration we must flush everything and clear the cache.
# This differs depending on the Odoo version.
if version_info[0] >= 16:
Expand Down

0 comments on commit 8e235a6

Please sign in to comment.