Commit b0c5e231 authored by Jérome Perrin's avatar Jérome Perrin

Passing "stop" transition on accounting workflow will remove grouping

references if the group is not valid, so pass this transition later (when the
group is valid).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20217 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d22250d
...@@ -768,7 +768,6 @@ class TestAccountingReports(AccountingTestCase): ...@@ -768,7 +768,6 @@ class TestAccountingReports(AccountingTestCase):
portal_type='Sale Invoice Transaction', portal_type='Sale Invoice Transaction',
title='Transaction 2', title='Transaction 2',
source_reference='2', source_reference='2',
simulation_state='delivered',
destination_section_value=self.organisation_module.client_1, destination_section_value=self.organisation_module.client_1,
start_date=DateTime(2006, 2, 2), start_date=DateTime(2006, 2, 2),
lines=(dict(source_value=account_module.receivable, lines=(dict(source_value=account_module.receivable,
...@@ -792,13 +791,15 @@ class TestAccountingReports(AccountingTestCase): ...@@ -792,13 +791,15 @@ class TestAccountingReports(AccountingTestCase):
dict(source_value=account_module.receivable, dict(source_value=account_module.receivable,
grouping_reference='A', grouping_reference='A',
source_credit=200.0))) source_credit=200.0)))
# we validate t2 later, otherwise grouping reference will be cleaned up
t2.stop()
t2.deliver()
# Another invoice, grouped with a payment transaction in the period # Another invoice, grouped with a payment transaction in the period
t4 = self._makeOne( t4 = self._makeOne(
portal_type='Sale Invoice Transaction', portal_type='Sale Invoice Transaction',
title='Transaction 4', title='Transaction 4',
source_reference='4', source_reference='4',
simulation_state='delivered',
destination_section_value=self.organisation_module.client_1, destination_section_value=self.organisation_module.client_1,
start_date=DateTime(2006, 2, 4), start_date=DateTime(2006, 2, 4),
lines=(dict(source_value=account_module.receivable, lines=(dict(source_value=account_module.receivable,
...@@ -820,6 +821,10 @@ class TestAccountingReports(AccountingTestCase): ...@@ -820,6 +821,10 @@ class TestAccountingReports(AccountingTestCase):
dict(source_value=account_module.receivable, dict(source_value=account_module.receivable,
grouping_reference='B', grouping_reference='B',
source_credit=400.0))) source_credit=400.0)))
t4.stop()
t4.deliver()
get_transaction().commit()
self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.form request_form = self.portal.REQUEST.form
...@@ -2080,7 +2085,7 @@ class TestAccountingReports(AccountingTestCase): ...@@ -2080,7 +2085,7 @@ class TestAccountingReports(AccountingTestCase):
if group != 'hidden': if group != 'hidden':
for field in form.get_fields_in_group(group): for field in form.get_fields_in_group(group):
if field.getId() != 'listbox': if field.getId() != 'listbox':
self.fail('Field %s should not be visible', field.getId()) self.fail('Field %s should not be visible' % field.getId())
report_section.popReport(self.portal) report_section.popReport(self.portal)
# report layout # report layout
......
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