Commit 3c394cce authored by Yusuke Muraoka's avatar Yusuke Muraoka

- modified ProductionOrderRule to use Business Process

  instead of Supply Chain.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27272 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 757672c2
...@@ -30,8 +30,7 @@ from AccessControl import ClassSecurityInfo ...@@ -30,8 +30,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Rule import Rule from Products.ERP5.Document.Rule import Rule
from Products.ERP5.Document.OrderRule import OrderRule from Products.ERP5.Document.OrderRule import OrderRule
from Products.ERP5.Document.TransformationSourcingRule import\ from Products.ERP5.Document.TransformationRule import TransformationRuleMixin
TransformationSourcingRuleMixin
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
...@@ -93,20 +92,15 @@ class ProductionOrderRule(OrderRule): ...@@ -93,20 +92,15 @@ class ProductionOrderRule(OrderRule):
'quantity_unit', 'quantity_unit',
) )
supply_chain = self.getSupplyChain(applied_rule) root_explanation = self.getRootExplanation(
# We got a supply chain self.getBusinessProcess(applied_rule=applied_rule))
# Try to get the last SupplyLink property_dict['source_section'] = root_explanation.getSourceSection()
last_link = supply_chain.getLastLink() source_method_id = root_explanation.getSourceMethodId()
# We got a valid industrial_phase if source_method_id is None:
# Now, we have to generate Simulation Movement, in order to property_dict['source'] = root_explanation.getSource()
# create a ProductionPackingList. else:
destination_node = last_link.getDestinationValue() property_dict['source'] = getattr(root_explanation, source_method_id)()
source_value = destination_node.getDestination() property_dict['causality'] = root_explanation.getRelativeUrl()
source_section_value = last_link.getDestinationSection()
if source_value is not None:
property_dict["source"] = source_value
if source_section_value is not None:
property_dict["source_section"] = source_section_value
for prop in default_property_list: for prop in default_property_list:
property_dict[prop] = movement.getProperty(prop) property_dict[prop] = movement.getProperty(prop)
...@@ -114,4 +108,4 @@ class ProductionOrderRule(OrderRule): ...@@ -114,4 +108,4 @@ class ProductionOrderRule(OrderRule):
return property_dict return property_dict
from Products.ERP5Type.Utils import monkeyPatch from Products.ERP5Type.Utils import monkeyPatch
monkeyPatch(TransformationSourcingRuleMixin, ProductionOrderRule) monkeyPatch(TransformationRuleMixin, ProductionOrderRule)
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