diff --git a/addons/l10n_be_coda/wizard/account_coda_import.py b/addons/l10n_be_coda/wizard/account_coda_import.py index 3dec320323f..e22752f47ff 100644 --- a/addons/l10n_be_coda/wizard/account_coda_import.py +++ b/addons/l10n_be_coda/wizard/account_coda_import.py @@ -70,6 +70,7 @@ class account_coda_import(osv.osv_memory): statement['version'] = line[127] if statement['version'] not in ['1', '2']: raise osv.except_osv(_('Error') + ' R001', _('CODA V%s statements are not supported, please contact your bank') % statement['version']) + statement['globalisation_stack'] = [] statement['lines'] = [] statement['date'] = time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT, time.strptime(rmspaces(line[5:11]), '%d%m%y')) statement['separateApplication'] = rmspaces(line[83:88]) @@ -155,7 +156,11 @@ class account_coda_import(osv.osv_memory): statementLine['type'] = 'normal' statementLine['globalisation'] = int(line[124]) if statementLine['globalisation'] > 0: - statementLine['type'] = 'globalisation' + if statementLine['globalisation'] in statement['globalisation_stack']: + statement['globalisation_stack'].remove(statementLine['globalisation']) + else: + statementLine['type'] = 'globalisation' + statement['globalisation_stack'].append(statementLine['globalisation']) globalisation_comm[statementLine['ref_move']] = statementLine['communication'] if not statementLine.get('communication'): statementLine['communication'] = globalisation_comm.get(statementLine['ref_move'], '')