From c4b82344d50f9a934249ca4e548cd4b06174c0c2 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 5 Jul 2016 13:53:27 +0200 Subject: [PATCH] [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 --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 0716485c708..f2a8acdb757 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -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")