Skip to content
Snippets Groups Projects

Draft: Add find() method on fiscal years needed by other modules.

Open Etienne Ferriere requested to merge topic/16.0/MO16-00581 into branch/16.0
Files
2
@@ -133,9 +133,7 @@
to_create_start = oldest_fy.date_start
# to_create_stop = oldest_fy.date_stop
while to_create_start > dt:
to_create_stop = to_create_start + relativedelta(
days=-1
)
to_create_stop = to_create_start + relativedelta(days=-1)
to_create_start = to_create_stop - self._get_duration()
else:
newest_fy = self.search(
@@ -147,14 +145,10 @@
# the fiscal year to create is after any created so far
to_create_stop = newest_fy.date_stop
while to_create_stop < dt:
to_create_start = to_create_stop + relativedelta(
days=1
)
to_create_stop = (
to_create_start + self._get_duration()
)
to_create_start = to_create_stop + relativedelta(days=1)
to_create_stop = to_create_start + self._get_duration()
else:
# the fiscal year to create is between any created so
# far
to_create_stop = oldest_fy.date_stop
while to_create_stop < dt:
@@ -156,14 +150,10 @@
else:
# the fiscal year to create is between any created so
# far
to_create_stop = oldest_fy.date_stop
while to_create_stop < dt:
to_create_start = to_create_stop + relativedelta(
days=1
)
to_create_stop = (
to_create_start + self._get_duration()
)
to_create_start = to_create_stop + relativedelta(days=1)
to_create_stop = to_create_start + self._get_duration()
else:
# there’s no fy in the system, if the duration is changed,
# this will not work as is
Loading