Commit 97e7b755 authored by Julien Muchembled's avatar Julien Muchembled

New testLegacySimulationAdvancedInvoicing and obvious fixes for testAdvancedInvoicing

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@39766 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0a8cea63
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<key> <string>tested_property</string> </key> <key> <string>tested_property</string> </key>
<value> <value>
<tuple> <tuple>
<string>specialise</string>
<string>delivery_mode</string> <string>delivery_mode</string>
<string>incoterm</string> <string>incoterm</string>
<string>source</string> <string>source</string>
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<key> <string>tested_property</string> </key> <key> <string>tested_property</string> </key>
<value> <value>
<tuple> <tuple>
<string>specialise</string>
<string>delivery_mode</string> <string>delivery_mode</string>
<string>incoterm</string> <string>incoterm</string>
<string>source</string> <string>source</string>
......
...@@ -78,7 +78,7 @@ invoice = context\n ...@@ -78,7 +78,7 @@ invoice = context\n
related_packing_list = invoice.getDefaultCausalityValue()\n related_packing_list = invoice.getDefaultCausalityValue()\n
\n \n
# copy trade condition:\n # copy trade condition:\n
if not context.getSpecialise():\n if not context.getSpecialise() and context.portal_skins.hasObject(\'erp5_simulation_legacy\'):\n
related_order = related_packing_list.getDefaultCausalityValue()\n related_order = related_packing_list.getDefaultCausalityValue()\n
if related_order is not None:\n if related_order is not None:\n
context.edit(specialise=related_order.getSpecialise())\n context.edit(specialise=related_order.getSpecialise())\n
......
...@@ -37,7 +37,7 @@ from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase ...@@ -37,7 +37,7 @@ from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from testInvoice import TestSaleInvoiceMixin from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin
class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
"""Test methods for sale and purchase invoice. """Test methods for sale and purchase invoice.
...@@ -364,6 +364,7 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): ...@@ -364,6 +364,7 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
portal_type='Organisation', title='Vendor') portal_type='Organisation', title='Vendor')
invoice = self.portal.getDefaultModule(self.invoice_portal_type).newContent( invoice = self.portal.getDefaultModule(self.invoice_portal_type).newContent(
portal_type=self.invoice_portal_type, portal_type=self.invoice_portal_type,
specialise=self.business_process,
start_date=DateTime(2008, 12, 31), start_date=DateTime(2008, 12, 31),
title='Invoice', title='Invoice',
source_value=vendor, source_value=vendor,
......
...@@ -143,6 +143,9 @@ class TestInvoiceMixin(TestPackingListMixin): ...@@ -143,6 +143,9 @@ class TestInvoiceMixin(TestPackingListMixin):
user = uf.getUserById('test_invoice_user').__of__(uf) user = uf.getUserById('test_invoice_user').__of__(uf)
newSecurityManager(None, user) newSecurityManager(None, user)
def stepCreateSaleInvoiceTransactionRule(self, sequence, **kw) :
pass # see createBusinessProcess
## XXX move this to "Sequence class" ## XXX move this to "Sequence class"
def playSequence(self, sequence_string, quiet=0) : def playSequence(self, sequence_string, quiet=0) :
sequence_list = SequenceList() sequence_list = SequenceList()
......
...@@ -34,8 +34,8 @@ def Legacy_getBusinessTemplateList(cls): ...@@ -34,8 +34,8 @@ def Legacy_getBusinessTemplateList(cls):
bt_list.append(bt) bt_list.append(bt)
if bt == 'erp5_simulation': if bt == 'erp5_simulation':
bt_list.append(bt + '_legacy') bt_list.append(bt + '_legacy')
elif bt in ('erp5_accounting', 'erp5_mrp', elif bt in ('erp5_accounting', 'erp5_invoicing', 'erp5_mrp',
'erp5_project', 'erp5_trade'): 'erp5_project', 'erp5_trade'):
bt_list.append(bt + '_simulation_legacy') bt_list.append(bt + '_simulation_legacy')
return tuple(bt_list) return tuple(bt_list)
cls.getBusinessTemplateList = Legacy_getBusinessTemplateList cls.getBusinessTemplateList = Legacy_getBusinessTemplateList
# -*- coding: utf-8 -*-
##############################################################################
# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
# Julien Muchembled <jm@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
import sys
from Products.ERP5Legacy.tests import testLegacySimulationInvoice
sys.modules['Products.ERP5.tests.testInvoice'] = testLegacySimulationInvoice
from Products.ERP5Legacy.tests import Legacy_getBusinessTemplateList
from Products.ERP5.tests.testAdvancedInvoicing import *
Legacy_getBusinessTemplateList(TestAdvancedInvoice)
TestAdvancedInvoice.business_process = None
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