Browse Source

[FIX] Crelan, add md5 hash of the communication in order to avoid collision

pull/151/head
Thibault Francois 8 years ago
committed by Manuel Claeys Bouuaert
parent
commit
98348d4f92
  1. 3
      beesdoo_crelan_csv/wizard/import_crelan_csv.py

3
beesdoo_crelan_csv/wizard/import_crelan_csv.py

@ -8,6 +8,7 @@ Created on 09 Octobre 2016
from StringIO import StringIO from StringIO import StringIO
import csv import csv
import datetime import datetime
import md5
from openerp import models, _ from openerp import models, _
ACCOUNT = "Compte donneur d'ordre" ACCOUNT = "Compte donneur d'ordre"
@ -48,7 +49,7 @@ class CodaBankStatementImport(models.TransientModel):
'partner_name': move[COUNTERPART_NAME], #ok 'partner_name': move[COUNTERPART_NAME], #ok
'ref': move[DATE] + '-' + move[AMOUNT] + '-' + move[COUNTERPART_NUMBER] + '-' + move[COUNTERPART_NAME], 'ref': move[DATE] + '-' + move[AMOUNT] + '-' + move[COUNTERPART_NUMBER] + '-' + move[COUNTERPART_NAME],
'sequence': sequence, #ok 'sequence': sequence, #ok
'unique_import_id' : move[DATE] + '-' + move[AMOUNT] + '-' + move[COUNTERPART_NUMBER] + '-' + move[COUNTERPART_NAME]
'unique_import_id' : move[DATE] + '-' + move[AMOUNT] + '-' + move[COUNTERPART_NUMBER] + '-' + move[COUNTERPART_NAME] + '-' + md5.new(move[COMMUNICATION]).hexdigest()
} }
return move_data return move_data

Loading…
Cancel
Save