[IMP] Process jobs 'validate_one_move' in a dedicated job channel

To avoid concurrent update when validating the account_move
on ir_sequence, jobs must be processed one by one. Using a
dedicated channel enable to isolate the processing of
the 'validate_one_move' jobs from the root channel
This commit is contained in:
Laurent Mignon (ACSONE)
2015-05-27 11:28:58 +02:00
committed by Artem Kostyuk
parent bb62f533e0
commit d0eb8597ef
3 changed files with 24 additions and 0 deletions

View File

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

View File

@@ -28,6 +28,10 @@ from openerp.tools.translate import _
from openerp.addons.connector.queue.job import job
from openerp.addons.connector.session import ConnectorSession
from openerp.addons.connector.queue.job import OpenERPJobStorage
from openerp.addons.connector.connector import install_in_connector
# install the module in connector to register the job function
install_in_connector()
_logger = logging.getLogger(__name__)

View File

@@ -0,0 +1,19 @@
<?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>