Add test for GL with empty period list
issue7993 review58481002
This commit is contained in:
1 parent
46e430956e
commit
4212c2d034
1 file changed
+36
@@ -94,6 +94,42 @@ Print some reports::
|
||||
... })
|
||||
>>> _ = general_ledger.execute(gl_accounts)
|
||||
|
||||
>>> 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,
|
||||
|
||||
Reference in new issue
Block a user