[FIX] account: traceback when getting counterparts

The compute method of the `counterpart` field only keeps a maximum of 2
account codes. However, it attempts to do [0:2] on a set, which is not
syntactically correct in Python.

opw-682373
This commit is contained in:
Nicolas Martinelli
2016-07-05 14:50:36 +02:00
parent da8c5d054e
commit c4b82344d5
+1 -1
View File
@@ -337,7 +337,7 @@ class AccountMoveLine(models.Model):
if (line.account_id.code != self.account_id.code):
counterpart.add(line.account_id.code)
if len(counterpart) > 2:
counterpart = counterpart[0:2] + ["..."]
counterpart = list(counterpart)[0:2] + ["..."]
self.counterpart = ",".join(counterpart)
name = fields.Char(required=True, string="Label")