[MIG] Forward port of lp:banking-addons/6.1, rev. 166

[FIX] Do not match on very short signatures
This commit is contained in:
Stefan Rijnhart
2013-05-01 16:41:43 +02:00
parent a9336393a0
commit 062d17641c

View File

@@ -181,7 +181,7 @@ class banking_import_transaction(orm.Model):
Match on ID of invoice (reference, name or number, whatever
available and sensible)
'''
if invoice.reference:
if invoice.reference and len(invoice.reference) > 2:
# Reference always comes first, as it is manually set for a
# reason.
iref = invoice.reference.upper()
@@ -189,7 +189,7 @@ class banking_import_transaction(orm.Model):
return True
if invoice.type.startswith('in_'):
# Internal numbering, no likely match on number
if invoice.name:
if invoice.name and len(invoice.name) > 2:
iname = invoice.name.upper()
if iname in ref or iname in msg:
return True