mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[imp] do not use a new cursor to create the jobs
This commit is contained in:
committed by
Artem Kostyuk
parent
518fe72cd2
commit
91483d915a
@@ -23,7 +23,7 @@
|
||||
from openerp.osv import fields, orm
|
||||
|
||||
from openerp.addons.connector.queue.job import job
|
||||
from openerp.addons.connector.session import ConnectorSessionHandler
|
||||
from openerp.addons.connector.session import Session
|
||||
|
||||
|
||||
class account_move(orm.Model):
|
||||
@@ -42,12 +42,9 @@ class account_move(orm.Model):
|
||||
|
||||
def mark_for_posting(self, cr, uid, ids, context=None):
|
||||
"""."""
|
||||
session_hdl = ConnectorSessionHandler(cr.dbname, uid)
|
||||
with session_hdl.session() as session:
|
||||
for move_id in ids:
|
||||
validate_one_move.delay(session, self._name, move_id)
|
||||
print('===== PUT IN QUEUE!!!!! %s' % move_id)
|
||||
# work with session
|
||||
session = Session(cr, uid, context=context)
|
||||
for move_id in ids:
|
||||
validate_one_move.delay(session, self._name, move_id)
|
||||
|
||||
|
||||
@job
|
||||
|
||||
Reference in New Issue
Block a user