mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] minor styling
This commit is contained in:
@@ -85,7 +85,6 @@ class ir_attachment(orm.Model):
|
|||||||
else:
|
else:
|
||||||
if document:
|
if document:
|
||||||
if document.state == 'pushed':
|
if document.state == 'pushed':
|
||||||
# TODO: cancel on pingen.com
|
|
||||||
raise osv.except_osv(
|
raise osv.except_osv(
|
||||||
_('Error'),
|
_('Error'),
|
||||||
_('The attachment %s is already pushed to pingen.com.') % \
|
_('The attachment %s is already pushed to pingen.com.') % \
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ POST_SENDING_STATUS = {
|
|||||||
400: 'Sending cancelled',
|
400: 'Sending cancelled',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class PingenException(RuntimeError):
|
class PingenException(RuntimeError):
|
||||||
"""There was an ambiguous exception that occurred while handling your
|
"""There was an ambiguous exception that occurred while handling your
|
||||||
request."""
|
request."""
|
||||||
@@ -51,8 +52,7 @@ class APIError(PingenException):
|
|||||||
|
|
||||||
|
|
||||||
class Pingen(object):
|
class Pingen(object):
|
||||||
""" Interface to pingen.com API
|
""" Interface to the pingen.com API """
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, token, staging=True):
|
def __init__(self, token, staging=True):
|
||||||
self._token = token
|
self._token = token
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class pingen_document(orm.Model):
|
|||||||
def _push_to_pingen(self, cr, uid, document, pingen=None, context=None):
|
def _push_to_pingen(self, cr, uid, document, pingen=None, context=None):
|
||||||
""" Push a document to pingen.com
|
""" Push a document to pingen.com
|
||||||
|
|
||||||
:param Pingen pingen: optional pingen object to, reuse session
|
:param Pingen pingen: optional pingen object to reuse session
|
||||||
"""
|
"""
|
||||||
attachment_obj = self.pool.get('ir.attachment')
|
attachment_obj = self.pool.get('ir.attachment')
|
||||||
|
|
||||||
@@ -224,6 +224,7 @@ class pingen_document(orm.Model):
|
|||||||
loc_cr.rollback()
|
loc_cr.rollback()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
else:
|
||||||
loc_cr.commit()
|
loc_cr.commit()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
@@ -380,7 +381,7 @@ class pingen_document(orm.Model):
|
|||||||
_logger.error('Unexcepted error in pingen cron')
|
_logger.error('Unexcepted error in pingen cron')
|
||||||
loc_cr.rollback()
|
loc_cr.rollback()
|
||||||
raise
|
raise
|
||||||
|
else:
|
||||||
loc_cr.commit()
|
loc_cr.commit()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user