changeset a20e0e48064a in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=a20e0e48064a
description:
Add test for GL with empty period list
issue7993
review58481002
diffstat:
tests/scenario_reports.rst | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diffs (46 lines):
diff -r 8c4c1c2808f6 -r a20e0e48064a tests/scenario_reports.rst
--- a/tests/scenario_reports.rst Wed Jan 30 09:42:11 2019 +0100
+++ b/tests/scenario_reports.rst Wed Jan 30 09:43:12 2019 +0100
@@ -97,6 +97,42 @@
>>> context = {
... 'company': company.id,
... 'fiscalyear': fiscalyear.id,
+ ... }
+ >>> with config.set_context(context):
+ ... gl_revenue, = GeneralLedgerAccount.find([
+ ... ('name', '=', revenue.name),
+ ... ])
+ >>> gl_revenue.start_balance
+ Decimal('0.00')
+ >>> gl_revenue.credit
+ Decimal('10.00')
+ >>> gl_revenue.debit
+ Decimal('0.00')
+ >>> gl_revenue.end_balance
+ Decimal('-10.00')
+
+ >>> context = {
+ ... 'company': company.id,
+ ... 'fiscalyear': fiscalyear.id,
+ ... 'from_date': fiscalyear.periods[0].start_date,
+ ... 'to_date': fiscalyear.periods[1].end_date,
+ ... }
+ >>> with config.set_context(context):
+ ... gl_revenue, = GeneralLedgerAccount.find([
+ ... ('name', '=', revenue.name),
+ ... ])
+ >>> gl_revenue.start_balance
+ Decimal('0.00')
+ >>> gl_revenue.credit
+ Decimal('10.00')
+ >>> gl_revenue.debit
+ Decimal('0.00')
+ >>> gl_revenue.end_balance
+ Decimal('-10.00')
+
+ >>> context = {
+ ... 'company': company.id,
+ ... 'fiscalyear': fiscalyear.id,
... 'start_period': fiscalyear.periods[1].id,
... }
>>> with config.set_context(context):