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