From fced5d1e952bfe474ac33ed2da82cbe5e5ff3f48 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 2 Apr 2019 09:21:49 +0000 Subject: [PATCH] [FIX] web: Wrong comparison in invoice analyes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: Let's consider that we are in 2019 - Create two customer invoices: I1 and I2 - I1 with invoice date = 2 april 2019 and amount = 100€ - I2 with invoice date = 2 april 2018 and amount = 1000€ - Go to Reporting > Invoices - Click on widget "Time Ranges" and set "Based on" Invoice Date and "Range" This Year "Compare To" Previous Year Bug: The untaxed total for previous year was 1100€ instead of 1000€ because it counted previous year and this year. opw:1962027 closes odoo/odoo#32331 Signed-off-by: Simon Goffin (sig) --- addons/web/static/src/js/core/domain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/core/domain.js b/addons/web/static/src/js/core/domain.js index c31feb61a8f..00c8dcb83d4 100644 --- a/addons/web/static/src/js/core/domain.js +++ b/addons/web/static/src/js/core/domain.js @@ -258,8 +258,8 @@ var Domain = collections.Tree.extend({ }); break; case 'previous_year': - leftBoundaryParams.years = leftBoundaryParams.years ? leftBoundaryParams.years-- : -1; - rightBoundaryParams.years = rightBoundaryParams.years ? rightBoundaryParams.years-- : -1; + leftBoundaryParams.years = leftBoundaryParams.years ? leftBoundaryParams.years - 1 : -1; + rightBoundaryParams.years = rightBoundaryParams.years ? rightBoundaryParams.years - 1 : -1; break; }