mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] replace double nested 'with' by the multiple manager form of the 'with' statement
This commit is contained in:
@@ -195,8 +195,8 @@ class pingen_document(orm.Model):
|
||||
limit=100,
|
||||
context=context)
|
||||
|
||||
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr:
|
||||
with self._get_pingen_session(cr, uid, context=context) as session:
|
||||
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr, \
|
||||
self._get_pingen_session(cr, uid, context=context) as session:
|
||||
for document in self.browse(loc_cr, uid, ids, context=context):
|
||||
|
||||
if document.state == 'error':
|
||||
@@ -366,8 +366,8 @@ class pingen_document(orm.Model):
|
||||
[('state', '=', 'sendcenter')],
|
||||
context=context)
|
||||
|
||||
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr:
|
||||
with self._get_pingen_session(cr, uid, context=context) as session:
|
||||
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr, \
|
||||
self._get_pingen_session(cr, uid, context=context) as session:
|
||||
for document in self.browse(loc_cr, uid, ids, context=context):
|
||||
try:
|
||||
self._update_post_infos(
|
||||
|
||||
Reference in New Issue
Block a user