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,
|
limit=100,
|
||||||
context=context)
|
context=context)
|
||||||
|
|
||||||
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr:
|
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr, \
|
||||||
with self._get_pingen_session(cr, uid, context=context) as session:
|
self._get_pingen_session(cr, uid, context=context) as session:
|
||||||
for document in self.browse(loc_cr, uid, ids, context=context):
|
for document in self.browse(loc_cr, uid, ids, context=context):
|
||||||
|
|
||||||
if document.state == 'error':
|
if document.state == 'error':
|
||||||
@@ -366,8 +366,8 @@ class pingen_document(orm.Model):
|
|||||||
[('state', '=', 'sendcenter')],
|
[('state', '=', 'sendcenter')],
|
||||||
context=context)
|
context=context)
|
||||||
|
|
||||||
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr:
|
with closing(pooler.get_db(cr.dbname).cursor()) as loc_cr, \
|
||||||
with self._get_pingen_session(cr, uid, context=context) as session:
|
self._get_pingen_session(cr, uid, context=context) as session:
|
||||||
for document in self.browse(loc_cr, uid, ids, context=context):
|
for document in self.browse(loc_cr, uid, ids, context=context):
|
||||||
try:
|
try:
|
||||||
self._update_post_infos(
|
self._update_post_infos(
|
||||||
|
|||||||
Reference in New Issue
Block a user