Commit bf699b27 authored by Jérome Perrin's avatar Jérome Perrin

calendar: use Movement_getSimulationStateColorText from erp5_project

TaskMovement_getSimulationStateColorText was same content and calendar
depends on project
parent e70c9138
......@@ -417,7 +417,7 @@
</item>
<item>
<key> <string>color_script</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value>
<value> <string>Movement_getSimulationStateColorText</string> </value>
</item>
<item>
<key> <string>constraint_method</string> </key>
......
......@@ -417,7 +417,7 @@
</item>
<item>
<key> <string>color_script</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value>
<value> <string>Movement_getSimulationStateColorText</string> </value>
</item>
<item>
<key> <string>constraint_method</string> </key>
......
......@@ -417,7 +417,7 @@
</item>
<item>
<key> <string>color_script</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value>
<value> <string>Movement_getSimulationStateColorText</string> </value>
</item>
<item>
<key> <string>constraint_method</string> </key>
......
if task.getPortalType() in task.getPortalCalendarPeriodTypeList():
return '#d3d3d3'
simulation_method = getattr(task, 'getSimulationState', None)
if simulation_method is None:
return '#D1E8FF'
simulation_state = simulation_method()
color_dict = {
'draft': '#a7d7ae',
'planned': '#ffff00',
'ordered': '#ff8e56',
'confirmed': '#ff0000',
'started': '#ff00ff',
'stopped': '#00b8ff',
'delivered': '#3deb3d',
}
return color_dict.get(simulation_state, '#D1E8FF')
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>task=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</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