[MERGE] some fixes in constraints in account_coda

bzr revid: qdp-launchpad@openerp.com-20120425214211-k8pnk6m37v9atpkb
This commit is contained in:
Quentin (OpenERP)
2012-04-25 23:42:11 +02:00
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'],