mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] account_statement_ext: Catch also old exceptions (osv.except_osv)
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import openerp.addons.account.account_bank_statement as stat_mod
|
import openerp.addons.account.account_bank_statement as stat_mod
|
||||||
from openerp.osv import fields, orm
|
from openerp.osv import fields, orm, osv
|
||||||
from openerp.tools.translate import _
|
from openerp.tools.translate import _
|
||||||
|
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ class AccountBankStatement(orm.Model):
|
|||||||
self.create_move_from_st_line(
|
self.create_move_from_st_line(
|
||||||
cr, uid, st_line.id, company_currency_id,
|
cr, uid, st_line.id, company_currency_id,
|
||||||
st_line_number, context)
|
st_line_number, context)
|
||||||
except orm.except_orm, exc:
|
except (orm.except_orm, osv.except_osv), exc:
|
||||||
msg = "Line ID %s with ref %s had following error: %s" % (
|
msg = "Line ID %s with ref %s had following error: %s" % (
|
||||||
st_line.id, st_line.ref, exc.value)
|
st_line.id, st_line.ref, exc.value)
|
||||||
errors_stack.append(msg)
|
errors_stack.append(msg)
|
||||||
@@ -606,7 +606,7 @@ class AccountBankStatementLine(orm.Model):
|
|||||||
local_context['account_period_prefer_normal'] = True
|
local_context['account_period_prefer_normal'] = True
|
||||||
try:
|
try:
|
||||||
periods = period_obj.find(cr, uid, dt=date, context=local_context)
|
periods = period_obj.find(cr, uid, dt=date, context=local_context)
|
||||||
except orm.except_orm:
|
except (orm.except_orm, osv.except_osv):
|
||||||
# if no period defined, we are certainly at installation time
|
# if no period defined, we are certainly at installation time
|
||||||
return False
|
return False
|
||||||
return periods and periods[0] or False
|
return periods and periods[0] or False
|
||||||
|
|||||||
Reference in New Issue
Block a user