Files
odoo_source/addons/spreadsheet/static
Lucas Lefèvre (lul) aae6b72823 [IMP] spreadsheet: allow to sort month pivot headers
Currently, if you have a pivot grouped by a date field, aggregated by week
month or quarter, sorting all the pivot cells does not work as expected
when sorting based on the date header column.
"April 2023" would end up being before "March 2020" just because "A" is
before "M". Similarly, "W1 2023" is before "W2 2020" and "Q1 2023" is before
"Q2 2020"

With this commit, for months aggregates, the result of
`=ODOO.PIVOT.HEADER(1,"create_date:month","04/2023")` is currently the
string "April 2023".
The result now becomes a real date just like any other date value
in a spreadsheet. It's the number corresponding to the first day of the
month.

For week and quarter aggregates, we could move the year first ("W1 2023"
becomes "2023 W1"). However, we decided not to do it to keep consistency:
- with other places in odoo (pivot views)
- with the way we talk/think (quarter/week comes first)

closes odoo/odoo#139295

Task: 3570281
Related: odoo/enterprise#49300
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2024-01-23 22:51:48 +00:00
..
…