Skip to content

Commit 9dea80c

Browse files
guewenlmignon
authored andcommitted
Remove @job decorator
Following changes in OCA/queue#274
1 parent e32fefa commit 9dea80c

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

stock_move_auto_assign/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Stock Move Auto Assign",
66
"summary": "Try to reserve moves when goods enter in a location",
7-
"version": "13.0.1.0.1",
7+
"version": "13.0.1.1.0",
88
"author": "Camptocamp, Odoo Community Association (OCA)",
99
"website": "https://github.com/OCA/stock-logistics-warehouse",
1010
"category": "Stock Management",
@@ -13,7 +13,7 @@
1313
# OCA/queue
1414
"queue_job",
1515
],
16-
"data": [],
16+
"data": ["data/queue_job_channel_data.xml", "data/queue_job_function_data.xml"],
1717
"installable": True,
1818
"development_status": "Beta",
1919
"license": "AGPL-3",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="channel_stock_auto_assign" model="queue.job.channel">
4+
<field name="name">stock_auto_assign</field>
5+
<field name="parent_id" ref="queue_job.channel_root" />
6+
</record>
7+
</odoo>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record
4+
id="job_function_product_product_moves_auto_assign"
5+
model="queue.job.function"
6+
>
7+
<field name="model_id" ref="product.model_product_product" />
8+
<field name="method">moves_auto_assign</field>
9+
<field name="channel_id" ref="channel_stock_auto_assign" />
10+
<field name="retry_pattern" eval="{1: 1, 5: 5, 10: 10, 15: 30}" />
11+
</record>
12+
</odoo>

stock_move_auto_assign/models/product_product.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from odoo import models
99

1010
from odoo.addons.queue_job.exception import RetryableJobError
11-
from odoo.addons.queue_job.job import job
1211

1312
_logger = logging.getLogger(__name__)
1413

@@ -32,8 +31,6 @@ def _moves_auto_assign_domain(self, locations):
3231
# out anyway.
3332
]
3433

35-
# TODO remove decorator
36-
@job(default_channel="root.stock_auto_assign")
3734
def moves_auto_assign(self, locations):
3835
"""Job trying to reserve moves based on product and locations
3936

0 commit comments

Comments
 (0)