[IMP] queue_job: Add split method
This is a draft PR trying an alternative approach for https://github.com/OCA/queue/pull/566
class ResPartner(models.Model):
# ...
def copy_all_partners(self):
# Duplicate all partners in batches of 30:
self.with_delay(split=30).copy()
# or
def copy_all_partners(self):
# Duplicate all partners in batches of 30:
self.delayable().set(description='Copy Partners').copy().split(30).delay()
# ...
self.env['res.partner'].search([], limit=1000).copy_all_partners()
The split function on Delayable returns a DelayableGroup.
This is an attempt and I am open to suggestions
Hi @guewen, some modules you are maintaining are being modified, check this out!
The coverage does not seem to include the unittest :/
The coverage does not seem to include the unittest :/
Import the new test in tests/__init__.py
They weren't run as they were unitest.TestCase, I changed them to TransactionCase for odoo to run them.
I added a chain parameter to split into a chain instead of a group.
Is there anything lacking for this to be merged?
Is there anything lacking for this to be merged?
Just the attention of @OCA/connector-maintainers
This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
As this is not touching any existing feature and is not adding a lot of code IMO we can move on w/ the merge. Yet, I think we miss a bit of documentation. Can you add something to the README pls?
Done
/ocabot merge minor
On my way to merge this fine PR! Prepared branch 14.0-ocabot-merge-pr-658-by-simahawk-bump-minor, awaiting test results.
Congratulations, your PR was merged at cf2ff24f186468af40cfc27ddaa3d59959875496. Thanks a lot for contributing to OCA. ❤️