Commit 71e6c5d9 authored by Jean-Paul Smets's avatar Jean-Paul Smets

addPermission changed to addPortalContent

fixed Solanes typo
implementation of deliverable


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@415 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37f60d6a
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solane <jp@nexedi.com> # Jean-Paul Smets-Solanes <jp@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # 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 responsability of assessing all potential
...@@ -44,7 +44,7 @@ class OrderRule(Rule): ...@@ -44,7 +44,7 @@ class OrderRule(Rule):
# CMF Type Definition # CMF Type Definition
meta_type = 'ERP5 Order Rule' meta_type = 'ERP5 Order Rule'
portal_type = 'Order Rule' portal_type = 'Order Rule'
add_permission = Permissions.AddERP5Content add_permission = Permissions.AddPortalContent
isPortalContent = 1 isPortalContent = 1
isRADContent = 1 isRADContent = 1
...@@ -149,7 +149,7 @@ An ERP5 Rule...""" ...@@ -149,7 +149,7 @@ An ERP5 Rule..."""
order_value = movement.getOrderValue(portal_type=order_movement_type_list) order_value = movement.getOrderValue(portal_type=order_movement_type_list)
if order_value is None: if order_value is None:
movement.flushActivity(invoke=0) movement.flushActivity(invoke=0)
applied_rule._delObject(movement.getId()) applied_rule._delObject(movement.getId()) # XXXX Make sur this is not deleted if already in delivery
else: else:
if getattr(order_value, 'isCell', 0): if getattr(order_value, 'isCell', 0):
existing_uid_list += [order_value.getUid()] existing_uid_list += [order_value.getUid()]
...@@ -157,7 +157,7 @@ An ERP5 Rule...""" ...@@ -157,7 +157,7 @@ An ERP5 Rule..."""
# Do not keep head of cells # Do not keep head of cells
#LOG('INFO', 0, 'Order Rule Deleting Simulatino Movement %s' % movement.getRelativeUrl()) #LOG('INFO', 0, 'Order Rule Deleting Simulatino Movement %s' % movement.getRelativeUrl())
order_value.flushActivity(invoke=0) order_value.flushActivity(invoke=0)
applied_rule._delObject(movement.getId()) applied_rule._delObject(movement.getId()) # XXXX Make sur this is not deleted if already in delivery
else: else:
existing_uid_list += [order_value.getUid()] existing_uid_list += [order_value.getUid()]
...@@ -173,7 +173,8 @@ An ERP5 Rule...""" ...@@ -173,7 +173,8 @@ An ERP5 Rule..."""
my_order.portal_types.constructContent(type_name=delivery_line_type, my_order.portal_types.constructContent(type_name=delivery_line_type,
container=applied_rule, container=applied_rule,
id=new_id, id=new_id,
order_value = c order_value = c,
deliverable = 1
) )
#LOG('After Create Cell', 0, str(new_id)) #LOG('After Create Cell', 0, str(new_id))
else: else:
...@@ -183,7 +184,8 @@ An ERP5 Rule...""" ...@@ -183,7 +184,8 @@ An ERP5 Rule..."""
my_order.portal_types.constructContent(type_name=delivery_line_type, my_order.portal_types.constructContent(type_name=delivery_line_type,
container=applied_rule, container=applied_rule,
id=new_id, id=new_id,
order_value = order_line_object order_value = order_line_object,
deliverable = 1
) )
#LOG('After Create Cell', 0, str(new_id)) #LOG('After Create Cell', 0, str(new_id))
# Source, Destination, Quantity, Date, etc. are # Source, Destination, Quantity, Date, etc. are
......
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solane <jp@nexedi.com> # Jean-Paul Smets-Solanes <jp@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # 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 responsability of assessing all potential
...@@ -44,7 +44,7 @@ class TransformationSourcingRule(Rule): ...@@ -44,7 +44,7 @@ class TransformationSourcingRule(Rule):
# CMF Type Definition # CMF Type Definition
meta_type = 'ERP5 Transformation Sourcing Rule' meta_type = 'ERP5 Transformation Sourcing Rule'
portal_type = 'Transformation Sourcing Rule' portal_type = 'Transformation Sourcing Rule'
add_permission = Permissions.AddERP5Content add_permission = Permissions.AddPortalContent
isPortalContent = 1 isPortalContent = 1
isRADContent = 1 isRADContent = 1
...@@ -195,7 +195,8 @@ An ERP5 Rule...""" ...@@ -195,7 +195,8 @@ An ERP5 Rule..."""
source_section_list = (), source_section_list = (),
quantity_unit = my_context_movement.getQuantityUnit(), quantity_unit = my_context_movement.getQuantityUnit(),
destination = my_context_movement.getSource(), destination = my_context_movement.getSource(),
destination_section = my_context_movement.getSourceSection() destination_section = my_context_movement.getSourceSection(),
deliverable = 1
) )
transformation_source.setVariationCategoryList( transformation_source.setVariationCategoryList(
my_context_movement.getVariationCategoryList()) my_context_movement.getVariationCategoryList())
...@@ -211,7 +212,8 @@ An ERP5 Rule...""" ...@@ -211,7 +212,8 @@ An ERP5 Rule..."""
source_section = 'group/Coramy', source_section = 'group/Coramy',
quantity_unit = my_context_movement.getQuantityUnit(), quantity_unit = my_context_movement.getQuantityUnit(),
destination = my_context_movement.getSource(), destination = my_context_movement.getSource(),
destination_section = my_context_movement.getSourceSection() destination_section = my_context_movement.getSourceSection(),
deliverable = 1,
) )
transformation_source.setVariationCategoryList( transformation_source.setVariationCategoryList(
my_context_movement.getVariationCategoryList()) my_context_movement.getVariationCategoryList())
......
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