Commit 0ffeaac6 authored by Gabriel Monnerat's avatar Gabriel Monnerat Committed by Jérome Perrin

erp5_officejs_support_request: Avoid to select the first item

If we have more than two options to project and resource
parent 2d2f2b57
......@@ -11,7 +11,6 @@
<value>
<list>
<string>default</string>
<string>first_item</string>
<string>items</string>
<string>title</string>
</list>
......@@ -57,16 +56,14 @@
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
......@@ -74,7 +71,7 @@
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -100,10 +97,6 @@
<key> <string>field_id</string> </key>
<value> <string>my_ticket_resource</string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
......@@ -145,7 +138,24 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[(o.getProperty("title"), o.getProperty("id")) for o in context.getPortalObject().portal_catalog(portal_type="Project", validation_state="validated", select_list=("id", "title"))]</string> </value>
<value> <string encoding="cdata"><![CDATA[
python: len(field.get_value(\'items\') or []) <= 2 and field.get_value(\'items\')[-1][1] or None
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [("", "")] + [(o.getProperty("title"), o.getProperty("id")) for o in context.getPortalObject().portal_catalog(portal_type="Project", validation_state="validated", select_list=("id", "title"))]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>first_item</string>
<string>items</string>
<string>required</string>
......@@ -55,6 +56,12 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -70,7 +77,7 @@
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -92,6 +99,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_ticket_resource</string> </value>
......@@ -129,6 +140,23 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: len(field.get_value(\'items\') or []) <= 2 and field.get_value(\'items\')[-1][1] or None
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......
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