-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] start extraction of chunk processing \o/ #80
base: 14.0
Are you sure you want to change the base?
Conversation
c243402
to
791bfcb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code review LGTM just some minor suggestions on readability
|
||
class ChunkGroup(models.Model): | ||
_inherit = "collection.base" | ||
_name = "chunk.group" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the word "batch" is very standard and expressive for this kind of purpose, instead of "group"
usage = fields.Char() | ||
|
||
@api.depends("item_ids.nbr_error", "item_ids.nbr_success") | ||
def _compute_stat(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking: stats
def _create_chunk(self, start_idx, stop_idx, data): | ||
vals = self._prepare_chunk(start_idx, stop_idx, data) | ||
chunk = self.env["chunk.item"].create(vals) | ||
# we enqueue the chunk in case of multi process of if it's the first chunk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment gives no new info, is equivalent to reading the next line
|
||
def split_in_chunk(self): | ||
"""Split Group into Chunk""" | ||
# purge chunk in case of retring a job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retrying
@@ -12,9 +12,9 @@ | |||
<field name="state" /> | |||
<field name="date_done" readonly="1" /> | |||
<field name="kind" /> | |||
<field name="nbr_error" /> | |||
<!--<field name="nbr_error" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was forgotten, same for L17
78e0da1
to
9d3a54f
Compare
4092ee2
to
e957067
Compare
/!\ Big change
Start the extraction of chunk processing, the aim is to have a generic module that manage chunk processing (this can be usefull in the EDI project)
I will see with oca team where to move this generic chunk processing
TODO: