changeset 6942c834947f in modules/sale_advance_payment:5.0
details:
https://hg.tryton.org/modules/sale_advance_payment?cmd=changeset;node=6942c834947f
description:
Allow to run test scenario during the week before the end of the year.
The scenario creates and posts invoice 1 week in advance. So we need to
create
the next fiscal year in case it is run in last December days.
issue7949
review53511002
(grafted from 7f6c5411ca8800c4152bf22383c653370ae972fa)
diffstat:
tests/scenario_advance_payment.rst | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 243ed6b2f3d3 -r 6942c834947f tests/scenario_advance_payment.rst
--- a/tests/scenario_advance_payment.rst Tue Feb 19 22:09:15 2019 +0100
+++ b/tests/scenario_advance_payment.rst Sat Dec 29 15:32:22 2018 +0100
@@ -4,7 +4,9 @@
Imports::
+ >>> import datetime
>>> from decimal import Decimal
+ >>> from dateutil.relativedelta import relativedelta
>>> from proteus import Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.modules.company.tests.tools import create_company, \
@@ -15,6 +17,7 @@
... set_fiscalyear_invoice_sequences, create_payment_term
>>> from trytond.modules.sale_advance_payment.tests.tools import \
... create_advance_payment_term
+ >>> today = datetime.date.today()
Activate sale_advance_payment::
@@ -25,11 +28,14 @@
>>> _ = create_company()
>>> company = get_company()
-Create fiscal year::
+Create fiscal years::
>>> fiscalyear = set_fiscalyear_invoice_sequences(
- ... create_fiscalyear(company))
+ ... create_fiscalyear(company, today=today))
>>> fiscalyear.click('create_period')
+ >>> next_fiscalyear = set_fiscalyear_invoice_sequences(
+ ... create_fiscalyear(company, today=today + relativedelta(years=1)))
+ >>> next_fiscalyear.click('create_period')
Create chart of accounts::