[IMP] start extraction of chunk processing \o/#80
Open
sebastienbeau wants to merge 10 commits intoshopinvader:14.0from
Open
[IMP] start extraction of chunk processing \o/#80sebastienbeau wants to merge 10 commits intoshopinvader:14.0from
sebastienbeau wants to merge 10 commits intoshopinvader:14.0from
Conversation
3 tasks
c243402 to
791bfcb
Compare
kevinkhao
approved these changes
Feb 3, 2022
Contributor
kevinkhao
left a comment
There was a problem hiding this comment.
code review LGTM just some minor suggestions on readability
|
|
||
| class ChunkGroup(models.Model): | ||
| _inherit = "collection.base" | ||
| _name = "chunk.group" |
Contributor
There was a problem hiding this comment.
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): |
| 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 |
Contributor
There was a problem hiding this comment.
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 |
| <field name="date_done" readonly="1" /> | ||
| <field name="kind" /> | ||
| <field name="nbr_error" /> | ||
| <!--<field name="nbr_error" /> |
Contributor
There was a problem hiding this comment.
I think this was forgotten, same for L17
78e0da1 to
9d3a54f
Compare
4092ee2 to
e957067
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/!\ 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: