Commit 9a1be7d
committed
[IMP] orm: add option to iter_browse for yielding chunks
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>1 parent c2590fb commit 9a1be7d
2 files changed
+20
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
664 | 677 | | |
665 | 678 | | |
666 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
380 | 382 | | |
381 | 383 | | |
382 | 384 | | |
| |||
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| 401 | + | |
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
| |||
429 | 432 | | |
430 | 433 | | |
431 | 434 | | |
432 | | - | |
| 435 | + | |
| 436 | + | |
433 | 437 | | |
434 | | - | |
| 438 | + | |
435 | 439 | | |
436 | 440 | | |
437 | 441 | | |
| |||
0 commit comments