From 19c94935b4ae1c4bfbe3f8b677ff6ea7fa58b813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Mon, 21 Dec 2020 12:48:02 +0000 Subject: [PATCH] [REF] stock: remove index on `date` of `stock.picking` The `date` fields is only used in the `_accumulate_amounts` of point_of_sale and is set at now or by the `_prepare_picking` of purchase (maybe will be remove in the futur). In all case, and for now, the index is not used (expected by at a custom search) and should be remove. task-2389380 --- addons/stock/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index d00395cc8f6..783523594b9 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -294,7 +294,7 @@ class Picking(models.Model): help="Is late or will be late depending on the deadline and scheduled date") date = fields.Datetime( 'Creation Date', - default=fields.Datetime.now, index=True, tracking=True, + default=fields.Datetime.now, tracking=True, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, help="Creation Date, usually the time of the order") date_done = fields.Datetime('Date of Transfer', copy=False, readonly=True, help="Date at which the transfer has been processed or cancelled.")