From d3264389c9b71dd08f5663a6018ab5dcccce0fe7 Mon Sep 17 00:00:00 2001 From: "John Laterre (jol)" Date: Tue, 18 Oct 2022 11:14:37 +0000 Subject: [PATCH] [FIX] account_asset: fix move display name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: - Install Accounting App. - Go to the Accounting App. - Click on 'Accounting' -> 'Assets'. - Create a new asset and confirm it. - Click on 'Modify Depreciation'. - Select the 'Sell' action. - Click on the empty 'Customer Invoice' field. Observed behavior: The invoices are listed based on their name, which is not very explicit/helpful. Desired behavior: In addition to the name, the partner and the date are also displayed in the list. The search is also improved, in order to use the partner name (in addition to the invoice name) to filter invoices. closes odoo/odoo#103696 X-original-commit: 4075c4512cfb44cc3add8270b373f3a4e1e80419 Related: odoo/enterprise#33026 Signed-off-by: William André (wan) Signed-off-by: John Laterre (jol) --- addons/account/models/account_move.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 927a54e5f39..983001d585d 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -53,6 +53,7 @@ class AccountMove(models.Model): _mail_post_access = 'read' _check_company_auto = True _sequence_index = "journal_id" + _rec_names_search = ['name', 'partner_id.name', 'ref'] @property def _sequence_monthly_regex(self): @@ -3060,6 +3061,11 @@ class AccountMove(models.Model): name += '(* %s)' % str(self.id) else: name += self.name + if self.env.context.get('input_full_display_name'): + if self.partner_id: + name += f', {self.partner_id.name}' + if self.date: + name += f', {format_date(self.env, self.date)}' return name + (f" ({shorten(self.ref, width=50)})" if show_ref and self.ref else '') def _get_reconciled_amls(self):