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
parent 8824a54710
commit cd160b2737
4 changed files with 20 additions and 4 deletions

View File

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