From d679c75bbeaf3e41dcdb8c91996a89ea5080669f Mon Sep 17 00:00:00 2001
From: Jorge Pinna Puissant <jpp@odoo.com>
Date: Tue, 21 Jan 2020 08:45:41 +0000
Subject: [PATCH] [FIX] account: display name of journal entries

1- create a group payment (10 ~ 15 invoices);
2- Open the created journal entry.

The first issue we see is that the breadcrumb is too big to the size of
the screen.

3- Open the 'Reconciled Entries'.

Before this commit, the screen was completely shifted and not visible.
This occurs also because the breadcrumb is too big.

Now, the references added to the name of the entry is limited to 50
characters.

opw-2166551

closes odoo/odoo#43614

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
---
 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 3e48c7348aba..109c5da12919 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -1794,7 +1794,7 @@ class AccountMove(models.Model):
                 draft_name += ' (* %s)' % str(self.id)
             else:
                 draft_name += ' ' + self.name
-        return (draft_name or self.name) + (show_ref and self.ref and ' (%s)' % self.ref or '')
+        return (draft_name or self.name) + (show_ref and self.ref and ' (%s%s)' % (self.ref[:50], '...' if len(self.ref) > 50 else '') or '')
 
     def _get_invoice_delivery_partner_id(self):
         ''' Hook allowing to retrieve the right delivery address depending of installed modules.
-- 
GitLab