Skip to content
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

[17.0][MIG] queue_job + test_queue_job: Migration to 17.0 #593

Merged
merged 1,160 commits into from
Dec 5, 2023
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Nov 24, 2023

  1. Configuration menu
    Copy the full SHA
    625be78 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    35a36f5 View commit details
    Browse the repository at this point in the history
  3. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f795f3e View commit details
    Browse the repository at this point in the history
  4. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f559149 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    44c63b8 View commit details
    Browse the repository at this point in the history
  6. queue_job 15.0.1.0.1

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c0666bc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    68bb768 View commit details
    Browse the repository at this point in the history
  8. Translated using Weblate (Spanish)

    Currently translated at 3.7% (5 of 135 strings)
    
    Translation: queue-15.0/queue-15.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/es/
    yajo authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    77249c3 View commit details
    Browse the repository at this point in the history
  9. Translated using Weblate (Spanish)

    Currently translated at 100.0% (135 of 135 strings)
    
    Translation: queue-15.0/queue-15.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/es/
    yajo authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    384af18 View commit details
    Browse the repository at this point in the history
  10. Translated using Weblate (Chinese (Simplified))

    Currently translated at 83.2% (114 of 137 strings)
    
    Translation: queue-15.0/queue-15.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/zh_CN/
    dong-z authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3d1db14 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5528589 View commit details
    Browse the repository at this point in the history
  12. queue_job 15.0.1.0.2

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    255f4f0 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    cbf576c View commit details
    Browse the repository at this point in the history
  14. Initialize 16.0

    sbidoul authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    b8f75af View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ea6e888 View commit details
    Browse the repository at this point in the history
  16. [FIX] import mock from unittest

    baimont authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    389b2d0 View commit details
    Browse the repository at this point in the history
  17. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    b8ac146 View commit details
    Browse the repository at this point in the history
  18. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    cb42932 View commit details
    Browse the repository at this point in the history
  19. queue_job: fix typo in USAGE.rst

    em230418 authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    552f843 View commit details
    Browse the repository at this point in the history
  20. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    5d5b901 View commit details
    Browse the repository at this point in the history
  21. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    28d5d94 View commit details
    Browse the repository at this point in the history
  22. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    34b2ed4 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    974a9bb View commit details
    Browse the repository at this point in the history
  24. Disable storing of context in jobs recordsets by default

    It can still be activated by overriding a method.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    35078f9 View commit details
    Browse the repository at this point in the history
  25. [FIX] queue_job: Add base_sparse_field dependency to prevent errors i…

    …n test if addon not loaded.
    
    TT35938
    victoralmau authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f4a5690 View commit details
    Browse the repository at this point in the history
  26. [FIX] queue_job: Update documentation to remove unnecessary addon (ba…

    …se_sparse_field) from server_wide_modules.
    
    OCA#443 (comment)
    victoralmau authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3fef9e4 View commit details
    Browse the repository at this point in the history
  27. queue_job - activate the base context keys

    Co-authored-by: Stéphane Bidoul <[email protected]>
    2 people authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    d90e60c View commit details
    Browse the repository at this point in the history
  28. add jobrunner cli

    sbidoul authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    abac658 View commit details
    Browse the repository at this point in the history
  29. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    07f3017 View commit details
    Browse the repository at this point in the history
  30. queue_job 16.0.1.0.1

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    333005a View commit details
    Browse the repository at this point in the history
  31. queue_job 16.0.1.0.2

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    948f51f View commit details
    Browse the repository at this point in the history
  32. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    19deecf View commit details
    Browse the repository at this point in the history
  33. queue_job 16.0.1.1.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    7ccb3b2 View commit details
    Browse the repository at this point in the history
  34. Translated using Weblate (German)

    Currently translated at 86.3% (114 of 132 strings)
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/de/
    marylla authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    5ba157f View commit details
    Browse the repository at this point in the history
  35. [DOC] describe how to write queue.job.function in case of function de…

    …fined in abstract model
    legalsylvain authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    7174e69 View commit details
    Browse the repository at this point in the history
  36. Change technical fields to read-only

    These fields should not be changed by users.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    bbebe99 View commit details
    Browse the repository at this point in the history
  37. Optimize queue.job creation

    Several fields on queue.job are initialized using computed fields,
    then never changed again. On creation of a queue.job record, we'll have
    an initial INSERT + at least one following UPDATE for the computed
    fields.
    
    Replace all the stored computed fields by a raw initialization of the
    values in `Job.store()` when the job is created, so we have only a
    single INSERT.
    
    Highlights:
    
    * as channel is no longer a compute/inverse field, override_channel is
      useless, I dropped it (actually the same value was stored in both
      channel and override_channel as the channel field was stored)
    * one functional diff is that now, when changing a channel on a
      job.function, the channel is no longer synchronized on existing jobs,
      it will be applied only on new jobs: actually this is an improvement,
      because it was impossible to change the channel of a job function
      in a large queue_job table as it meant writing on all the done/started
      jobs
    * searching the queue.job.function is now cached, as each job using the
      same will run a query on queue_job_function
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    feb6759 View commit details
    Browse the repository at this point in the history
  38. Remove initial create notification and follower

    Everytime a job is created, a mail.message "Queue Job created" is
    created. This is useless, as we already have the creation date and user,
    and nobody will ever want to receive a notification for a created job
    anyway.
    
    Removing the on creation auto-subscription of the user that created the
    job makes sense as well since we automatically subscribe the queue job
    managers for failures. Add the owner of the jobs to the followers on
    failures only as well.
    
    It allows to remove a lot of insertions of records (and of deletions
    when autovacuuming jobs).
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    21b4db7 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    cd00723 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    ff655be View commit details
    Browse the repository at this point in the history
  41. Fix missing rollback on retried jobs

    When RetryableJobError was raised, any change done by the job was not
    rollbacked.
    
    Using `raise` would throw the exception up to the core and rollback, but
    we would have a stack trace in the logs for each try. Calling rollback
    manually (rollback also clears the env) hide the tracebacks, however,
    when the last try fails, the full traceback is still shown in the logs.
    
    Fixes OCA#261
    wpichler authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    091fab9 View commit details
    Browse the repository at this point in the history
  42. Fix date_done set when state changes back to pending

    When Job.date_done has been set, for instance because the job has been
    performed, if the job is set back to pending (e.g. a RetryableJobError
    is raised), the date_done is kept.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    cd1c0db View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    c130c64 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    4158ab1 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    aaa2df6 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    3b3c651 View commit details
    Browse the repository at this point in the history
  47. Fix display on exec_time on tree view as seconds

    The float_time widget shows hours seconds, we only want seconds.
    The widget had been removed on the form view, but not on the tree view.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    af0b634 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    95c7ea7 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    e08e3a5 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    bb600b8 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    8a1bb53 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    38cd2ed View commit details
    Browse the repository at this point in the history
  53. [IMP] queue_job: tests for wizards

    hbrunn authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    491c4cb View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    60fceb1 View commit details
    Browse the repository at this point in the history
  55. queue_job: use parent channel if configured

    Use case:
    
    * you have a root channel per scope/app (eg: root.edi)
    * you have several sub channels (eg: root.edi.ubl.sales,
    root.edi.gs1.delivery)
    * you want to configure capacity only for the main channel "root.edi"
    
    Before this change, the channel manager falls back on root channel.
    However, if you have a specific parent channel configured
    it sounds a good idea to use it.
    simahawk authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    2b45ebc View commit details
    Browse the repository at this point in the history
  56. queue_job: update contributors

    Contributing since a while... :)
    simahawk authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    5d39360 View commit details
    Browse the repository at this point in the history
  57. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    90b4c23 View commit details
    Browse the repository at this point in the history
  58. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c2ebe8b View commit details
    Browse the repository at this point in the history
  59. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-15.0/queue-15.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    cc6b2c4 View commit details
    Browse the repository at this point in the history
  60. Store dependencies

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    8fe4005 View commit details
    Browse the repository at this point in the history
  61. Add wait dependencies state

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0fccd0e View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    ab4df44 View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    bca9bb4 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    ab54369 View commit details
    Browse the repository at this point in the history
  65. Add API for Delayables

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    503f688 View commit details
    Browse the repository at this point in the history
  66. Fix tests failing when test_queue_job is installed

    test_queue_job will create channels root.sub and root.sub.sub, so the
    tests doing the same thing will fail with a unique constraint error.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    d4cb839 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    9f3c5bf View commit details
    Browse the repository at this point in the history
  68. Show the dependency widget in a tab

    When displayed in a tab, the widget show the nodes offset, the d3
    network is probably confused by the size or visibility of its canvas.
    Install a listener on tabs to trigger a fit() on the network.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    4637be8 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    b734dca View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    13809fa View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    44c2c6a View commit details
    Browse the repository at this point in the history
  72. Add documentation

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    89261e7 View commit details
    Browse the repository at this point in the history
  73. Add a graph UUID

    A graph of jobs always share the same graph_uuid, which can be
    used to group jobs, but is also a faster way to find all the jobs
    of the graph. Then we can use the dependencies field to build the
    whole graph from the pre-selection of jobs.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    ea95bef View commit details
    Browse the repository at this point in the history
  74. Hide some technical fields

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    1e059bb View commit details
    Browse the repository at this point in the history
  75. Ignore requeues on dependency jobs waiting on parent jobs

    Jobs waiting that their dependencies are executed cannot be requeued.
    They have to keep waiting their turn.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3d75d36 View commit details
    Browse the repository at this point in the history
  76. Fix lint

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    547d383 View commit details
    Browse the repository at this point in the history
  77. Update vis-network js

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    16e81e7 View commit details
    Browse the repository at this point in the history
  78. Configuration menu
    Copy the full SHA
    aa5a7af View commit details
    Browse the repository at this point in the history
  79. Add powerful context manager for running tests on jobs

    * mock_jobs context manager with assert methods to check enqueued jobs
    * jobs are not stored in database, yet they can be inspected and performed
      during the test
    * the context manager works with graphs enqueued by delayable and with with_delay()
    * direct execution of jobs works with graphs by executing them synchronously
      following their topological sort
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    273782a View commit details
    Browse the repository at this point in the history
  80. Set graph_uuid only once in DelayableGraph

    The previous implementation was incomplete, as it was setting
    the graph_uuid when `Job.add_depends()` was called. It had the
    advantage of being correct when (for e.g. a test) manually created
    a Job and called `add_depends()`, but it could not work when in
    some situations involving a group where one of the job has no job
    depending on it.
    
    Also, remove ``Job.add_reverse_depends()`` which is not used.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    dd25688 View commit details
    Browse the repository at this point in the history
  81. Configuration menu
    Copy the full SHA
    83719b1 View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    f752d72 View commit details
    Browse the repository at this point in the history
  83. Improve graph widget

    * Fix a js bug when there is no graph.
    * Use a single read group for multiple jobs
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    6017a8c View commit details
    Browse the repository at this point in the history
  84. Configuration menu
    Copy the full SHA
    d959c0a View commit details
    Browse the repository at this point in the history
  85. ix duplicate label

    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    683b466 View commit details
    Browse the repository at this point in the history
  86. Configuration menu
    Copy the full SHA
    3af044b View commit details
    Browse the repository at this point in the history
  87. Improve graph widget performance

    When showing large graphs, like 300 jobs (not really a real life case maybe),
    the graph takes a dozen of seconds to render. Disabling the stabilization
    helps a lot.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f719995 View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    e3f01b0 View commit details
    Browse the repository at this point in the history
  89. Fix things required by odoo 14.0 or python 3.9

    * Renaming the TestXxx models in test_queue_job is because of pytest that
      complains, confusing them for test classes
    * logger.warn is deprecated in favor of logger.warning
    * Add invalidation of cache in SQL update that enqueue dependent jobs
    * Flush in a test, the same is done currently in the controller
    * Weird one: we can no longer compare the bound methods of the models,
      compare their __func__ which is equal.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    a34078f View commit details
    Browse the repository at this point in the history
  90. Configuration menu
    Copy the full SHA
    08a0951 View commit details
    Browse the repository at this point in the history
  91. Fix equality of enqueued jobs

    The assert fails to show the method's details if we store the __func__ in JobCall.
    Anyway, it was hackish to change the content of "method".
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f57efbd View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    0ec407e View commit details
    Browse the repository at this point in the history
  93. Rename mock_jobs() to trap_jobs()

    The fact that mocks are used is an implementation detail, and is actually
    hidden to the end user of the test API.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    02d1f8f View commit details
    Browse the repository at this point in the history
  94. Rename dependency method done() to on_done()

    on_done() is maybe a better choice, it is less ambiguous than then() (clearer
    on the fact it happens on done()) and done() (less confusion with set_done()).
    I'll do the renaming soon, unless you have other suggestions.
    
    Ref: OCA#154 (comment)
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    60ca441 View commit details
    Browse the repository at this point in the history
  95. Configuration menu
    Copy the full SHA
    e257060 View commit details
    Browse the repository at this point in the history
  96. Configuration menu
    Copy the full SHA
    da82ed3 View commit details
    Browse the repository at this point in the history
  97. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    bed371b View commit details
    Browse the repository at this point in the history
  98. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    8c114fd View commit details
    Browse the repository at this point in the history
  99. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-15.0/queue-15.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    38ab83c View commit details
    Browse the repository at this point in the history
  100. [MIG] queue_job, test_queue_job: Forward port queue from 15.0

    This forward port takes all the changes from 15.0 not yet into 16.0
    up to OCA@173b6ca
    
    This FP contains the new queue dependencies functionality.
    The dedicated widget used to display the dependecies graph on the job
    form is also migrated to owl
    lmignon authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    bdad9c9 View commit details
    Browse the repository at this point in the history
  101. Configuration menu
    Copy the full SHA
    9016a67 View commit details
    Browse the repository at this point in the history
  102. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    24e33db View commit details
    Browse the repository at this point in the history
  103. queue_job 16.0.2.0.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    6cb22e2 View commit details
    Browse the repository at this point in the history
  104. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c4854fd View commit details
    Browse the repository at this point in the history
  105. Configuration menu
    Copy the full SHA
    c276ec5 View commit details
    Browse the repository at this point in the history
  106. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    b9e4627 View commit details
    Browse the repository at this point in the history
  107. queue_job 16.0.2.1.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c860bbb View commit details
    Browse the repository at this point in the history
  108. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    bf3046a View commit details
    Browse the repository at this point in the history
  109. [FIX] Patch Request._get_session_and_dbname to get db from URL

    In servers with multiple databases db is not captured from URL when
    processing jobs in /queue_job/runjob
    
    With this patch db is set from the db param in URL when calling
    the runjob endpoint
    
    Fixes OCA#503
    hugosantosred authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    ddb8a4d View commit details
    Browse the repository at this point in the history
  110. [FIX] queue_job: Commit was removed, but that could be a problem if y…

    …ou generated too much records
    etobella authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    6cec77b View commit details
    Browse the repository at this point in the history
  111. Translated using Weblate (Spanish)

    Currently translated at 82.0% (128 of 156 strings)
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/es/
    FranciscoFactorLibre authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    8712495 View commit details
    Browse the repository at this point in the history
  112. Configuration menu
    Copy the full SHA
    cd301cb View commit details
    Browse the repository at this point in the history
  113. Fix cursor already closed error on retryable errors

    When a job is postponed because of a retryable error, as the error
    is not re-raised, we reach the new method
    
        self._enqueue_dependent_jobs(env, job)
    
    With a closed cursor. Return early in case of postponing, as there is
    no chance dependent jobs can become pending anyway.
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    4376bb2 View commit details
    Browse the repository at this point in the history
  114. [IMP] queue_job: add configuration options for

    jobrunner_db_user, jobrunner_db_password
    repodevs authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e901be2 View commit details
    Browse the repository at this point in the history
  115. Configuration menu
    Copy the full SHA
    d965c03 View commit details
    Browse the repository at this point in the history
  116. queue_job 16.0.2.2.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    21f3c5c View commit details
    Browse the repository at this point in the history
  117. queue_job: unify no delay option

    Current situation:
    
    * multiple keys for no good reason
    * half baked: not all of them used everywhere
    * no centralization
    * poor naming
    
    With this change we'll have:
    
    * 1 and only one key to disable via ctx: ``queue_job__no_delay``
    * 1 and only one key to disable via os env: ``QUEUE_JOB__NO_DELAY``
    * backward compatibility with deprecation for old keys
    simahawk authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    6692e96 View commit details
    Browse the repository at this point in the history
  118. queue_job 16.0.2.2.1

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    258874d View commit details
    Browse the repository at this point in the history
  119. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    67655e1 View commit details
    Browse the repository at this point in the history
  120. queue_job 16.0.2.3.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0e5a50b View commit details
    Browse the repository at this point in the history
  121. Configuration menu
    Copy the full SHA
    6b6ccde View commit details
    Browse the repository at this point in the history
  122. queue_job 16.0.2.3.1

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e6699a9 View commit details
    Browse the repository at this point in the history
  123. Fix trap_jobs() recordset comparison

    The trap_jobs() test helper accepts any model/recordset as long
    as the job function is the same, which is not enough to verify that
    the job has been delayed on the expected recordset or model.
    
    Tested job functions are "bound methods" so we can compare their `__self__`.
    
    Example of assertion that would be valid:
    
      partner = self.env["res.partner"].create({"name": "foo"})
      with trap_jobs() as trap:
        partner.with_delay().do_something(42)
        trap.assert_enqueued_job(
            self.env["res.partner"].do_something,
            args=(42,)
        )
        trap.assert_jobs_count(1, only=self.env["res.partner"].do_something)
    
    Now, it would fail with an error message like:
    
    E           AssertionError: Job <res.partner()>.do_something(42) with properties (channel=root.test, description=Do something, eta=15, identity_key=<function identity_exact at 0x7f01bfb54cb0>, max_retries=1, priority=15) was not enqueued.
    E           Actual enqueued jobs:
    E            * <res.partner(64,)>.do_something(42) with properties (priority=15, max_retries=1, eta=15, description=Do something, channel=root.test, identity_key=<function identity_exact at 0x7f01bfb54cb0>)
    guewen authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    d79cfac View commit details
    Browse the repository at this point in the history
  124. Translated using Weblate (Spanish)

    Currently translated at 98.0% (153 of 156 strings)
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/es/
    ramiadavid authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    16f6193 View commit details
    Browse the repository at this point in the history
  125. Translated using Weblate (Spanish)

    Currently translated at 100.0% (156 of 156 strings)
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/es/
    ramiadavid authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f3053ea View commit details
    Browse the repository at this point in the history
  126. queue_job 16.0.2.3.2

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    77cb4e8 View commit details
    Browse the repository at this point in the history
  127. queue_job 16.0.2.4.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    230f4b0 View commit details
    Browse the repository at this point in the history
  128. [FIX] queue_job: runner - filedescriptor out of range in select

    Use the most efficient Selector implementation available on the current platform
    
    Odoo supports only SelectSelector but it is a little obsolete
    
    python >= 3.4 supports a new high-level library Selectors:
     - https://docs.python.org/es/3/library/selectors.html
    
    It could to auto-choose the following ones:
     - SelectSelector
     - PollSelector
     - EpollSelector
     - DevpollSelector
     - KqueueSelector
    
    Using the DefaultSelector class the most efficient implementation available on the current platform will be use:
     - https://docs.python.org/3/library/selectors.html#selectors.DefaultSelector
    
    It helps to support better the resources of the system
    
    Using SelectSelector you are not able to run workers >=255
    
    If you set `ulimit -n 10240` and run `odoo-bin --workers=255`
    the following error is raised:
    
        Traceback (most recent call last):
        File "odoo/service/server.py", line 926, in run
            self.sleep()
        File "odoo/service/server.py", line 852, in sleep
            sel.select(self.beat)
        File "python3.8/lib/python3.8/selectors.py", line 323, in select
            r, w, _ = self._select(self._readers, self._writers, [], timeout)
        ValueError: filedescriptor out of range in select()
    
    But using PollSelector it is not reproduced even using more workers
    
    Most of platform supports PollSelector but using DefaultSelector we can be sure
    that even too old system are supported too
    
    And using this High-level library will allow to use the future new improvements
    
    e.g. Epoll has better performance improvements
    
    More info about:
     - https://devarea.com/linux-io-multiplexing-select-vs-poll-vs-epoll
     - redis/redis-py#486
     - odoo/odoo#84684
    moylop260 authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0c7ab9f View commit details
    Browse the repository at this point in the history
  129. queue_job 16.0.2.5.0

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c0427c1 View commit details
    Browse the repository at this point in the history
  130. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    6741071 View commit details
    Browse the repository at this point in the history
  131. [UPD] README.rst

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    fad27f2 View commit details
    Browse the repository at this point in the history
  132. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    5dce1a5 View commit details
    Browse the repository at this point in the history
  133. Translated using Weblate (Spanish)

    Currently translated at 100.0% (156 of 156 strings)
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/es/
    Ivorra78 authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    acb5985 View commit details
    Browse the repository at this point in the history
  134. Translated using Weblate (Spanish)

    Currently translated at 100.0% (156 of 156 strings)
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/es/
    Ivorra78 authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    da0844e View commit details
    Browse the repository at this point in the history
  135. [UPD] Update queue_job.pot

    oca-ci authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    17c1960 View commit details
    Browse the repository at this point in the history
  136. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
    weblate authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    2e83ab6 View commit details
    Browse the repository at this point in the history
  137. [IMP] queue_job: identity_key enhancements

    1. In production, a job which is waiting dependencies or which
    has started, but not completed, should not be repeated if
    the identity_key matches.
    
    2. In tests, the mock queue handler is now enhanced to allow
    better mimicking of the identity_key blocks from production.
    
    3. In tests, the mock queue handler now clears the enqueued jobs
    after performing them, to better reproduce what a production
    environment would do.
    Richard deMeester authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e4284bc View commit details
    Browse the repository at this point in the history
  138. queue_job: job_record_with_same_identity_key ignore STARTED

    Good explanation from Guewen:
    
    Depending on the use case, we should or should not include.
    As part of my current work, I use Sidekiq daily.
    They have a similar feature, but you can set a per-job parameter unique_until with options:
    start (that would mean up to ENQUEUED here) or success (that would be up to STARTED here).
    
    Think about this use case: a job refreshes a cache. Data have changed, we create a pending job. Data change again, no new job because the job is still pending.
    Job starts. Data change while the job is running. In this very case, we'd like to enqueue a new job otherwise the cache will be outdated.
    
    I reckon that both cases are valid, but I fear adding this state in the domain may, silently and in subtle ways, existing behaviors.
    simahawk authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    b50a377 View commit details
    Browse the repository at this point in the history
  139. FIX queue_job avoiding AccessDenied when loading the module in an ins…

    …tance with list_db = False
    
    The scenario is a multi database environment where you can't set db_name as the databases change frequently and you use dbfilter to allow users to access their DB according to domain
    eLBati authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    03414a8 View commit details
    Browse the repository at this point in the history
  140. Configuration menu
    Copy the full SHA
    d0c22ce View commit details
    Browse the repository at this point in the history
  141. [BOT] post-merge updates

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    89df542 View commit details
    Browse the repository at this point in the history
  142. [BOT] post-merge updates

    OCA-git-bot authored and nguyenminhchien committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    bf2b504 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. Configuration menu
    Copy the full SHA
    b919821 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Make tests pass

    Separate tests that need special methods in a dedicated test_queue_job
    module.
    
    Rework the registry of the jobs. The 'job' decorator is applied on
    functions before they are bound to their class, so we don't know the
    class yet. Now, the decorator marks job methods with 'delayable' and
    when a model is registered (Base._register_hook), it looks for the
    marked methods and register them.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    cf0e991 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    acc72e0 View commit details
    Browse the repository at this point in the history
  3. Move tests using queue_job.testing_method in test_queue_job

    To avoid to pollute 'queue.job.function' with a test job.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    acf5c2f View commit details
    Browse the repository at this point in the history
  4. Fix mutability of job arguments

    The model name, method name, recordset ids, arguments and keyword
    arguments must never ever be modified after the creation of a job.
    This change fix a bug when a job with a mutable argument see the content
    of the argument being modified during the execution of a job.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    23bfdb0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6518065 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cfb0242 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f480e8b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    34037d7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d02bc5d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a5a4371 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ac55783 View commit details
    Browse the repository at this point in the history
  12. Fix auto registration of job methods and channels

    The automatic registration of job methods and their defaut channel
    has been a bit chaotic. The initial version for the new Odoo API could
    crashing as soon as a method was decorated by @Property. There is
    such a property in the code code, the method '_cache'.
    
    The problem of the crash was that, the introspection basically uses a
    'getattr' on every attribute of the instance. The '_cache' method
    could then be called on an empty recordset, which is not supported by
    '_cache'.
    
    A first correction (49d8f37) was to naively skip the '_cache' method
    from the introspection.
    
    In any case, it is wrong to access the property of an instance only to
    instrospect its members.  That's why the correction 4ebb245 changed the
    inspection from the instance to the class.
    
    Properties are no longer accessed, however this correction was not
    correct for Python 3. When members of the class are introspected, they
    are neither bound neither unbound methods. they are mere functions.
    
    The change here is to lookup for functions. _register_job must now takes
    the model as input argument, because there is no way to get the name of
    the model from the function.
    
    Closes OCA#64
    Follows OCA#50
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    cd2a1de View commit details
    Browse the repository at this point in the history
  13. Add default related action to open related records

    The related action button now opens by default the record on which the
    job is working. It uses the default views of the job. The exact behavior
    depends of the number of records in the job:
    
    * No record (job called on a  model): display a message indicating that
    there is no available action
    * One record: open the default view in form
    * Several records: open the default view in list
    
    The related action can still be overridden by the 'related_action'
    decorator.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    10535a9 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    aee6178 View commit details
    Browse the repository at this point in the history
  15. Migrate queue_job to 12.0

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    9eb6df0 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    400caa9 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    e076a02 View commit details
    Browse the repository at this point in the history
  18. [ADD] icon.png

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    2d34369 View commit details
    Browse the repository at this point in the history
  19. [ADD] Test case for "AutoVacuum Job Queue" cron job

    Naglis Jonaitis authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6725e35 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    fd19ed8 View commit details
    Browse the repository at this point in the history
  21. Translated using Weblate (Chinese (Simplified))

    Currently translated at 100.0% (12 of 12 strings)
    
    Translation: queue-12.0/queue-12.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-12-0/queue-12-0-test_queue_job/zh_CN/
    liweijie0812 authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    7462080 View commit details
    Browse the repository at this point in the history
  22. Set modules as uninstallable

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6a73a04 View commit details
    Browse the repository at this point in the history
  23. Migrate queue_job

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    018a097 View commit details
    Browse the repository at this point in the history
  24. Replace sudo(user) by with_user(user)

    The former syntax is deprecated
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    dc500aa View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    c41b8f7 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    a4e7995 View commit details
    Browse the repository at this point in the history
  27. Use more permissive license AGPL3 → LGPL3

    This change has been done and accepted on the component and connector
    addons: OCA/connector#356
    
    This is a low-level technical module, we may need to use jobs on
    enterprise features.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    2772a97 View commit details
    Browse the repository at this point in the history
  28. queue_job: allow to define vacuum removal interval per channel

    Cédric Pigeon authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    63ed9e2 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    484919d View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    1f87ac1 View commit details
    Browse the repository at this point in the history
  31. Store worker's PID when a job is started

    Add a field in the "queue_job" model to store the worker pid.
    No usage for new besides "logging" for debugging (helps to find which
    process to investigate in case a job is stuck).
    Later, it may be useful to improve the recovery of job that stay in the
    wrong state when the job runner restarts.
    
    Closes OCA#177
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    d4550e0 View commit details
    Browse the repository at this point in the history
  32. Deprecate job decorators

    * @job and @related_action are still supported but emit warnings and
      will be removed at some point (code to remove has a TODO with
      :job-no-decorator:)
    * the options previously set by the decorators are now stored on
      "queue.job.function" records, which can be explicitly created
      as XML records (and then editable!)
    * any method can be used with "with_delay()", if no "queue.job.function"
      exists, default values are used (root channel, default related
      action, ...)
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    9037f1d View commit details
    Browse the repository at this point in the history
  33. Replace job function name by model + method fields

    A many2one to select the model + a char for the method name is more
    convenient and error-proof than having to type the expected format
    correctly.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    2a4ca5a View commit details
    Browse the repository at this point in the history
  34. test_queue_job 13.0.2.0.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    054ea2b View commit details
    Browse the repository at this point in the history
  35. test_queue_job 13.0.2.1.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    37d1af7 View commit details
    Browse the repository at this point in the history
  36. Refactor user_id,model_name,record_ids fields on queue.job

    These fields contain the current model and record ids and user id the
    job works on.
    Storing them as separate fields does not allow to take benefits on the
    "JobSerialized" field, which keeps the original user, and later the 'su'
    flag. We could store the context there as well (or a cleaned one).
    
    Use computed fields to keep the model_name, record_ids, user_id fields for
    backward compatibility. The model_name should stay anyway for the
    searches on the UI, and the user_id for the same reason + possibility to
    edit the user.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    b935818 View commit details
    Browse the repository at this point in the history
  37. Store 'su' flag in records stored in JobSerialized fields

    Which means that the record the job is working on, or any record
    argument of the job keeps the 'su' flag.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    bc11fbf View commit details
    Browse the repository at this point in the history
  38. [MIG] init V14 repo

    - set module uninstallable
    - add new .dot file config for v14
    sebastienbeau authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    aaa66fb View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    8299cf7 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    2c9a85a View commit details
    Browse the repository at this point in the history
  41. [MIG] finish migration

    sebastienbeau authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    ecfc054 View commit details
    Browse the repository at this point in the history
  42. Add import shortcut for identity_exact

    Now that the `@job` decorater is deleted, `identity_exact` is the only
    thing we may need to import from "job.py".
    Being able to import it from "odoo.addons.queue_job" is nicer than
    from "odoo.addons.queue_job.job".
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    25dff8a View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    bb49e61 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    70d0429 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    0791f4b View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    f73fd59 View commit details
    Browse the repository at this point in the history
  47. [ADD] Apply suggestions from code review

    Co-authored-by: Simone Orsi <[email protected]>
    2 people authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    beb5c45 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    ef3cef6 View commit details
    Browse the repository at this point in the history
  49. test_queue_job 14.0.1.1.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    4a45797 View commit details
    Browse the repository at this point in the history
  50. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-14.0/queue-14.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-14-0/queue-14-0-test_queue_job/
    oca-transbot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    33b0740 View commit details
    Browse the repository at this point in the history
  51. Revert "[14.0] [IMP] Store job execution information + wizard to term…

    …inate a job + test"
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    fa53f27 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    d17f54f View commit details
    Browse the repository at this point in the history
  53. test_queue_job 14.0.1.2.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    a1c39e9 View commit details
    Browse the repository at this point in the history
  54. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-14.0/queue-14.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-14-0/queue-14-0-test_queue_job/
    oca-transbot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    edeb45a View commit details
    Browse the repository at this point in the history
  55. Add method to patch a method to be automatically delayed

    This patch method has to be called in ``_register_hook``.
    
    When a method is patched, any call to the method will not directly
    execute the method's body, but will instead enqueue a job.
    
    When a ``context_key`` is set when calling ``_patch_job_auto_delay``,
    the patched method is automatically delayed only when this key is
    ``True`` in the caller's context. It is advised to patch the method
    with a ``context_key``, because making the automatic delay *in any
    case* can produce nasty and unexpected side effects (e.g. another
    module calls the method and expects it to be computed before doing
    something else, expecting a result, ...).
    
    A typical use case is when a method in a module we don't control is called
    synchronously in the middle of another method, and we'd like all the calls
    to this method become asynchronous.
    
    It relies on OCA#274 that deprecates the
    `@job` decorator.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6caa121 View commit details
    Browse the repository at this point in the history
  56. test_queue_job 14.0.1.3.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    0371a57 View commit details
    Browse the repository at this point in the history
  57. Set modules as uninstallable

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    403c0c4 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    c0de15d View commit details
    Browse the repository at this point in the history
  59. Run pre-commit run -a

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    8148771 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    552e961 View commit details
    Browse the repository at this point in the history
  61. [UPD] Update test_queue_job.pot

    oca-ci authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    444950c View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    88a3b1d View commit details
    Browse the repository at this point in the history
  63. Initialize 16.0

    sbidoul authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    1755e2d View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    0b165f9 View commit details
    Browse the repository at this point in the history
  65. [FIX] import mock from unittest

    baimont authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    80b533a View commit details
    Browse the repository at this point in the history
  66. [UPD] Update test_queue_job.pot

    oca-ci authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    b06680a View commit details
    Browse the repository at this point in the history
  67. [UPD] Update test_queue_job.pot

    oca-ci authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    003dbf0 View commit details
    Browse the repository at this point in the history
  68. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_queue_job/
    weblate authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    ef53d43 View commit details
    Browse the repository at this point in the history
  69. Disable storing of context in jobs recordsets by default

    It can still be activated by overriding a method.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    442df9d View commit details
    Browse the repository at this point in the history
  70. test_queue_job 16.0.1.0.1

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    ffb9920 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    cbd29b9 View commit details
    Browse the repository at this point in the history
  72. Translated using Weblate (German)

    Currently translated at 75.0% (9 of 12 strings)
    
    Translation: queue-16.0/queue-16.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_queue_job/de/
    marylla authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    e632e1c View commit details
    Browse the repository at this point in the history
  73. Remove initial create notification and follower

    Everytime a job is created, a mail.message "Queue Job created" is
    created. This is useless, as we already have the creation date and user,
    and nobody will ever want to receive a notification for a created job
    anyway.
    
    Removing the on creation auto-subscription of the user that created the
    job makes sense as well since we automatically subscribe the queue job
    managers for failures. Add the owner of the jobs to the followers on
    failures only as well.
    
    It allows to remove a lot of insertions of records (and of deletions
    when autovacuuming jobs).
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    87ad457 View commit details
    Browse the repository at this point in the history
  74. Configuration menu
    Copy the full SHA
    8497a81 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    6c292d7 View commit details
    Browse the repository at this point in the history
  76. Configuration menu
    Copy the full SHA
    e3aba02 View commit details
    Browse the repository at this point in the history
  77. [UPD] Update test_queue_job.pot

    oca-ci authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    8032dce View commit details
    Browse the repository at this point in the history
  78. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-15.0/queue-15.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-test_queue_job/
    weblate authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6cf89cb View commit details
    Browse the repository at this point in the history
  79. Store dependencies

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    9812291 View commit details
    Browse the repository at this point in the history
  80. Add wait dependencies state

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    59ec1c0 View commit details
    Browse the repository at this point in the history
  81. Add API for Delayables

    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    7ad95b1 View commit details
    Browse the repository at this point in the history
  82. Add a graph UUID

    A graph of jobs always share the same graph_uuid, which can be
    used to group jobs, but is also a faster way to find all the jobs
    of the graph. Then we can use the dependencies field to build the
    whole graph from the pre-selection of jobs.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    431b1b2 View commit details
    Browse the repository at this point in the history
  83. Ignore requeues on dependency jobs waiting on parent jobs

    Jobs waiting that their dependencies are executed cannot be requeued.
    They have to keep waiting their turn.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    99c03a1 View commit details
    Browse the repository at this point in the history
  84. Fix warnings in tests

    As jobs are created in the setup, but not always delayed,
    the __del__ warning that the job was not delayed is triggered.
    Create only the jobs necessary for each test.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    e262e37 View commit details
    Browse the repository at this point in the history
  85. Configuration menu
    Copy the full SHA
    b974e1c View commit details
    Browse the repository at this point in the history
  86. Add powerful context manager for running tests on jobs

    * mock_jobs context manager with assert methods to check enqueued jobs
    * jobs are not stored in database, yet they can be inspected and performed
      during the test
    * the context manager works with graphs enqueued by delayable and with with_delay()
    * direct execution of jobs works with graphs by executing them synchronously
      following their topological sort
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    b0bc513 View commit details
    Browse the repository at this point in the history
  87. Set graph_uuid only once in DelayableGraph

    The previous implementation was incomplete, as it was setting
    the graph_uuid when `Job.add_depends()` was called. It had the
    advantage of being correct when (for e.g. a test) manually created
    a Job and called `add_depends()`, but it could not work when in
    some situations involving a group where one of the job has no job
    depending on it.
    
    Also, remove ``Job.add_reverse_depends()`` which is not used.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    d120e48 View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    4cbc103 View commit details
    Browse the repository at this point in the history
  89. Fix things required by odoo 14.0 or python 3.9

    * Renaming the TestXxx models in test_queue_job is because of pytest that
      complains, confusing them for test classes
    * logger.warn is deprecated in favor of logger.warning
    * Add invalidation of cache in SQL update that enqueue dependent jobs
    * Flush in a test, the same is done currently in the controller
    * Weird one: we can no longer compare the bound methods of the models,
      compare their __func__ which is equal.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    a4c7318 View commit details
    Browse the repository at this point in the history
  90. Rename mock_jobs() to trap_jobs()

    The fact that mocks are used is an implementation detail, and is actually
    hidden to the end user of the test API.
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    dca7b11 View commit details
    Browse the repository at this point in the history
  91. Rename dependency method done() to on_done()

    on_done() is maybe a better choice, it is less ambiguous than then() (clearer
    on the fact it happens on done()) and done() (less confusion with set_done()).
    I'll do the renaming soon, unless you have other suggestions.
    
    Ref: OCA#154 (comment)
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    eb172a7 View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    ccad49f View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    1b4f6f2 View commit details
    Browse the repository at this point in the history
  94. [MIG] queue_job, test_queue_job: Forward port queue from 15.0

    This forward port takes all the changes from 15.0 not yet into 16.0
    up to OCA@173b6ca
    
    This FP contains the new queue dependencies functionality.
    The dedicated widget used to display the dependecies graph on the job
    form is also migrated to owl
    lmignon authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    a3b8f83 View commit details
    Browse the repository at this point in the history
  95. test_queue_job 16.0.2.0.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    5767a10 View commit details
    Browse the repository at this point in the history
  96. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: queue-16.0/queue-16.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_queue_job/
    weblate authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    d513861 View commit details
    Browse the repository at this point in the history
  97. queue_job: unify no delay option

    Current situation:
    
    * multiple keys for no good reason
    * half baked: not all of them used everywhere
    * no centralization
    * poor naming
    
    With this change we'll have:
    
    * 1 and only one key to disable via ctx: ``queue_job__no_delay``
    * 1 and only one key to disable via os env: ``QUEUE_JOB__NO_DELAY``
    * backward compatibility with deprecation for old keys
    simahawk authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    3cf3d8c View commit details
    Browse the repository at this point in the history
  98. test_queue_job 16.0.2.1.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    1f3ae3a View commit details
    Browse the repository at this point in the history
  99. Fix trap_jobs() recordset comparison

    The trap_jobs() test helper accepts any model/recordset as long
    as the job function is the same, which is not enough to verify that
    the job has been delayed on the expected recordset or model.
    
    Tested job functions are "bound methods" so we can compare their `__self__`.
    
    Example of assertion that would be valid:
    
      partner = self.env["res.partner"].create({"name": "foo"})
      with trap_jobs() as trap:
        partner.with_delay().do_something(42)
        trap.assert_enqueued_job(
            self.env["res.partner"].do_something,
            args=(42,)
        )
        trap.assert_jobs_count(1, only=self.env["res.partner"].do_something)
    
    Now, it would fail with an error message like:
    
    E           AssertionError: Job <res.partner()>.do_something(42) with properties (channel=root.test, description=Do something, eta=15, identity_key=<function identity_exact at 0x7f01bfb54cb0>, max_retries=1, priority=15) was not enqueued.
    E           Actual enqueued jobs:
    E            * <res.partner(64,)>.do_something(42) with properties (priority=15, max_retries=1, eta=15, description=Do something, channel=root.test, identity_key=<function identity_exact at 0x7f01bfb54cb0>)
    guewen authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    30fa6cb View commit details
    Browse the repository at this point in the history
  100. test_queue_job 16.0.2.2.0

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    5891173 View commit details
    Browse the repository at this point in the history
  101. Configuration menu
    Copy the full SHA
    c1357ff View commit details
    Browse the repository at this point in the history
  102. Translated using Weblate (Spanish)

    Currently translated at 100.0% (13 of 13 strings)
    
    Translation: queue-16.0/queue-16.0-test_queue_job
    Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_queue_job/es/
    Ivorra78 authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6b9c39d View commit details
    Browse the repository at this point in the history
  103. [IMP] queue_job: identity_key enhancements

    1. In production, a job which is waiting dependencies or which
    has started, but not completed, should not be repeated if
    the identity_key matches.
    
    2. In tests, the mock queue handler is now enhanced to allow
    better mimicking of the identity_key blocks from production.
    
    3. In tests, the mock queue handler now clears the enqueued jobs
    after performing them, to better reproduce what a production
    environment would do.
    Richard deMeester authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    740f39f View commit details
    Browse the repository at this point in the history
  104. [BOT] post-merge updates

    OCA-git-bot authored and nguyenminhchien committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    8a9c63d View commit details
    Browse the repository at this point in the history
  105. Configuration menu
    Copy the full SHA
    aabbceb View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    dc35a81 View commit details
    Browse the repository at this point in the history
  107. Configuration menu
    Copy the full SHA
    686691b View commit details
    Browse the repository at this point in the history