Remove @job decorator

Following changes in https://github.com/OCA/queue/pull/274
This commit is contained in:
Guewen Baconnier
2021-01-28 16:21:21 +01:00
committed by Hai Lang
parent 11deadb394
commit aec61b5aed
4 changed files with 21 additions and 5 deletions

View File

@@ -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",
@@ -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",

View File

@@ -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>

View File

@@ -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>

View File

@@ -8,7 +8,6 @@ import psycopg2
from odoo import models
from odoo.addons.queue_job.exception import RetryableJobError
from odoo.addons.queue_job.job import job
_logger = logging.getLogger(__name__)
@@ -32,8 +31,6 @@ class ProductProduct(models.Model):
# 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