Test fails when executed on 31/12
If the test of commission module is executed today (31/12/2020) the scenario will crash because there's no period created for tomorrow:
https://hg.tryton.org/modules/commission/file/tip/tests/scenario_commission.rst#l177
I'm not sure what's the best/easiest way to solve this.
Here's the backtrace:
Traceback (most recent call last):
File "/usr/lib/python3.7/doctest.py", line 2196, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for scenario_commission.rst
File "/tryton/trytond/trytond/modules/commission/tests/scenario_commission.rst", line 0
----------------------------------------------------------------------
File "/tryton/trytond/trytond/modules/commission/tests/scenario_commission.rst", line 178, in scenario_commission.rst
Failed example:
pay.execute('choice')
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "", line 1, in
pay.execute('choice')
File "/tryton/proteus/proteus/__init__.py", line 1234, in execute
ctx)
File "/tryton/proteus/proteus/config.py", line 188, in __call__
result = rpc.result(meth(*args, **kwargs))
File "/tryton/trytond/trytond/wizard/wizard.py", line 314, in execute
return wizard._execute(state_name)
File "/tryton/trytond/trytond/wizard/wizard.py", line 345, in _execute
result = self._execute(transition())
File "/tryton/trytond/trytond/wizard/wizard.py", line 345, in _execute
result = self._execute(transition())
File "/tryton/trytond/trytond/modules/account_invoice/invoice.py", line 2892, in transition_pay
second_currency, overpayment)
File "/tryton/trytond/trytond/modules/account_invoice/invoice.py", line 1303, in pay_invoice
period_id = Period.find(self.company.id, date=date)
File "/tryton/trytond/trytond/modules/account/period.py", line 188, in find
date=lang.strftime(date)))
trytond.modules.account.exceptions.PeriodNotFoundError: To continue, you must create a period for the date "01/01/2021". -