[FIX] account_coda: errors in constraints

bzr revid: qdp-launchpad@openerp.com-20120425161109-8738t6u3w5i9lukt
This commit is contained in:
Quentin (OpenERP)
2012-04-25 18:11:09 +02:00
parent e28a08c471
commit 03e11de61a
2 changed files with 5 additions and 8 deletions
+5 -2
View File
@@ -32,8 +32,11 @@ class coda_bank_account(osv.osv):
def _check_currency(self, cr, uid, ids, context=None):
obj_cba = self.browse(cr, uid, ids[0], context=context)
if (obj_cba.state == 'normal') and obj_cba.journal and (obj_cba.currency != obj_cba.journal.currency):
return False
if (obj_cba.state == 'normal') and obj_cba.journal:
if obj_cba.journal.currency and (obj_cba.currency != obj_cba.journal.currency):
return False
if not obj_cba.journal.currency and (obj_cba.currency != obj_cba.company_id.currency_id):
return False
return True
_columns = {
@@ -630,12 +630,6 @@ class account_coda_import(osv.osv_memory):
err_string += _('\nConfiguration Error in journal %s!' \
'\nPlease verify the Default Debit and Credit Account settings.') % journal.name
break
if balance_start_check <> statement['balance_start']:
nb_err += 1
err_string += _('\nThe CODA Statement %s Starting Balance (%.2f) does not correspond with the previous Closing Balance (%.2f) in journal %s!') \
% (statement['name'], statement['balance_start'], balance_start_check, journal.name)
break
bk_st_id = bank_st_obj.create(cr, uid, {
'name': statement['name'],
'journal_id': statement['journal_id'],