[IMP] assign default channel on @job function

This commit is contained in:
Laurent Mignon (ACSONE)
2015-05-28 12:00:16 +02:00
committed by Artem Kostyuk
parent d0eb8597ef
commit 58ae6cc28e
3 changed files with 1 additions and 21 deletions

View File

@@ -32,7 +32,6 @@
'website': 'http://www.camptocamp.com',
'data': [
'account_view.xml',
'account_data.xml',
'wizard/move_marker_view.xml',
],
'test': [

View File

@@ -148,7 +148,7 @@ class account_move(orm.Model):
self._cancel_jobs(cr, uid, context=context)
@job
@job(default_channel='root.account_move_batch_validate')
def validate_one_move(session, model_name, move_id):
"""Validate a move, and leave the job reference in place."""
move_pool = session.pool['account.move']

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<!-- Connector channel: To avoid concurrent update when validating the account_move
on ir_sequence, jobs must be processed one by one. By default channels are created
with a capacity of 1. Be careful to not increase the capacity of the channel. -->
<record model="queue.job.channel" id="channel_account_move_batch_validate">
<field name="name">account_move_batch_validate</field>
<field name="parent_id" ref="connector.channel_root"/>
</record>
<record model="queue.job.function" id="function_account_validate_one_move">
<field name="name">openerp.addons.account_move_batch_validate.account.validate_one_move</field>
<field name="channel_id" ref="channel_account_move_batch_validate"/>
</record>
</data>
</openerp>