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
closesodoo/odoo#44208
X-original-commit: 096fdc7d3fe0799aa761c6ad3597569a002c698e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Jason Van Malder <jvm@odoo.com>