Commit a4ec6924 authored by Titouan Soulard's avatar Titouan Soulard

erp5_trade: rework Inventory workflow

In order to have Inventory Offset Lines, we want the user to be able to check
the generated lines before validating. This commit therefore adds an
intermediate state `planned`, which will be used to trigger generation of
Simulation Movements and building of the offset lines.

Some other small changes have been done to make the actions' names more clear
and adhere to ERP5 standards, but all keep backward compatiblity: previous states
have been kept, and previously validated inventories are now recorded so that
no Simulation Movements will be generated that would impact stock values.
parent 33e44511
...@@ -32,13 +32,20 @@ ...@@ -32,13 +32,20 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>inventory_workflow</string> </value> <value> <string>inventory_workflow</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>workflow used to validate an inventory</string> </value> <value> <string>Workflow used for Inventories with offset lines.\n
Uses standard simulation states, with extra states similar to Inventory Reports.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -18,9 +18,17 @@ ...@@ -18,9 +18,17 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>cancelled document can no longer be used</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -12,9 +12,17 @@ ...@@ -12,9 +12,17 @@
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>deleted document are no longer visible</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -12,9 +12,15 @@ ...@@ -12,9 +12,15 @@
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>in this state, it can no longer be modified</string> </value> <value> <string>A recorded Inventory can no longer be modified.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
...@@ -44,7 +50,7 @@ ...@@ -44,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Validated</string> </value> <value> <string>Recorded</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -20,14 +20,20 @@ ...@@ -20,14 +20,20 @@
<string>destination/portal_workflow/inventory_workflow/transition_cancel_action</string> <string>destination/portal_workflow/inventory_workflow/transition_cancel_action</string>
<string>destination/portal_workflow/inventory_workflow/transition_delete</string> <string>destination/portal_workflow/inventory_workflow/transition_delete</string>
<string>destination/portal_workflow/inventory_workflow/transition_delete_action</string> <string>destination/portal_workflow/inventory_workflow/transition_delete_action</string>
<string>destination/portal_workflow/inventory_workflow/transition_deliver</string> <string>destination/portal_workflow/inventory_workflow/transition_plan</string>
<string>destination/portal_workflow/inventory_workflow/transition_deliver_action</string> <string>destination/portal_workflow/inventory_workflow/transition_plan_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>default state</string> </value> <value> <string>Default state.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/portal_workflow/inventory_workflow/transition_cancel</string>
<string>destination/portal_workflow/inventory_workflow/transition_cancel_action</string>
<string>destination/portal_workflow/inventory_workflow/transition_deliver</string>
<string>destination/portal_workflow/inventory_workflow/transition_deliver_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A planned inventory has related offset simulation movements.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>state_planned</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Calculated</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>cancel the document</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>guard_group</string> </key> <key> <string>guard_group</string> </key>
...@@ -67,7 +69,7 @@ ...@@ -67,7 +69,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Cancel Inventory</string> </value> <value> <string>Cancel</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>action_name</string> </key> <key> <string>action_name</string> </key>
<value> <string>Cancel Inventory</string> </value> <value> <string>Cancel</string> </value>
</item> </item>
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>cancel the document</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>guard_group</string> </key> <key> <string>guard_group</string> </key>
...@@ -65,7 +67,7 @@ ...@@ -65,7 +67,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Cancel Inventory Action</string> </value> <value> <string>Cancel Action</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>mark the document as deleted</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>guard_group</string> </key> <key> <string>guard_group</string> </key>
......
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>trash the document</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>guard_group</string> </key> <key> <string>guard_group</string> </key>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Validate Inventory</string> </value> <value> <string>Record</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>action_name</string> </key> <key> <string>action_name</string> </key>
<value> <string>Validate Inventory</string> </value> <value> <string>Record</string> </value>
</item> </item>
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>mark inventory as delivered, can no longer be modified after</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>guard_group</string> </key> <key> <string>guard_group</string> </key>
...@@ -66,7 +68,7 @@ ...@@ -66,7 +68,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Validate Inventory Action</string> </value> <value> <string>Record Action</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>destination/portal_workflow/inventory_workflow/state_planned</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_plan</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Calculate</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=plan_action</string> </value>
</item>
<item>
<key> <string>action_name</string> </key>
<value> <string>Calculate</string> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/inventory_workflow/script_validateConsistency</string>
<string>after_script/portal_workflow/inventory_workflow/transition_plan</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard_role</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_plan_action</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Calculate Action</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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