[FIX] adapt the fix 'partner trial balance: sort by partner name' to v15

pull/1241/head
Alexis de Lattre 2024-10-24 12:27:06 +02:00
parent f356445cb4
commit a31dcd7a07
1 changed files with 4 additions and 1 deletions

View File

@ -330,7 +330,10 @@ class TrialBalanceReport(models.AbstractModel):
for acc_id, total_data in total_amount.items():
tmp_list = sorted(
total_data.items(),
key=lambda x: isinstance(x[1], dict) and x[1]["partner_name"] or x[0],
key=lambda x: isinstance(x[0], int)
and isinstance(x[1], dict)
and x[1]["partner_name"]
or x[0],
)
total_amount[acc_id] = {}
for key, value in tmp_list: