Commit 793e16ff authored by Sebastien Robin's avatar Sebastien Robin

2008-04-10 Seb

* update permission settings on inventory workflow
* add cancel action on invenotry worflow
* add worklist for draft inventories
* improve Duplicate Inventory constraint

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20407 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec8784f6
...@@ -104,12 +104,14 @@ class DuplicateInventory(Constraint): ...@@ -104,12 +104,14 @@ class DuplicateInventory(Constraint):
inventory_list = getCurrentInventoryList(resource=resource, inventory_list = getCurrentInventoryList(resource=resource,
variation_text=variation_text, variation_text=variation_text,
from_date=date, at_date=date, from_date=date, at_date=date,
default_stock_table='inventory_stock',
node=node) node=node)
# LOG('inventory_list sql src', 0, getCurrentInventoryList(resource=resource, LOG('inventory_list sql src', 0, getCurrentInventoryList(resource=resource,
# variation_text=variation_text, variation_text=variation_text,
# from_date=date, at_date=date, from_date=date, at_date=date,
# node=node, src__=1)) default_stock_table='inventory_stock',
# LOG('len inventory_list',0,len(inventory_list)) node=node, src__=1))
LOG('len inventory_list',0,len(inventory_list))
for inventory in inventory_list: for inventory in inventory_list:
movement = getObjectFromUid(inventory.stock_uid) movement = getObjectFromUid(inventory.stock_uid)
if movement.getPortalType().find('Inventory') >= 0: if movement.getPortalType().find('Inventory') >= 0:
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<string>View</string> <string>View</string>
<string>Modify portal content</string> <string>Modify portal content</string>
<string>Add portal content</string> <string>Add portal content</string>
<string>Delete objects</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -86,6 +86,13 @@ if node is None:\n ...@@ -86,6 +86,13 @@ if node is None:\n
message = Message(domain=\'ui\', message=text)\n message = Message(domain=\'ui\', message=text)\n
raise ValidationFailed, message\n raise ValidationFailed, message\n
\n \n
for line in inventory.getMovementList():\n
if line.getResource() is None:\n
text = "Sorry, no resource for line $line_title"\n
message = Message(domain=\'ui\', message=text,\n
mapping={\'line_title\': line.getTitle()})\n
raise ValidationFailed, message\n
\n
\n \n
# use of the constraint\n # use of the constraint\n
error_list = inventory.checkConsistency()\n error_list = inventory.checkConsistency()\n
...@@ -149,6 +156,8 @@ if len(error_list) > 0:\n ...@@ -149,6 +156,8 @@ if len(error_list) > 0:\n
<string>text</string> <string>text</string>
<string>message</string> <string>message</string>
<string>node</string> <string>node</string>
<string>_getiter_</string>
<string>line</string>
<string>error_list</string> <string>error_list</string>
<string>len</string> <string>len</string>
</tuple> </tuple>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cancelled</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancelled</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<list>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<list>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -72,25 +72,25 @@ ...@@ -72,25 +72,25 @@
<item> <item>
<key> <string>Add portal content</string> </key> <key> <string>Add portal content</string> </key>
<value> <value>
<tuple> <tuple/>
<string>Manager</string> </value>
</tuple> </item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
<tuple> <tuple/>
<string>Manager</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>View</string> </key> <key> <string>View</string> </key>
<value> <value>
<tuple> <tuple/>
<string>Manager</string>
</tuple>
</value> </value>
</item> </item>
</dictionary> </dictionary>
......
...@@ -51,23 +51,26 @@ ...@@ -51,23 +51,26 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PersistentMapping" module="Persistence.mapping"/>
<string>Persistence</string> <tuple/>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_container</string> </key> <key> <string>data</string> </key>
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>Access contents information</string> </key> <key> <string>Access contents information</string> </key>
<value> <value>
<list/> <tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -78,6 +81,14 @@ ...@@ -78,6 +81,14 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
...@@ -89,7 +100,12 @@ ...@@ -89,7 +100,12 @@
<item> <item>
<key> <string>View</string> </key> <key> <string>View</string> </key>
<value> <value>
<list/> <tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value> </value>
</item> </item>
</dictionary> </dictionary>
......
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>draft</string> </value> <value> <string>draft</string> </value>
</item> </item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Draft</string> </value> <value> <string>Draft</string> </value>
...@@ -31,6 +37,8 @@ ...@@ -31,6 +37,8 @@
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple>
<string>cancel</string>
<string>cancel_action</string>
<string>delete</string> <string>delete</string>
<string>delete_action</string> <string>delete_action</string>
<string>deliver</string> <string>deliver</string>
...@@ -47,4 +55,90 @@ ...@@ -47,4 +55,90 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cancel</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>cancelled</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></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>
<tuple>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Cancel Inventory</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=cancel_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>cancel</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cancel_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
<value> <value>
<tuple> <tuple>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>worklists</string> </value> <value> <string>worklists</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="WorklistDefinition" module="Products.DCWorkflow.Worklists"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Inventories to validate (%(count)s)</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[
inventory_module/view?simulation_state=draft&local_roles:list=Assignee&local_roles:list=Assignor&reset=1
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Inventories to validate</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1_draft_inventory_list</string> </value>
</item>
<item>
<key> <string>var_matches</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>portal_type</string> </key>
<value>
<tuple>
<string>Inventory</string>
</tuple>
</value>
</item>
<item>
<key> <string>simulation_state</string> </key>
<value>
<tuple>
<string>draft</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
230 231
\ No newline at end of file
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