diff --git a/addons/l10n_be_coda/l10n_be_coda_demo.xml b/addons/l10n_be_coda/l10n_be_coda_demo.xml
index 63436a60a92..ce44539a715 100644
--- a/addons/l10n_be_coda/l10n_be_coda_demo.xml
+++ b/addons/l10n_be_coda/l10n_be_coda_demo.xml
@@ -32,5 +32,27 @@
+
+
+
+
+
+
+
+ draft
+ out_invoice
+
+
+ bba
+ +++240/2838/42818+++
+
+
+ Otpez Laptop without OS
+
+ 608.89
+ 10
+
+
+
diff --git a/addons/l10n_be_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt b/addons/l10n_be_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt
index bc3af59e322..3303e940e0c 100644
--- a/addons/l10n_be_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt
+++ b/addons/l10n_be_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt
@@ -4,7 +4,7 @@
2200010000 GKCCBEBB 1 0
2300010000BE41063012345610 PARTNER 1 0 1
3100010001OL44483FW SCTOFBIONLO001010001001PARTNER 1 0 0
-2100020000OL4414AC8BOVSOVSOVERS00000000030444501101110015000002010237 11011113501 0
+2100020000OL4414AC8BOVSOVSOVERS000000000304445011011100150001101240283842818 11011113501 0
2200020000 BBRUBEBB 1 0
2300020000BE61310126985517 PARTNER 2 0 1
3100020001OL4414AC8BOVSOVSOVERS001500001001PARTNER 2 1 0
diff --git a/addons/l10n_be_coda/wizard/account_coda_import.py b/addons/l10n_be_coda/wizard/account_coda_import.py
index e50f8537881..ba786e46b59 100644
--- a/addons/l10n_be_coda/wizard/account_coda_import.py
+++ b/addons/l10n_be_coda/wizard/account_coda_import.py
@@ -291,62 +291,10 @@ class account_coda_import(osv.osv_memory):
if 'counterpartyAddress' in line and line['counterpartyAddress'] != '':
note.append(_('Counter Party Address') + ': ' + line['counterpartyAddress'])
line['name'] = "\n".join(filter(None, [line['counterpartyName'], line['communication']]))
- partner = None
partner_id = None
- invoice = False
+ structured_com = ""
if line['communication_struct'] and 'communication_type' in line and line['communication_type'] == '101':
- ids = self.pool.get('account.invoice').search(cr, uid, [('reference', '=', line['communication']), ('reference_type', '=', 'bba')])
-
-# Gère les communications structurées
-# TODO : à faire primer sur resolution_proposition : si la communication indique une facture, on la sélectionne
-
-# if ids:
-# invoice = self.pool.get('account.invoice').browse(cr, uid, ids[0])
-# partner = invoice.partner_id
-# partner_id = partner.id
-# if invoice.type in ['in_invoice', 'in_refund'] and line['debit'] == '1':
-# line['transaction_type'] = 'supplier'
-# elif invoice.type in ['out_invoice', 'out_refund'] and line['debit'] == '0':
-# line['transaction_type'] = 'customer'
-# line['account'] = invoice.account_id.id
-# line['reconcile'] = False
-# if invoice.type in ['in_invoice', 'out_invoice']:
-# iml_ids = self.pool.get('account.move.line').search(cr, uid, [('move_id', '=', invoice.move_id.id), ('reconcile_id', '=', False), ('account_id.reconcile', '=', True)])
-# if iml_ids:
-# line['reconcile'] = iml_ids[0]
-# if line['reconcile']:
-# voucher_vals = {
-# 'type': line['transaction_type'] == 'supplier' and 'payment' or 'receipt',
-# 'name': line['name'],
-# 'partner_id': partner_id,
-# 'journal_id': statement['journal_id'].id,
-# 'account_id': statement['journal_id'].default_credit_account_id.id,
-# 'company_id': statement['journal_id'].company_id.id,
-# 'currency_id': statement['journal_id'].company_id.currency_id.id,
-# 'date': line['entryDate'],
-# 'amount': abs(line['amount']),
-# 'period_id': statement['period_id'],
-# 'invoice_id': invoice.id,
-# }
-# context['invoice_id'] = invoice.id
-# voucher_vals.update(self.pool.get('account.voucher').onchange_partner_id(cr, uid, [],
-# partner_id=partner_id,
-# journal_id=statement['journal_id'].id,
-# amount=abs(line['amount']),
-# currency_id=statement['journal_id'].company_id.currency_id.id,
-# ttype=line['transaction_type'] == 'supplier' and 'payment' or 'receipt',
-# date=line['transactionDate'],
-# context=context
-# )['value'])
-# line_drs = []
-# for line_dr in voucher_vals['line_dr_ids']:
-# line_drs.append((0, 0, line_dr))
-# voucher_vals['line_dr_ids'] = line_drs
-# line_crs = []
-# for line_cr in voucher_vals['line_cr_ids']:
-# line_crs.append((0, 0, line_cr))
-# voucher_vals['line_cr_ids'] = line_crs
-# line['voucher_id'] = self.pool.get('account.voucher').create(cr, uid, voucher_vals, context=context)
+ structured_com = line['communication']
if 'counterpartyNumber' in line and line['counterpartyNumber']:
ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', str(line['counterpartyNumber']))])
if ids and len(ids) > 0:
@@ -356,12 +304,12 @@ class account_coda_import(osv.osv_memory):
note.append(_('Communication') + ': ' + line['communication'])
data = {
'name': line['name'],
- 'note': "\n".join(note),
+ 'note': "\n".join(note),
'date': line['entryDate'],
'amount': line['amount'],
'partner_id': partner_id,
'statement_id': statement['id'],
- 'ref': line['ref'],
+ 'ref': structured_com,
'sequence': line['sequence'],
'coda_account_number': line['counterpartyNumber'],
}