Commit 56831a07 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix typos and cosmetic changes only.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23646 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0d838be4
#############################################################################
#
# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2006-2008 Nexedi SA and Contributors. All Rights Reserved.
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -35,7 +35,7 @@ from Products.ERP5.Document.PropertyDivergenceTester import \
class CategoryDivergenceTester(PropertyDivergenceTester):
"""
The purpose of this divergence tester is to check the
The purpose of this divergence tester is to check the
consistency between delivery movement and simulation movement
for some specific categories.
"""
......@@ -44,7 +44,7 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
......@@ -60,7 +60,7 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
, PropertySheet.DivergenceTester
)
def explain(self, simulation_movement):
"""
This method returns a list of messages that contains
......@@ -83,21 +83,21 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
delivery_mvt.getPropertyList(tested_property_id)
simulation_category_list = \
simulation_movement.getPropertyList(tested_property_id)
# XXX Don't we need to check the order too ?
delivery_mvt_category_list.sort()
simulation_category_list.sort()
if delivery_mvt_category_list != simulation_category_list:
if delivery_mvt_category_list != simulation_category_list:
delivery_mvt_category_title_list = []
for mvt_category in delivery_mvt_category_list:
category_value = delivery_mvt.resolveCategory(mvt_category)
category_value = delivery_mvt.resolveCategory(mvt_category)
if category_value is not None:
if category_value.getPortalType() == 'Category':
delivery_mvt_category_title_list.append(category_value.getTranslatedTitle())
else:
delivery_mvt_category_title_list.append(category_value.getTitle())
simulation_category_title_list = []
for mvt_category in simulation_category_list:
category_value = delivery_mvt.resolveCategory(mvt_category)
......@@ -106,20 +106,20 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
simulation_category_title_list.append(category_value.getTranslatedTitle())
else:
simulation_category_title_list.append(category_value.getTitle())
delivery_mvt_property = ' , '.join(delivery_mvt_category_title_list)
simulation_mvt_property = ' , '.join(simulation_category_title_list)
message = ObjectMessage(
object_relative_url=delivery_mvt.getRelativeUrl(),
object_relative_url=delivery_mvt.getRelativeUrl(),
simulation_movement=simulation_movement,
decision_value=delivery_mvt_property ,
prevision_value=simulation_mvt_property,
tested_property=tested_property_id,
tested_property=tested_property_id,
message=tested_property_title,
solver_script_list=solver_script_list
)
divergence_message_list.append(message)
divergence_message_list.append(message)
return divergence_message_list
This diff is collapsed.
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2005-2008 Nexedi SA and Contributors. All Rights Reserved.
# Romain Courteaud <romain@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -43,38 +43,38 @@ class SelectMovementError(Exception): pass
class DeliveryBuilder(OrderBuilder):
"""
Delivery Builder objects allow to gather multiple Simulation Movements
into a single Delivery.
into a single Delivery.
The initial quantity property of the Delivery Line is calculated by
summing quantities of related Simulation Movements.
Delivery Builders are called for example whenever an order is confirmed.
They are also called globaly in order to gather any confirmed or above
Simulation Movement which was not associated to any Delivery Line.
They are also called globaly in order to gather any confirmed or above
Simulation Movement which was not associated to any Delivery Line.
Such movements are called orphaned Simulation Movements.
Delivery Builder objects are provided with a set a parameters to achieve
Delivery Builder objects are provided with a set a parameters to achieve
their goal:
A path definition: source, destination, etc. which defines the general
A path definition: source, destination, etc. which defines the general
kind of movements it applies.
simulation_select_method which defines how to query all Simulation
Movements which meet certain criteria (including the above path path
simulation_select_method which defines how to query all Simulation
Movements which meet certain criteria (including the above path path
definition).
collect_order_list which defines how to group selected movements
collect_order_list which defines how to group selected movements
according to gathering rules.
delivery_select_method which defines how to select existing Delivery
delivery_select_method which defines how to select existing Delivery
which may eventually be updated with selected simulation movements.
delivery_module, delivery_type and delivery_line_type which define the
delivery_module, delivery_type and delivery_line_type which define the
module and portal types for newly built Deliveries and Delivery Lines.
Delivery Builders can also be provided with optional parameters to
Delivery Builders can also be provided with optional parameters to
restrict selection to a given root Applied Rule caused by a single Order
or to Simulation Movements related to a limited set of existing
or to Simulation Movements related to a limited set of existing
Deliveries.
"""
......@@ -103,7 +103,7 @@ class DeliveryBuilder(OrderBuilder):
done before building Delivery.
"""
pass
def searchMovementList(self, applied_rule_uid=None,**kw):
"""
defines how to query all Simulation Movements which meet certain criteria
......@@ -157,7 +157,7 @@ class DeliveryBuilder(OrderBuilder):
and delivery movement.
"""
OrderBuilder._setDeliveryMovementProperties(
self, delivery_movement,
self, delivery_movement,
simulation_movement, property_dict,
update_existing_movement=update_existing_movement)
# Check if simulation movement is not already linked to a existing
......@@ -170,11 +170,11 @@ class DeliveryBuilder(OrderBuilder):
simulation_movement.edit(delivery_value=delivery_movement)
# Simulation consistency propagation
security.declareProtected(Permissions.ModifyPortalContent,
security.declareProtected(Permissions.ModifyPortalContent,
'updateFromSimulation')
def updateFromSimulation(self, delivery_relative_url, create_new_delivery=1):
"""
Update all lines of this transaction based on movements in the
Update all lines of this transaction based on movements in the
simulation related to this transaction.
"""
updateFromSimulation = UnrestrictedMethod(self._updateFromSimulation)
......@@ -194,7 +194,7 @@ class DeliveryBuilder(OrderBuilder):
for simulation_movement in movement.getDeliveryRelatedValueList(
portal_type="Simulation Movement"):
simulation_movement.setDelivery(None)
simulation_movement_list.append(simulation_movement)
simulation_movement_list.append(simulation_movement)
# Collect
root_group = self.collectMovement(simulation_movement_list)
......@@ -259,7 +259,7 @@ class DeliveryBuilder(OrderBuilder):
rejected_movement_list.extend(group.getMovementList())
movement_group = movement_group.getGroupList()[0]
property_dict.update(movement_group.getGroupEditDict())
# Put properties on delivery
delivery.edit(**property_dict)
......
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2005-2008 Nexedi SA and Contributors. All Rights Reserved.
# Romain Courteaud <romain@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -42,33 +42,33 @@ class MatrixError(Exception): pass
class OrderBuilder(XMLObject, Amount, Predicate):
"""
Order Builder objects allow to gather multiple Simulation Movements
into a single Delivery.
into a single Delivery.
The initial quantity property of the Delivery Line is calculated by
summing quantities of related Simulation Movements.
Order Builder objects are provided with a set a parameters to achieve
Order Builder objects are provided with a set a parameters to achieve
their goal:
A path definition: source, destination, etc. which defines the general
A path definition: source, destination, etc. which defines the general
kind of movements it applies.
simulation_select_method which defines how to query all Simulation
Movements which meet certain criteria (including the above path path
simulation_select_method which defines how to query all Simulation
Movements which meet certain criteria (including the above path path
definition).
collect_order_list which defines how to group selected movements
collect_order_list which defines how to group selected movements
according to gathering rules.
delivery_select_method which defines how to select existing Delivery
delivery_select_method which defines how to select existing Delivery
which may eventually be updated with selected simulation movements.
delivery_module, delivery_type and delivery_line_type which define the
delivery_module, delivery_type and delivery_line_type which define the
module and portal types for newly built Deliveries and Delivery Lines.
Order Builders can also be provided with optional parameters to
Order Builders can also be provided with optional parameters to
restrict selection to a given root Applied Rule caused by a single Order
or to Simulation Movements related to a limited set of existing
or to Simulation Movements related to a limited set of existing
Deliveries.
"""
......@@ -90,7 +90,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
, PropertySheet.Comment
, PropertySheet.DeliveryBuilder
)
security.declarePublic('build')
def build(self, applied_rule_uid=None, movement_relative_url_list=None,
delivery_relative_url_list=None,**kw):
......@@ -129,10 +129,10 @@ class OrderBuilder(XMLObject, Amount, Predicate):
def callBeforeBuildingScript(self):
"""
Call a script on the module, for example, to remove some
Call a script on the module, for example, to remove some
auto_planned Order.
This part can only be done with a script, because user may want
to keep existing auto_planned Order, and only update lines in
This part can only be done with a script, because user may want
to keep existing auto_planned Order, and only update lines in
them.
No activities are used when deleting a object, so, current
implementation should be OK.
......@@ -147,9 +147,9 @@ class OrderBuilder(XMLObject, Amount, Predicate):
"""
Defines how to query all Simulation Movements which meet certain
criteria (including the above path path definition).
First, select movement matching to criteria define on
First, select movement matching to criteria define on
DeliveryBuilder.
Then, call script simulation_select_method to restrict
Then, call script simulation_select_method to restrict
movement_list.
"""
from Products.ERP5Type.Document import newTempMovement
......@@ -175,7 +175,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
if (inventory_item.inventory is not None):
dumb_movement = inventory_item.getObject()
# Create temporary movement
movement = newTempMovement(self.getPortalObject(),
movement = newTempMovement(self.getPortalObject(),
str(id_count))
id_count += 1
movement.edit(
......@@ -224,7 +224,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
def collectMovement(self, movement_list):
"""
group movements in the way we want. Thanks to this method, we are able
group movements in the way we want. Thanks to this method, we are able
to retrieve movement classed by order, resource, criterion,....
movement_list : the list of movement wich we want to group
check_list : the list of classes used to group movements. The order
......@@ -295,7 +295,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
**kw)
return delivery_list
def _deliveryGroupProcessing(self, delivery_module, movement_group,
def _deliveryGroupProcessing(self, delivery_module, movement_group,
collect_order_list, property_dict,
delivery_to_update_list=None,
activate_kw=None,**kw):
......@@ -321,7 +321,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
activate_kw=activate_kw)
delivery_list.extend(new_delivery_list)
else:
# Test if we can update a existing delivery, or if we need to create
# Test if we can update a existing delivery, or if we need to create
# a new one
delivery = None
for delivery_to_update in delivery_to_update_list:
......@@ -352,7 +352,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
activate_kw=activate_kw,**kw)
delivery_list.append(delivery)
return delivery_list
def _deliveryLineGroupProcessing(self, delivery, movement_group,
collect_order_list, property_dict,
activate_kw=None,**kw):
......@@ -403,7 +403,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# Then, create delivery movement (delivery cell or complete delivery
# line)
group_list = movement_group.getGroupList()
# If no group is defined for cell, we need to continue, in order to
# If no group is defined for cell, we need to continue, in order to
# save the quantity value
if list(group_list) != []:
for group in group_list:
......@@ -438,9 +438,9 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# Get sorted movement for each delivery line
for group in movement_group.getGroupList():
self._deliveryCellGroupProcessing(
delivery_line,
group,
collect_order_list[1:],
delivery_line,
group,
collect_order_list[1:],
property_dict.copy(),
update_existing_line=update_existing_line,
activate_kw=activate_kw)
......@@ -473,7 +473,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
cell = delivery_line.getCell(base_id=base_id, *cell_key)
if self.testObjectProperties(cell, property_dict):
# We update a existing cell
# delivery_ratio of new related movement to this cell
# delivery_ratio of new related movement to this cell
# must be updated to 0.
update_existing_movement = 1
object_to_update = cell
......@@ -484,7 +484,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
omit_optional_variation=1)
if not delivery_line.hasCell(base_id=base_id, *cell_key):
cell = delivery_line.newCell(base_id=base_id, \
portal_type=self.getDeliveryCellPortalType(),
portal_type=self.getDeliveryCellPortalType(),
activate_kw=activate_kw,*cell_key)
vcl = movement.getVariationCategoryList()
cell._edit(category_list=vcl,
......
##############################################################################
#
# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2006-2008 Nexedi SA and Contributors. All Rights Reserved.
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -35,7 +35,7 @@ from Products.ERP5Type import Permissions, PropertySheet, Interface
class PropertyDivergenceTester(XMLObject):
"""
The purpose of this divergence tester is to check the
The purpose of this divergence tester is to check the
consistency between delivery movement and simulation movement
for some specific properties.
"""
......@@ -44,7 +44,7 @@ class PropertyDivergenceTester(XMLObject):
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
......@@ -73,12 +73,12 @@ class PropertyDivergenceTester(XMLObject):
the divergence of the Delivery Line.
"""
divergence_message_list = []
tested_property = self.getTestedPropertyList()
tested_property = self.getTestedPropertyList()
# Get the list of solvers callable in this case
solver_script_list = self.getSolverScriptList()
if solver_script_list is None:
solver_script_list = []
solver_script_list = []
solver_script_list = self._splitStringList(solver_script_list)
delivery_mvt = simulation_movement.getDeliveryValue()
......@@ -96,13 +96,13 @@ class PropertyDivergenceTester(XMLObject):
message=tested_property_title,
solver_script_list=solver_script_list
)
divergence_message_list.append(message)
divergence_message_list.append(message)
return divergence_message_list
def _splitStringList(self, string_list):
"""
Convert a list of string with a pipe (ex: ["azert | qsdfg", ] )
to a list of tuple (ex: [("azert", "qsdfg"), ] )
"""
"""
return [tuple([x.strip() for x in x.split('|')]) for x in string_list]
......@@ -4,10 +4,10 @@
# Rafael M. Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -35,7 +35,7 @@ from Products.ERP5.Document.PropertyDivergenceTester import \
class QuantityDivergenceTester(PropertyDivergenceTester):
"""
The purpose of this divergence tester is to check the
The purpose of this divergence tester is to check the
consistency between delivery movement and simulation movement
for the property quantity.
"""
......@@ -44,14 +44,14 @@ class QuantityDivergenceTester(PropertyDivergenceTester):
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative interfaces
# Declarative interfaces
__implements__ = ( Interface.DivergenceTester, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......@@ -61,7 +61,7 @@ class QuantityDivergenceTester(PropertyDivergenceTester):
, PropertySheet.DivergenceTester
)
def explain(self, simulation_movement):
"""
This method returns a list of messages that contains
......@@ -72,11 +72,11 @@ class QuantityDivergenceTester(PropertyDivergenceTester):
d_quantity = delivery.getQuantity()
quantity = simulation_movement.getCorrectedQuantity()
d_error = simulation_movement.getDeliveryError()
solver_script_list = self.getSolverScriptList()
if solver_script_list is None:
solver_script_list = []
message = ObjectMessage(object_relative_url= delivery.getRelativeUrl(),
simulation_movement = simulation_movement,
decision_value = d_quantity ,
......@@ -85,8 +85,8 @@ class QuantityDivergenceTester(PropertyDivergenceTester):
message='Quantity',
solver_script_list=self._splitStringList(solver_script_list)
)
if quantity is None:
if d_quantity is None:
return []
......
......@@ -1369,7 +1369,7 @@ class ERP5Generator(PortalGenerator):
addMessageCatalog('default', 'ERP5 Localized Messages', ('en',))
addMessageCatalog('erp5_ui', 'ERP5 Localized Interface', ('en',))
addMessageCatalog('erp5_content', 'ERP5 Localized Content', ('en',))
# Add an error_log
if 'error_log' not in p.objectIds():
manage_addErrorLog(p)
......
##############################################################################
#
# Copyright (c) 2002, 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2002-2008 Nexedi SA and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
# Yoshinori Okuji <yo@nexedi.com>
# Romain Courteaud <romain@nexedi.com>
......
##############################################################################
#
# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2006-2008 Nexedi SA and Contributors. All Rights Reserved.
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -41,6 +41,6 @@ class DivergenceTester:
{ 'id' : 'solver_script',
'description' : 'List of scripts used to call the solvers',
'type' : 'string',
'multivalued' : 1,
'multivalued' : 1,
'mode' : 'w' },
)
##############################################################################
#
# Copyright (c) 2004 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2004-2008 Nexedi SA and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
# Jerome Perrin <jerome@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -287,7 +287,7 @@ class TestInvoice(TestInvoiceMixin):
resource_value=resource,
quantity=1,
price=2)
other_entity = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Other Entity')
......@@ -301,7 +301,7 @@ class TestInvoice(TestInvoiceMixin):
delivery_movement = related_applied_rule.contentValues()[0]
invoice_applied_rule = delivery_movement.contentValues()[0]
invoice_movement = invoice_applied_rule.contentValues()[0]
order_line.setSourceValue(other_entity)
get_transaction().commit()
self.tic()
......@@ -497,7 +497,7 @@ class TestInvoice(TestInvoiceMixin):
invoice_transaction_applied_rule = invoice_movement.contentValues()[0]
invoice_transaction_movement =\
invoice_transaction_applied_rule._getOb('income')
order_line.setSourceSectionValue(other_entity)
get_transaction().commit()
self.tic()
......@@ -655,7 +655,7 @@ class TestInvoice(TestInvoiceMixin):
invoice.confirm()
get_transaction().commit()
self.tic()
odt = invoice.Invoice_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......@@ -719,7 +719,7 @@ class TestInvoice(TestInvoiceMixin):
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
self.assertNotEquals(related_packing_list, None)
related_packing_list.start()
related_packing_list.stop()
get_transaction().commit()
......@@ -733,7 +733,7 @@ class TestInvoice(TestInvoiceMixin):
portal_type=self.invoice_line_portal_type)
self.assertEquals(1, len(line_list))
invoice_line = line_list[0]
self.assertEquals(resource, invoice_line.getResourceValue())
self.assertEquals(['size'], invoice_line.getVariationBaseCategoryList())
self.assertEquals(2,
......@@ -791,7 +791,7 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
invoice_line_portal_type = 'Invoice Line'
invoice_cell_portal_type = 'Invoice Cell'
invoice_transaction_line_portal_type = 'Sale Invoice Transaction Line'
# default sequence for one line of not varianted resource.
PACKING_LIST_DEFAULT_SEQUENCE = """
stepCreateEntities
......@@ -1239,7 +1239,7 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
resource_precision = line.getResourceValue().getQuantityPrecision()
self.assertEquals(round(line.getQuantity(), resource_precision),
round(expected_price * line_ratio, resource_precision))
def stepCheckInvoiceLineHasReferenceAndIntIndex(self, sequence=None, **kw):
"""Check that the unique invoice line in the invoice has reference and int
index.
......@@ -1254,9 +1254,9 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
def stepCheckPackingListInvoice(
self, sequence=None, sequence_list=None, **kw):
""" Checks if the delivery builder is working as expected,
""" Checks if the delivery builder is working as expected,
coping the atributes from packing list to invoice."""
packing_list = sequence.get('packing_list')
packing_list = sequence.get('packing_list')
related_invoice_list = packing_list.getCausalityRelatedValueList(
portal_type=self.invoice_portal_type)
self.assertEquals(len(related_invoice_list), 1)
......@@ -2520,7 +2520,7 @@ class TestSaleInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
# We could generate a better reference here.
self.assertEquals('1', invoice.getReference())
def test_16_ManuallyAddedMovements(self, quiet=quiet, run=RUN_ALL_TESTS):
"""
Checks that adding invoice lines and accounting lines to one invoice
......
##############################################################################
# -*- coding: utf8 -*-
# Copyright (c) 2004, 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2004-2008 Nexedi SA and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
# Romain Courteaud <romain@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -571,7 +571,7 @@ class TestOrderMixin:
self.assertEquals( order.getTotalPrice(fast = 0),
order.getTotalPrice(fast = 1) )
def stepCheckOrderTotalPriceAndQuantityFastParameter(self,
def stepCheckOrderTotalPriceAndQuantityFastParameter(self,
sequence=None, sequence_list=None, **kw):
"""
Check the method getTotalPrice on a order .
......@@ -682,7 +682,7 @@ class TestOrderMixin:
"""
self.checkOrderRuleSimulation(rule_id = 'default_order_rule', sequence=sequence, \
sequence_list=sequence_list, **kw)
def checkOrderRuleSimulation(self, rule_id, sequence=None, sequence_list=None, **kw):
"""
Test if simulation is matching order, be sure that rule_id is used
......@@ -953,7 +953,7 @@ class TestOrderMixin:
for applied_rule in related_applied_rule_list.keys():
self.assertTrue(applied_rule.isStable())
def stepPackingListAdoptPrevision(self,sequence=None, sequence_list=None,
def stepPackingListAdoptPrevision(self,sequence=None, sequence_list=None,
**kw):
"""
Check if simulation movement are disconnected
......@@ -998,7 +998,7 @@ class TestOrderMixin:
variated_order_creation_without_tic = variated_order_line_creation + \
variated_line_completion_without_tic
def stepCheckCatalogued(self, sequence=None,
def stepCheckCatalogued(self, sequence=None,
sequence_list=None, **kw):
"""
Check that order is catalogued
......@@ -1010,10 +1010,10 @@ class TestOrderMixin:
result = sql_connection.manage_test(sql)
simulation_state_list = [x['simulation_state'] for x in result]
self.assertEquals(1, len(simulation_state_list))
self.assertEquals(order.getSimulationState(),
self.assertEquals(order.getSimulationState(),
simulation_state_list[0])
def stepCheckCataloguedSimulation(self, sequence=None,
def stepCheckCataloguedSimulation(self, sequence=None,
sequence_list=None, **kw):
"""
Check that simulation is catalogued
......@@ -1027,7 +1027,7 @@ class TestOrderMixin:
result = sql_connection.manage_test(sql)
simulation_state_list = [x['simulation_state'] for x in result]
self.assertEquals(1, len(simulation_state_list))
self.assertEquals(order.getSimulationState(),
self.assertEquals(order.getSimulationState(),
simulation_state_list[0])
class TestOrder(TestOrderMixin, ERP5TypeTestCase):
......@@ -1883,7 +1883,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order_line = order.newContent(portal_type=self.order_line_portal_type)
self.assertEquals(1, len(order.getMovementList()))
# If a sub line is created, its parent should not be considered
# If a sub line is created, its parent should not be considered
# as a movement
sub_order_line = order_line.newContent(
portal_type=self.order_line_portal_type)
......@@ -1894,7 +1894,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
portal_type=self.order_line_portal_type)
self.assertEquals(2, len(order.getMovementList()))
# Create recursively sub lines, and check that the ovement number
# Create recursively sub lines, and check that the ovement number
# is still the same.
for i in range(5):
sub_order_line = sub_order_line.newContent(
......@@ -1930,7 +1930,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
cell_key_list.sort()
for cell_key in cell_key_list:
cell = sub_order_line.newCell(base_id=base_id,
portal_type=self.order_cell_portal_type,
portal_type=self.order_cell_portal_type,
*cell_key)
self.assertEquals(2-1+len(cell_key_list), len(order.getMovementList()))
......@@ -1944,7 +1944,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
cell_key_list.sort()
for cell_key in cell_key_list:
cell = order_line.newCell(base_id=base_id,
portal_type=self.order_cell_portal_type,
portal_type=self.order_cell_portal_type,
*cell_key)
self.assertEquals(2-1+len(cell_key_list), len(order.getMovementList()))
......@@ -2002,7 +2002,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
cell_key = order_line.getCellKeyList(base_id=base_id)[0]
cell = order_line.newCell(
base_id=base_id,
portal_type=self.order_cell_portal_type,
portal_type=self.order_cell_portal_type,
*cell_key)
cell.edit(mapped_value_property_list=['price', 'quantity'],
price=3, quantity=4,
......@@ -2121,7 +2121,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
sub_cell_key = sub_order_line.getCellKeyList(base_id=base_id)[0]
sub_cell = sub_order_line.newCell(
base_id=base_id,
portal_type=self.order_cell_portal_type,
portal_type=self.order_cell_portal_type,
*cell_key)
sub_cell.edit(mapped_value_property_list=['price', 'quantity'],
price=5, quantity=6,
......@@ -2220,7 +2220,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
title="Sub Order Line")
sequence.edit(order_line=order_line)
def test_20_testHierarchicalOrderAppliedRuleGeneration(self, quiet=0,
def test_20_testHierarchicalOrderAppliedRuleGeneration(self, quiet=0,
run=run_all_test):
"""
Test generation and update of an hierarchical order applied rule.
......@@ -2286,7 +2286,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_order_cell_getTotalPrice(self):
# test getTotalPrice and getTotalQuantity on a line with cells
# More precisely, it tests a previous bug where creating a line with
......@@ -2315,7 +2315,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
self.assertEquals(0, line.getTotalPrice())
self.assertEquals(0, order.getTotalQuantity())
self.assertEquals(0, order.getTotalPrice())
self.assertTrue(line.hasInRange('size/Baby', base_id='movement'))
cell_baby = line.newCell('size/Baby', base_id='movement',
portal_type=self.order_cell_portal_type)
......@@ -2408,7 +2408,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......@@ -2440,7 +2440,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......@@ -2477,7 +2477,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......@@ -2517,7 +2517,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......@@ -2559,7 +2559,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......@@ -2586,7 +2586,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
destination_section_value=client)
line = order.newContent(portal_type=self.order_line_portal_type,
description='Content')
if self.order_line_portal_type not in [x.getId() for x in
if self.order_line_portal_type not in [x.getId() for x in
line.allowedContentTypes()]:
return # skip this test if hierarchical orders are not available (eg.
# for Purchase Order)
......@@ -2598,7 +2598,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
......
##############################################################################
# -*- coding: utf8 -*-
#
# Copyright (c) 2008 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
# Łukasz Nowak <lukasz.nowak@ventis.com.pl>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -65,7 +65,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
max_delay = 0.0
min_flow = 0.0
def stepClearActivities(self, sequence=None, sequence_list=None,
def stepClearActivities(self, sequence=None, sequence_list=None,
**kw):
"""
Clear activity tables
......@@ -73,7 +73,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
activity_tool = self.getPortal().portal_activities
activity_tool.manageClearActivities(keep=0)
def stepSetMaxDelayOnResource(self, sequence=None, sequence_list=None,
def stepSetMaxDelayOnResource(self, sequence=None, sequence_list=None,
**kw):
"""
Sets max_delay on resource
......@@ -84,7 +84,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
max_delay = self.max_delay,
)
def stepSetMinFlowOnResource(self, sequence=None, sequence_list=None,
def stepSetMinFlowOnResource(self, sequence=None, sequence_list=None,
**kw):
"""
Sets min_flow on resource
......@@ -95,7 +95,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
min_flow = self.min_flow,
)
def stepFillOrderBuilder(self, sequence=None, sequence_list=None,
def stepFillOrderBuilder(self, sequence=None, sequence_list=None,
**kw):
"""
Fills Order Builder with proper quantites
......@@ -118,7 +118,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
resource_portal_type = self.resource_portal_type,
)
def stepCheckGeneratedDocumentListVariated(self, sequence=None, sequence_list=None,
def stepCheckGeneratedDocumentListVariated(self, sequence=None, sequence_list=None,
**kw):
"""
Checks documents generated by Order Builders with its properties for variated resource
......@@ -133,9 +133,9 @@ class TestOrderBuilderMixin(TestOrderMixin):
1, # XXX
len(generated_document_list)
)
order = generated_document_list[0]
self.assertEquals(
order.getDestinationValue(),
organisation
......@@ -174,7 +174,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
len(order_cell_list),
len(self.wanted_quantity_matrix.itervalues())
)
for order_cell in order_cell_list:
self.assertEquals(
order_cell.getQuantity(),
......@@ -183,7 +183,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
]
)
def stepCheckGeneratedDocumentList(self, sequence=None, sequence_list=None,
def stepCheckGeneratedDocumentList(self, sequence=None, sequence_list=None,
**kw):
"""
Checks documents generated by Order Builders with its properties
......@@ -198,9 +198,9 @@ class TestOrderBuilderMixin(TestOrderMixin):
1, # XXX
len(generated_document_list)
)
order = generated_document_list[0]
self.assertEquals(
order.getDestinationValue(),
organisation
......@@ -233,8 +233,8 @@ class TestOrderBuilderMixin(TestOrderMixin):
order_line.getTotalQuantity(),
self.wanted_quantity
)
def stepBuildOrderBuilder(self, sequence=None, sequence_list=None,
def stepBuildOrderBuilder(self, sequence=None, sequence_list=None,
**kw):
"""
Invokes build method for Order Builder
......@@ -243,7 +243,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
generated_document_list = order_builder.build()
sequence.edit(generated_document_list = generated_document_list)
def stepCreateOrderBuilder(self, sequence=None, sequence_list=None,
def stepCreateOrderBuilder(self, sequence=None, sequence_list=None,
**kw):
"""
Creates empty Order Builder
......@@ -258,7 +258,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
order_builder = order_builder
)
def stepDecreaseOrganisationResourceQuantityVariated(self, sequence=None, sequence_list=None,
def stepDecreaseOrganisationResourceQuantityVariated(self, sequence=None, sequence_list=None,
**kw):
"""
Creates movement with variation from organisation to None.
......@@ -268,7 +268,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
"""
organisation = sequence.get('organisation')
resource = sequence.get('resource')
packing_list_module = self.portal.getDefaultModule(
portal_type = self.packing_list_portal_type
)
......@@ -288,7 +288,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
packing_list_line.setVariationCategoryList(
list(self.decrease_quantity_matrix.iterkeys())
)
get_transaction().commit()
self.tic()
......@@ -306,7 +306,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
packing_list.confirm()
def stepDecreaseOrganisationResourceQuantity(self, sequence=None, sequence_list=None,
def stepDecreaseOrganisationResourceQuantity(self, sequence=None, sequence_list=None,
**kw):
"""
Creates movement from organisation to None.
......@@ -316,7 +316,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
"""
organisation = sequence.get('organisation')
resource = sequence.get('resource')
packing_list_module = self.portal.getDefaultModule(
portal_type = self.packing_list_portal_type
)
......@@ -334,7 +334,7 @@ class TestOrderBuilderMixin(TestOrderMixin):
)
packing_list.confirm()
class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
"""
Test Order Builder functionality
......@@ -369,10 +369,10 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
self.wanted_quantity = 1.0
self.wanted_start_date = self.datetime.earliestTime() \
+ self.order_builder_hardcoded_time_diff
+ self.order_builder_hardcoded_time_diff
self.wanted_stop_date = self.datetime.earliestTime() \
+ self.order_builder_hardcoded_time_diff
+ self.order_builder_hardcoded_time_diff
sequence_list = SequenceList()
sequence_list.addSequenceString(self.common_sequence_string)
......@@ -403,10 +403,10 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
self.wanted_quantity = 1.0
self.wanted_start_date = self.datetime.earliestTime() \
+ self.order_builder_hardcoded_time_diff
+ self.order_builder_hardcoded_time_diff
self.wanted_stop_date = self.datetime.earliestTime() \
+ self.order_builder_hardcoded_time_diff
+ self.order_builder_hardcoded_time_diff
self.decrease_quantity_matrix = {
'size/Man' : 1.0,
......@@ -430,10 +430,10 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
self.wanted_quantity = 1.0
self.wanted_start_date = self.datetime.earliestTime() \
- self.max_delay \
+ self.order_builder_hardcoded_time_diff
+ self.order_builder_hardcoded_time_diff
self.wanted_stop_date = self.datetime.earliestTime() \
+ self.order_builder_hardcoded_time_diff
+ self.order_builder_hardcoded_time_diff
sequence_list = SequenceList()
sequence_list.addSequenceString(self.common_sequence_string)
......
##############################################################################
#
# Copyright (c) 2004, 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2004-2008 Nexedi SA and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -35,7 +35,7 @@ from testOrder import TestOrderMixin
class TestPackingListMixin(TestOrderMixin):
"""
Test business template erp5_trade
Test business template erp5_trade
"""
container_portal_type = 'Container'
container_line_portal_type = 'Container Line'
......@@ -126,7 +126,7 @@ class TestPackingListMixin(TestOrderMixin):
def enableLightInstall(self):
"""
You can override this.
You can override this.
Return if we should do a light install (1) or not (0)
"""
return 1
......@@ -160,7 +160,7 @@ class TestPackingListMixin(TestOrderMixin):
self.assertEquals(packing_list.getPriceCurrency(), \
order.getPriceCurrency())
def stepCheckPackingListIsDivergent(self, sequence=None, sequence_list=None,
def stepCheckPackingListIsDivergent(self, sequence=None, sequence_list=None,
packing_list=None,**kw):
"""
Test if packing list is divergent
......@@ -206,7 +206,7 @@ class TestPackingListMixin(TestOrderMixin):
packing_list = sequence.get('packing_list')
self.assertFalse(packing_list.isDivergent())
def stepChangePackingListLineResource(self, sequence=None,
def stepChangePackingListLineResource(self, sequence=None,
sequence_list=None, **kw):
"""
Change the resource of the packing list.
......@@ -344,7 +344,7 @@ class TestPackingListMixin(TestOrderMixin):
self.assertEquals(self.default_quantity,
simulation_movement.getCorrectedQuantity())
def stepChangePackingListDestination(self, sequence=None,
def stepChangePackingListDestination(self, sequence=None,
sequence_list=None, **kw):
"""
Test if packing list is divergent
......@@ -453,7 +453,7 @@ class TestPackingListMixin(TestOrderMixin):
packing_list_line = sequence.get('packing_list_line')
for simulation_line in simulation_line_list:
self.assertEquals(simulation_line.getDeliveryValue(),packing_list_line)
self.assertEquals(packing_list_line.getCausalityValue(),
self.assertEquals(packing_list_line.getCausalityValue(),
simulation_line.getOrderValue())
def stepCheckSimulationDisconnected(self,sequence=None, sequence_list=None, **kw):
......@@ -497,7 +497,7 @@ class TestPackingListMixin(TestOrderMixin):
for simulation_line in simulation_line_list:
simulation_line.edit(start_date=self.datetime+15)
def stepAdoptPrevision(self,sequence=None, sequence_list=None,
def stepAdoptPrevision(self,sequence=None, sequence_list=None,
packing_list=None,**kw):
"""
Check if simulation movement are disconnected
......@@ -560,7 +560,7 @@ class TestPackingListMixin(TestOrderMixin):
# self.assertNotEquals(new_packing_list.getUid(),packing_list.getUid())
self.assertEquals(len(delivery_value_list),len(resource_list))
def stepAddPackingListContainer(self,sequence=None,
def stepAddPackingListContainer(self,sequence=None,
packing_list=None,sequence_list=None, **kw):
"""
Check if simulation movement are disconnected
......@@ -596,7 +596,7 @@ class TestPackingListMixin(TestOrderMixin):
container_line = sequence.get('container_line')
container_line.edit(quantity=self.default_quantity-1)
def stepSetContainerLineFullQuantity(self,sequence=None, sequence_list=None,
def stepSetContainerLineFullQuantity(self,sequence=None, sequence_list=None,
quantity=None,**kw):
"""
Check if simulation movement are disconnected
......@@ -607,7 +607,7 @@ class TestPackingListMixin(TestOrderMixin):
container_line.edit(quantity=quantity)
container_line.immediateReindexObject()
def stepSetContainerFullQuantity(self,sequence=None, sequence_list=None,
def stepSetContainerFullQuantity(self,sequence=None, sequence_list=None,
quantity=None,**kw):
"""
Really fills the container
......@@ -657,7 +657,7 @@ class TestPackingListMixin(TestOrderMixin):
self.assertEquals(0,packing_list.isPacked())
self.assertEquals('missing',packing_list.getContainerState())
def stepCheckPackingListIsPacked(self,sequence=None, sequence_list=None,
def stepCheckPackingListIsPacked(self,sequence=None, sequence_list=None,
packing_list=None,**kw):
"""
Check that the number of objects in containers are
......@@ -690,7 +690,7 @@ class TestPackingListMixin(TestOrderMixin):
else:
currency = currency_module._getOb('EUR')
sequence.edit(currency=currency)
def stepSetOrderPriceCurrency(self, sequence, **kw) :
"""Set the price currency of the order.
......@@ -703,7 +703,7 @@ class TestPackingListMixin(TestOrderMixin):
order.setPriceCurrency(currency.getRelativeUrl())
class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
run_all_test = 1
......@@ -940,7 +940,7 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
'
# XXX Check if there is a new packing list created
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet)
def test_10_PackingListIncreaseQuantity(self, quiet=quiet, run=run_all_test):
......@@ -1037,7 +1037,7 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
pl = self.getPortal().getDefaultModule(self.packing_list_portal_type
).newContent(portal_type=self.packing_list_portal_type)
self.failUnless(hasattr(pl, 'getPriceCurrency'))
def test_PackingList_viewAsODT(self):
# tests packing list printout
resource = self.portal.getDefaultModule(
......@@ -1063,14 +1063,14 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
packing_list.confirm()
get_transaction().commit()
self.tic()
odt = packing_list.PackingList_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
err_list = odf_validator.validate(odt)
if err_list:
self.fail(''.join(err_list))
class TestPurchasePackingListMixin(TestPackingListMixin):
"""Mixing class with steps to test purchase packing lists.
......@@ -1085,7 +1085,7 @@ class TestPurchasePackingListMixin(TestPackingListMixin):
container_portal_type = None
container_line_portal_type = None
container_cell_portal_type = None
# all steps related to packing and container does not apply on purchase
def ignored_step(self, **kw):
return
......
This diff is collapsed.
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 Nexedi SARL and Contributors. All Rights Reserved.
# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
# Łukasz Nowak <lukasz.nowak@ventis.com.pl>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# 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
# garantees and support are strongly adviced to contract a Free Software
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
......@@ -153,7 +153,7 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
def stepDecreaseProducedDeliveryPackingListQuantity(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('produced_delivery_packing_list')
for line in packing_list.getMovementList():
line.edit(
quantity = line.getQuantity() - 1.0
......@@ -161,7 +161,7 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
def stepDecreaseSupplyDeliveryPackingListQuantity(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('supply_delivery_packing_list')
for line in packing_list.getMovementList():
line.edit(
quantity = line.getQuantity() - 1.0
......@@ -208,7 +208,7 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
supply_movement.getSimulationState(),
supply_delivery_packing_list.getSimulationState()
)
self.assertEquals(
produced_movement.getSimulationState(),
produced_report.getSimulationState()
......@@ -403,7 +403,7 @@ class TestProductionDelivery(TestProductionPackingReportListMixin):
self.transformation_portal_type,
self.resource_portal_type,)
def test_01_sourcingDelivery(self, quiet=0,
def test_01_sourcingDelivery(self, quiet=0,
run=run_all_test):
"""
Test for sourcing type of delivery (Production Report and Production Packing Lists).
......
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