Commit cd2926a1 authored by iv's avatar iv

ERP5Workflow: fix automatic_update value on some configuration workflows

+ raise explicitly when history has empty transition
(this happens when there automatic_update is not true)
parent 8f9421fe
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -36,6 +36,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -36,6 +36,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -36,6 +36,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -36,6 +36,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -34,6 +34,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
......
erp5_full_text_mroonga_catalog
erp5_base
erp5_upgrader_test
erp5_workflow
......@@ -241,16 +241,20 @@ class BusinessConfiguration(Item):
""" Render previous form using workflow history. """
workflow_history = self.getCurrentStateValue().getWorkflowHistory(self, remove_undo=1)
workflow_history.reverse()
for wh in workflow_history:
for history_line in workflow_history:
## go one step back
current_state = self.getCurrentStateValue()
current_state.undoTransition(self)
transition = self.unrestrictedTraverse(wh['transition'])
conf_save = self.unrestrictedTraverse(wh['configuration_save_url'])
if not history_line['transition']:
raise ValueError("Empty URL for transition in workflow history.")
transition = self.unrestrictedTraverse(history_line['transition'])
configuration_save = self.unrestrictedTraverse(
history_line['configuration_save_url']
)
## check if this transition can be shown to user ...
if transition._checkPermission(self) and \
transition.getTransitionFormId() is not None:
return self._displayNextForm(context=conf_save, transition=transition)
return self._displayNextForm(context=configuration_save, transition=transition)
security.declarePrivate('_validateNextForm')
def _validateNextForm(self, **kw):
......
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