Skip to content

Commit

Permalink
[MIG] attachment_queue: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rrebollo committed Feb 6, 2025
1 parent 57ac5db commit cb835d8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion attachment_queue/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Attachment Queue",
"version": "16.0.1.2.1",
"version": "17.0.1.0.0",
"author": "Akretion,Odoo Community Association (OCA)",
"summary": "Base module adding the concept of queue for processing files",
"website": "https://github.com/OCA/server-tools",
Expand Down
2 changes: 1 addition & 1 deletion attachment_queue/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_attachment_queue_user,attachment.queue.user,model_attachment_queue,,1,0,0,0
access_attachment_queue_user,attachment.queue.user,model_attachment_queue,base.group_user,1,0,0,0
access_attachment_queue_manager,attachment.queue.manager,model_attachment_queue,base.group_no_one,1,1,1,1
access_attachment_reschedule_wizard,Attachment Queue Reschedule,attachment_queue.model_attachment_queue_reschedule,base.group_no_one,1,1,1,1
11 changes: 7 additions & 4 deletions attachment_queue/tests/test_attachment_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from odoo import registry
from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger

from odoo.addons.base.tests.common import BaseCommon
from odoo.addons.queue_job.exception import RetryableJobError
from odoo.addons.queue_job.tests.common import trap_jobs

Expand All @@ -21,14 +21,14 @@
)


class TestAttachmentBaseQueue(TransactionCase):
class TestAttachmentBaseQueue(BaseCommon):
def _create_dummy_attachment(self, override=False, no_job=False):
override = override or {}
vals = DUMMY_AQ_VALS.copy()
vals.update(override)
if no_job:
return (
self.env["attachment.queue"].with_context(test_queue_job_no_delay=True)
self.env["attachment.queue"].with_context(queue_job__no_delay=True)
).create(vals)
return self.env["attachment.queue"].create(vals)

Expand Down Expand Up @@ -59,7 +59,10 @@ def test_job_created(self):
)

def test_aq_locked_job(self):
"""If an attachment is already running, and a job tries to run it, retry later"""
"""
If an attachment is already running, and a job tries to run it,
retry later
"""
attachment = self.env.ref("attachment_queue.dummy_attachment_queue")
with registry(self.env.cr.dbname).cursor() as new_cr:
new_cr.execute(
Expand Down
6 changes: 3 additions & 3 deletions attachment_queue/views/attachment_queue_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
<header>
<button
name="button_manual_run"
states="pending,failed"
invisible="state not in ('pending', 'failed')"
string="Manual run"
type="object"
class="oe_highlight"
/>
<button
name="button_reschedule"
states="done,failed"
invisible="state not in ('done', 'failed')"
string="Reschedule"
type="object"
class="oe_highlight"
/>
<button
name="set_done"
states="pending,failed"
invisible="state not in ('pending', 'failed')"
string="Set to Done"
type="object"
/>
Expand Down

0 comments on commit cb835d8

Please sign in to comment.