From 35ea7f597906d803f075d23bbc93a1fb95aceef9 Mon Sep 17 00:00:00 2001 From: SaddemAmine Date: Wed, 28 Jun 2023 11:20:52 +0000 Subject: [PATCH] [IMP] account: added default order by invoice_date This commit aims to improve the order of draft bills / invoices. Currently when importing multiple vendor bills they aren't ordered logically since they're still draft bills. Adding a fallback order by invoice_date until they're posted will help the user find the bill he's looking for more easily. It also allows to preserve the order of the imported bills in case of validation in batches. Task ID: 3383575 closes odoo/odoo#126691 Signed-off-by: Quentin De Paoli --- 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 b17ce503818..94f91237d84 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -64,7 +64,7 @@ class AccountMove(models.Model): _name = "account.move" _inherit = ['portal.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin', 'sequence.mixin'] _description = "Journal Entry" - _order = 'date desc, name desc, id desc' + _order = 'date desc, name desc, invoice_date desc, id desc' _mail_post_access = 'read' _check_company_auto = True _sequence_index = "journal_id"