[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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user