Commit 3304fe9b authored by Jérome Perrin's avatar Jérome Perrin

accounting_ui_test: fix pylint warnings

This ERP5 Python script was not checked until now, and add wrong indentation
parent 08a1b22a
...@@ -10,11 +10,9 @@ The test operates on 'today' transactions. ...@@ -10,11 +10,9 @@ The test operates on 'today' transactions.
from DateTime import DateTime from DateTime import DateTime
portal = context.getPortalObject() portal = context.getPortalObject()
accounting_module = portal.accounting_module
account_module = portal.account_module account_module = portal.account_module
ledger = portal.portal_categories.ledger ledger = portal.portal_categories.ledger
organisation_module = portal.organisation_module organisation_module = portal.organisation_module
person_module = portal.person_module
one_hour = 1.0 / 24.0 one_hour = 1.0 / 24.0
now = DateTime() now = DateTime()
...@@ -26,12 +24,14 @@ if with_ledger: ...@@ -26,12 +24,14 @@ if with_ledger:
accounting_ledger = ledger.get('accounting', None) accounting_ledger = ledger.get('accounting', None)
if accounting_ledger is None: if accounting_ledger is None:
accounting_ledger = ledger.newContent(portal_type='Category', id='accounting') accounting_ledger = ledger.newContent(portal_type='Category',
id='accounting')
for sub_category_name in ('general', 'detailed'): for sub_category_name in ('general', 'detailed'):
sub_category = accounting_ledger.get(sub_category_name, None) sub_category = accounting_ledger.get(sub_category_name, None)
if sub_category is None: if sub_category is None:
sub_category = accounting_ledger.newContent(portal_type='Category', id=sub_category_name) sub_category = accounting_ledger.newContent(portal_type='Category',
id=sub_category_name)
# necessary for the "ledger" form field to appear and have correct options # necessary for the "ledger" form field to appear and have correct options
accounting_transaction = portal.portal_types.get('Accounting Transaction') accounting_transaction = portal.portal_types.get('Accounting Transaction')
...@@ -59,8 +59,7 @@ context.AccountingTransactionModule_createAccountingTestDocument( ...@@ -59,8 +59,7 @@ context.AccountingTransactionModule_createAccountingTestDocument(
dict(portal_type='Accounting Transaction Line', dict(portal_type='Accounting Transaction Line',
source_value=account_module.goods_sales, source_value=account_module.goods_sales,
source_credit=100.0)), source_credit=100.0)),
**extra_kwargs_general **extra_kwargs_general)
)
context.AccountingTransactionModule_createAccountingTestDocument( context.AccountingTransactionModule_createAccountingTestDocument(
portal_type='Accounting Transaction', portal_type='Accounting Transaction',
...@@ -70,12 +69,12 @@ context.AccountingTransactionModule_createAccountingTestDocument( ...@@ -70,12 +69,12 @@ context.AccountingTransactionModule_createAccountingTestDocument(
destination_section_value=organisation_module.client_1, destination_section_value=organisation_module.client_1,
start_date=today + 2 * one_hour, start_date=today + 2 * one_hour,
embedded=(dict(portal_type='Accounting Transaction Line', embedded=(dict(portal_type='Accounting Transaction Line',
source_value=account_module.payable, source_debit=200.0), source_value=account_module.payable,
source_debit=200.0),
dict(portal_type='Accounting Transaction Line', dict(portal_type='Accounting Transaction Line',
source_value=account_module.goods_sales, source_value=account_module.goods_sales,
source_credit=200.0)), source_credit=200.0)),
**extra_kwargs_general **extra_kwargs_general)
)
if with_ledger: if with_ledger:
context.AccountingTransactionModule_createAccountingTestDocument( context.AccountingTransactionModule_createAccountingTestDocument(
...@@ -86,9 +85,9 @@ if with_ledger: ...@@ -86,9 +85,9 @@ if with_ledger:
destination_section_value=organisation_module.client_1, destination_section_value=organisation_module.client_1,
start_date=today + 3 * one_hour, start_date=today + 3 * one_hour,
embedded=(dict(portal_type='Accounting Transaction Line', embedded=(dict(portal_type='Accounting Transaction Line',
source_value=account_module.payable, source_debit=400.0), source_value=account_module.payable,
source_debit=400.0),
dict(portal_type='Accounting Transaction Line', dict(portal_type='Accounting Transaction Line',
source_value=account_module.goods_sales, source_value=account_module.goods_sales,
source_credit=400.0)), source_credit=400.0)),
**extra_kwargs_detailed **extra_kwargs_detailed)
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment