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
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Rule import Rule
from Products.ERP5.Document.OrderRule import OrderRule
from Products.ERP5.Document.TransformationSourcingRule import\
TransformationSourcingRuleMixin
from Products.ERP5.Document.TransformationRule import TransformationRuleMixin
from zLOG import LOG, WARNING
......@@ -93,25 +92,20 @@ class ProductionOrderRule(OrderRule):
'quantity_unit',
)
supply_chain = self.getSupplyChain(applied_rule)
# We got a supply chain
# Try to get the last SupplyLink
last_link = supply_chain.getLastLink()
# We got a valid industrial_phase
# Now, we have to generate Simulation Movement, in order to
# create a ProductionPackingList.
destination_node = last_link.getDestinationValue()
source_value = destination_node.getDestination()
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
root_explanation = self.getRootExplanation(
self.getBusinessProcess(applied_rule=applied_rule))
property_dict['source_section'] = root_explanation.getSourceSection()
source_method_id = root_explanation.getSourceMethodId()
if source_method_id is None:
property_dict['source'] = root_explanation.getSource()
else:
property_dict['source'] = getattr(root_explanation, source_method_id)()
property_dict['causality'] = root_explanation.getRelativeUrl()
for prop in default_property_list:
property_dict[prop] = movement.getProperty(prop)
return property_dict
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