From 7d58a634daa6a4d19c41d7f0af8b08758b857332 Mon Sep 17 00:00:00 2001 From: "Thomas Becquevort (thbe)" Date: Wed, 19 Jul 2023 13:32:04 +0000 Subject: [PATCH] [IMP] account: invoice date column in journal entries/items addition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description of the issue/feature this PR addresses: When an accountant adds an invoice at another date than the date of the said invoice, it is that date that is shown on the journal entries and items views. This makes it impossible to order the lines by invoice date as the only date field available on those views does not give the proper piece of information. Current behavior before the PR: Prior to this commit, the Journal Entries and Journal Items views show no column giving the date of the document for every line but only for those that have been added the same day. Desired behavior after the PR is merged: Adding this, the Journal Entries and Journal Items views show a "Document Date" column which represent the date of the document. The bank reconciliation widget presents this column too. In each of these three locations, filters, groups and ordering have been setup to be able to be applied on this new column. This allows to search and filter lines using that piece of information. The column is hidden by default. task-3388309 closes odoo/odoo#129040 Related: odoo/enterprise#44545 Signed-off-by: de Wouters de Bouchout Jean-BenoƮt (jbw) --- addons/account/models/account_move_line.py | 5 +++++ addons/account/views/account_move_views.xml | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/addons/account/models/account_move_line.py b/addons/account/models/account_move_line.py index 9e2f29ddf3e..be6ad0cb831 100644 --- a/addons/account/models/account_move_line.py +++ b/addons/account/models/account_move_line.py @@ -62,6 +62,11 @@ class AccountMoveLine(models.Model): copy=False, group_operator='min', ) + invoice_date = fields.Date( + related='move_id.invoice_date', store=True, + copy=False, + group_operator='min', + ) ref = fields.Char( related='move_id.ref', store=True, copy=False, diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 9f4d727835f..b5ea7d2f479 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -166,6 +166,7 @@ + @@ -312,6 +313,7 @@ + @@ -342,6 +344,7 @@ + @@ -352,6 +355,7 @@ + @@ -373,6 +377,7 @@ + @@ -1293,6 +1298,7 @@ + @@ -1309,12 +1315,14 @@ + +