Skip to content

Commit

Permalink
Remove @job decorator
Browse files Browse the repository at this point in the history
Following changes in OCA/queue#274
  • Loading branch information
guewen authored and hailangvn committed Oct 7, 2021
1 parent 6541c0b commit 3dcf2c5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions stock_move_auto_assign/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Stock Move Auto Assign",
"summary": "Try to reserve moves when goods enter in a location",
"version": "13.0.1.0.1",
"version": "13.0.1.1.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Stock Management",
Expand All @@ -13,7 +13,7 @@
# OCA/queue
"queue_job",
],
"data": [],
"data": ["data/queue_job_channel_data.xml", "data/queue_job_function_data.xml"],
"installable": True,
"development_status": "Beta",
"license": "AGPL-3",
Expand Down
7 changes: 7 additions & 0 deletions stock_move_auto_assign/data/queue_job_channel_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="channel_stock_auto_assign" model="queue.job.channel">
<field name="name">stock_auto_assign</field>
<field name="parent_id" ref="queue_job.channel_root" />
</record>
</odoo>
12 changes: 12 additions & 0 deletions stock_move_auto_assign/data/queue_job_function_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record
id="job_function_product_product_moves_auto_assign"
model="queue.job.function"
>
<field name="model_id" ref="product.model_product_product" />
<field name="method">moves_auto_assign</field>
<field name="channel_id" ref="channel_stock_auto_assign" />
<field name="retry_pattern" eval="{1: 1, 5: 5, 10: 10, 15: 30}" />
</record>
</odoo>
3 changes: 0 additions & 3 deletions stock_move_auto_assign/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from odoo import models

from odoo.addons.queue_job.exception import RetryableJobError
from odoo.addons.queue_job.job import job

_logger = logging.getLogger(__name__)

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

# TODO remove decorator
@job(default_channel="root.stock_auto_assign")
def moves_auto_assign(self, locations):
"""Job trying to reserve moves based on product and locations
Expand Down

0 comments on commit 3dcf2c5

Please sign in to comment.