From 6ae2d2d2448cc797ff5f701398e100d92226ee64 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 19 Oct 2020 11:52:40 +0200 Subject: [PATCH] Use end_date to compute AEAT 303 amount_to_compensate issue9732 review314511003 --- reporting_tax.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/reporting_tax.py b/reporting_tax.py index dc2d2a5ac5..4dde5e14ca 100644 --- a/reporting_tax.py +++ b/reporting_tax.py @@ -288,13 +288,9 @@ class AEAT303(AEATReport): amount_to_compensate = Decimal(0) fiscalyear = periods[0].fiscalyear - start_periods = Period.search([ - ('fiscalyear', '=', fiscalyear.id), - ('end_date', '<=', start_date), - ]) with transaction.set_context({ 'fiscalyear': fiscalyear.id, - 'periods': [p.id for p in start_periods], + 'to_date': end_date, }): for account in Account.search([ ('company', '=', fiscalyear.company.id),