Commit 404a122f authored by Alexandre Boeglin's avatar Alexandre Boeglin

Check that getCausalityState is available before calling it.

For instance, Accounting Trnsaction Lines can be contained in a Accounring Rule Cell
of a Invoice Transaction Rule, and none of these provide a causality workflow, but
Accounting Transaction Line is also a possible child of a Accounting Transaction
in the Accounting Transaction Module.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16830 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 57a5778c
No related merge requests found
...@@ -71,7 +71,18 @@ ...@@ -71,7 +71,18 @@
<value> <string>delivery_movement = state_change[\'object\']\n <value> <string>delivery_movement = state_change[\'object\']\n
\n \n
delivery = delivery_movement.getExplanationValue()\n delivery = delivery_movement.getExplanationValue()\n
if delivery.getCausalityState() != \'draft\':\n \n
# Check that getCausalityState is available.\n
# For instance, Accounting Trnsaction Lines\n
# can be contained in a Accounring Rule Cell\n
# of a Invoice Transaction Rule, and none of\n
# these provide a causality workflow, but\n
# Accounting Transaction Line is also a\n
# possible child of a Accounting Transaction\n
# in the Accounting Transaction Module\n
\n
if getattr(delivery, \'getCausalityState\', None) is not None and \\\n
delivery.getCausalityState() != \'draft\':\n
delivery.calculate()\n delivery.calculate()\n
</string> </value> </string> </value>
</item> </item>
...@@ -120,6 +131,8 @@ if delivery.getCausalityState() != \'draft\':\n ...@@ -120,6 +131,8 @@ if delivery.getCausalityState() != \'draft\':\n
<string>delivery_movement</string> <string>delivery_movement</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>delivery</string> <string>delivery</string>
<string>getattr</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
483 500
\ No newline at end of file \ 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