Skip to content
Snippets Groups Projects
Commit 95f40530 authored by Mathieu Duckerts-Antoine's avatar Mathieu Duckerts-Antoine
Browse files

[FIX] web: fix date filters


Issue

    If month - 1 or month - 2 are in the previous year, the filter is
    incorrect.

    ex: Date = Jan. 2020, Filter = Dec. 2019
        => last_year__last_month = 2018-12 instead 2019-12

Cause

    If date is 2020-01-20

    Selecting December => adding param "last_month"
    Selecting 2019 => adding param "last_year"

    Applying "last_month" => date become 2019-12-01
    Applying "last_year" => date become 2018-12-01

Solution

    Detect the right year to activate by default
    when a month is selected and no year is selected.
    With that solution it is not possible to get records in Jan. 2020
    or in Dec. 2019 only for instance but the global functioning
    of date filters stays the same as before.

OPW-2169528

closes odoo/odoo#44208

X-original-commit: 096fdc7d
Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: default avatarJason Van Malder <jvm@odoo.com>
parent 68f5883a
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment