[FIX] stock: sort traceability report
Commit 324db18dc9d5774d714 introduced the date formatting on the traceability report. A side effect is that the line sorting is done on the formatted value, leading to lines not appearing in chronological order. We format the line after sorting. opw-2243432 closes odoo/odoo#52497 X-original-commit: 52e04dc3362830874a9f868d8e35a3da441320d7 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -121,7 +121,7 @@ class MrpStockReport(models.TransientModel):
|
||||
data = [{
|
||||
'level': level,
|
||||
'unfoldable': unfoldable,
|
||||
'date': format_datetime(self.env, move_line.move_id.date, tz=False, dt_format=False),
|
||||
'date': move_line.move_id.date,
|
||||
'parent_id': parent_id,
|
||||
'is_used': bool(is_used),
|
||||
'usage': self._get_usage(move_line),
|
||||
@@ -156,7 +156,7 @@ class MrpStockReport(models.TransientModel):
|
||||
'res_model': data.get('res_model', False),
|
||||
'columns': [data.get('reference_id', False),
|
||||
data.get('product_id', False),
|
||||
data.get('date', False),
|
||||
format_datetime(self.env, data.get('date', False), tz=False, dt_format=False),
|
||||
data.get('lot_name', False),
|
||||
data.get('location_source', False),
|
||||
data.get('location_destination', False),
|
||||
|
||||
Reference in New Issue
Block a user