Make scenario independent of the current day

The fiscal years are created centered on the passed date such that if the
current day change during the execution, the fiscal year is still usable.
Also fiscal year can be created for a range of dates such that it is guarantee
that the dates are in the fiscal year.
And finally remove datetime and dateutil import when they are not used.

Closes #9977
This commit is contained in:
Cédric Krier
2023-01-01 10:36:03 +01:00
parent 2b786d8c44
commit 4683fde7ac
152 changed files with 440 additions and 533 deletions
@@ -4,8 +4,7 @@ Account Stock Landed Cost Weight
Imports::
>>> import datetime
>>> from dateutil.relativedelta import relativedelta
>>> import datetime as dt
>>> from decimal import Decimal
>>> from proteus import Model, Wizard
>>> from trytond.tests.tools import activate_modules
@@ -15,7 +14,8 @@ Imports::
... create_chart, get_accounts
>>> from trytond.modules.account_invoice.tests.tools import \
... set_fiscalyear_invoice_sequences
>>> today = datetime.date.today()
>>> today = dt.date.today()
Activate modules::
@@ -29,7 +29,7 @@ Create company::
Create fiscal year::
>>> fiscalyear = set_fiscalyear_invoice_sequences(
... create_fiscalyear(company))
... create_fiscalyear(company, today))
>>> fiscalyear.click('create_period')
Create chart of accounts::