Commit 7201a942 authored by Jérome Perrin's avatar Jérome Perrin

make sure using a payment condition in the order does not create any payment

condition in the packing list.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20971 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e03e0546
......@@ -2280,6 +2280,43 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
self.assertEquals(10 + 20, order.getTotalQuantity())
self.assertEquals(10*4 + 20*5, order.getTotalPrice())
def test_order_payment_condition_not_copied(self):
# Payment Condition no longer exist in packing list, so they should not be
# copied in the packing list
resource = self.portal.getDefaultModule(
self.resource_portal_type).newContent(
portal_type=self.resource_portal_type,
title='Resource',)
client = self.portal.organisation_module.newContent(
portal_type='Organisation', title='Client')
vendor = self.portal.organisation_module.newContent(
portal_type='Organisation', title='Vendor')
order = self.portal.getDefaultModule(self.order_portal_type).newContent(
portal_type=self.order_portal_type,
title='Order',
source_value=vendor,
source_section_value=vendor,
destination_value=vendor,
destination_section_value=vendor)
line = order.newContent(portal_type=self.order_line_portal_type,
resource_value=resource,
quantity=10,
price=3)
# set properties, on the default payment condition
order.setDefaultPaymentConditionQuantity(10)
self.assertEquals(1, len(order.contentValues(
portal_type='Payment Condition')))
order.confirm()
get_transaction().commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
self.assertNotEquals(related_packing_list, None)
self.assertEquals(0, len(related_packing_list.contentValues(
portal_type='Payment Condition')))
def test_suite():
suite = unittest.TestSuite()
......
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