From 6091344b42a3379cf228eef28fcf58476501ff67 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Sun, 12 Apr 2020 22:08:03 +0200 Subject: [PATCH] Add start and end date filters on EC sales list issue9198 review313171002 --- account.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 85a401f756..a37ade3fe8 100644 --- a/account.py +++ b/account.py @@ -66,10 +66,15 @@ class ECSalesList(ModelSQL, ModelView): move = Move.__table__() period = Period.__table__() tax = Tax.__table__() - where = ((invoice.company == context.get('company')) - & (period.fiscalyear == context.get('fiscalyear'))) + where = invoice.company == context.get('company') + if context.get('fiscalyear'): + where &= (period.fiscalyear == context.get('fiscalyear')) if context.get('period'): where &= (period.id == context.get('period')) + if context.get('start_date'): + where &= (move.date >= context.get('start_date')) + if context.get('end_date'): + where &= (move.date <= context.get('end_date')) where &= ((tax.ec_sales_list_code != Null) & (tax.ec_sales_list_code != '')) where &= invoice.type == 'out'