Skip to content

Conversation

@therbin200
Copy link

No description provided.

nans and others added 24 commits December 12, 2025 10:48
Currently translated at 100.0% (2 of 2 strings)

Translation: server-tools-16.0/server-tools-16.0-base_partition
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_partition/es/
Currently translated at 100.0% (2 of 2 strings)

Translation: server-tools-16.0/server-tools-16.0-base_partition
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_partition/it/
Currently translated at 100.0% (2 of 2 strings)

Translation: server-tools-17.0/server-tools-17.0-base_partition
Translate-URL: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-base_partition/zh_CN/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-18.0/server-tools-18.0-base_partition
Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_partition/
Copy link
Contributor

@rrebollo rrebollo left a comment

Choose a reason for hiding this comment

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

Code Review: Great work! The code looks good to me (LGTM). Thank you for your contribution! I've provided a few suggestions for your consideration—feel free to address them as you see fit.

Comment on lines +44 to +55
def batch(self, batch_size=None):
"""Yield successive batches of size batch_size, or ."""
if not (batch_size or "_default_batch_size" in dir(self)):
raise UserError(
self.env._(
"Either set up a '_default_batch_size' on the model"
" or provide a batch_size parameter."
)
)
batch_size = batch_size or self._default_batch_size
for i in range(0, len(self), batch_size):
yield self[i : i + batch_size]
Copy link
Contributor

@rrebollo rrebollo Dec 13, 2025

Choose a reason for hiding this comment

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

It would be nice include some documentation in addon's description about this method too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Recently I discovered split_every. Maybe this could be deprecated in favor of the built-in helper.

Comment on lines +57 to +63
def read_per_record(self, fields=None, load="_classic_read"):
result = {}
data_list = self.read(fields=fields, load=load)
for d in data_list:
key = d.pop("id")
result[key] = d
return result
Copy link
Contributor

Choose a reason for hiding this comment

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

Idem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants