[FIX] base_import: currency symbol can be placed at the right of the value

The previous code went outside of the list bounds because the modulo
operator has a higher priority than the addition one.
This commit is contained in:
David Monjoie
2016-05-25 13:53:33 +02:00
parent f9b8c009cb
commit 64aea2b515
+1 -1
View File
@@ -558,7 +558,7 @@ class ir_import(orm.TransientModel):
# Check that currency exists
currency = self.pool.get('res.currency').search(cr, uid, [('symbol', '=', split_value[currency_index].strip())])
if len(currency):
return split_value[currency_index+1%2] if not negative else '-'+split_value[currency_index+1%2]
return split_value[(currency_index+1)%2] if not negative else '-'+split_value[(currency_index+1)%2]
# Otherwise it is not a float with a currency symbol
return False