Do not include start date when searching previous fiscalyear to cumulate

As there is a check to ensure that fiscalyears does not overlap it does not
make sense to include fiscalyears which end on the same start date as the
start of the current fiscalyear.

issue5131
review41811002
This commit is contained in:
Sergi Almacellas Abellana
2018-02-01 13:35:31 +01:00
parent ea603510af
commit 1d4583045c
+1 -1
View File
@@ -829,7 +829,7 @@ class Account(ModelSQL, ModelView):
fiscalyear = None
if youngest_fiscalyear:
fiscalyears = FiscalYear.search([
('end_date', '<=', youngest_fiscalyear.start_date),
('end_date', '<', youngest_fiscalyear.start_date),
('company', '=', youngest_fiscalyear.company),
], order=[('end_date', 'DESC')], limit=1)
if fiscalyears: