Commit 93a40a09 authored by Jérome Perrin's avatar Jérome Perrin

make sure a reference is automatically generated on sale invoices


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20072 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 78a64bca
...@@ -37,6 +37,7 @@ TODO: ...@@ -37,6 +37,7 @@ TODO:
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime
from Acquisition import aq_parent from Acquisition import aq_parent
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
...@@ -1846,6 +1847,30 @@ class TestInvoice(TestPackingListMixin, ...@@ -1846,6 +1847,30 @@ class TestInvoice(TestPackingListMixin,
sequence_list.addSequenceString(sequence) sequence_list.addSequenceString(sequence)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_Reference(self):
# A reference is set automatically on Sale Invoice Transaction
supplier = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Supplier')
client = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Client')
currency = self.portal.currency_module.newContent(
portal_type='Currency')
invoice = self.portal.accounting_module.newContent(
portal_type='Sale Invoice Transaction',
start_date=DateTime(),
price_currency_value=currency,
resource_value=currency,
source_section_value=supplier,
destination_section_value=client)
self.portal.portal_workflow.doActionFor(invoice, 'confirm_action')
# We could generate a better reference here.
self.assertEquals('1', invoice.getReference())
def test_15_CopyAndPaste(self, run=RUN_ALL_TESTS): def test_15_CopyAndPaste(self, run=RUN_ALL_TESTS):
"""Test copy on paste on Invoice. """Test copy on paste on Invoice.
When an invoice is copy/pasted, references should be resetted. When an invoice is copy/pasted, references should be resetted.
......
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