From 58fbd38d0a5fd266a1b29d58d6522dacec80d399 Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Wed, 7 Jun 2023 10:19:11 +0000 Subject: [PATCH] [IMP] stock_landed_costs: order for landed cost model before this commit, when creating new record in landed cost, the newly added record is coming in the last position in the tree view. after this commit, the records shown in the tree view will be sorted based on the desc order of recorded date in the landed cost. closes odoo/odoo#124101 Signed-off-by: William Henrotin (whe) --- addons/stock_landed_costs/models/stock_landed_cost.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py index e4d03a288e1..f0a03097918 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -21,6 +21,7 @@ class StockLandedCost(models.Model): _name = 'stock.landed.cost' _description = 'Stock Landed Cost' _inherit = ['mail.thread', 'mail.activity.mixin'] + _order = 'date desc, id desc' def _default_account_journal_id(self): """Take the journal configured in the company, else fallback on the stock journal."""