Commit 0586cba4 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_mrp: fix and improve

parent eb7c98f6
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sourcing</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Sourcing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -24,9 +24,15 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>delivery_after_generation_script_id</string> </key>
<value> <string>ProductionDelivery_copyOrderProperties</string> </value>
<value> <string>ManufacturingDelivery_copyOrderProperties</string> </value>
</item>
<item>
<key> <string>delivery_cell_collect_order</string> </key>
......
......@@ -46,6 +46,7 @@
<string>source_payment</string>
<string>destination_payment</string>
<string>specialise</string>
<string>price_currency</string>
</tuple>
</value>
</item>
......
......@@ -45,6 +45,10 @@
<string>destination_project</string>
<string>source_payment</string>
<string>destination_payment</string>
<string>specialise</string>
<string>price_currency</string>
<string>incoterm</string>
<string>delivery_mode</string>
</tuple>
</value>
</item>
......
......@@ -46,6 +46,9 @@
<string>source_payment</string>
<string>destination_payment</string>
<string>specialise</string>
<string>price_currency</string>
<string>delivery_mode</string>
<string>incoterm</string>
</tuple>
</value>
</item>
......
......@@ -26,14 +26,13 @@ while context.getSimulationState() == "draft":
if child_list:
child = child_list[0]
# Set Production Order as Causality if needed
causality = child.getCausalityValue(portal_type="Production Packing List")
causality = child.getCausalityValue(portal_type="Production Order")
if causality:
production_order = causality.getCausalityValue()
context.setCausalityValue(production_order)
context.setCausalityValue(causality)
# Confirm if no other Manufacturing Orders are related to Production Order
sibling_list = portal.portal_catalog(
portal_type="Manufacturing Order",
strict_causality_uid=production_order.getUid(),
strict_causality_uid=causality.getUid(),
simulation_state="confirmed",
)
if sibling_list:
......@@ -55,3 +54,8 @@ for property_name in ('start_date', 'stop_date'):
property_value = min(property_value_list)
assert property_value is not None
context.setProperty(property_name, property_value)
context.edit(
start_date = context.getStartDate() - 2,
stop_date = context.getStartDate() - 1
)
if context.getSimulationState() == 'draft':
order = context.getCausalityValue()
context.edit(
comment=order.getComment(),
title=order.getTitle(),
start_date = context.getStartDate() - 2,
stop_date = context.getStartDate() - 1
)
context.Delivery_confirm()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ManufacturingDelivery_copyOrderProperties</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal_categories/trade_phase/manufacturing
portal_categories/trade_phase/manufacturing/order
portal_categories/trade_phase/manufacturing/sourcing
portal_categories/trade_phase/manufacturing/transforming
portal_categories/trade_phase/production
portal_categories/trade_phase/production/delivery
......
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