Commit b137d8eb authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_officejs_support_request: Avoid to select the first item

If we have more than two options to project and resource
parent 208a3b43
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<value> <value>
<list> <list>
<string>default</string> <string>default</string>
<string>first_item</string>
<string>items</string> <string>items</string>
<string>title</string> <string>title</string>
</list> </list>
...@@ -57,16 +56,14 @@ ...@@ -57,16 +56,14 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -74,7 +71,7 @@ ...@@ -74,7 +71,7 @@
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -100,10 +97,6 @@ ...@@ -100,10 +97,6 @@
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_ticket_resource</string> </value> <value> <string>my_ticket_resource</string> </value>
</item> </item>
<item>
<key> <string>first_item</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value> <value> <string>Base_viewCRMFieldLibrary</string> </value>
...@@ -145,7 +138,24 @@ ...@@ -145,7 +138,24 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>first_item</string> <string>first_item</string>
<string>items</string> <string>items</string>
<string>required</string> <string>required</string>
...@@ -55,6 +56,12 @@ ...@@ -55,6 +56,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -70,7 +77,7 @@ ...@@ -70,7 +77,7 @@
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -92,6 +99,10 @@ ...@@ -92,6 +99,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_ticket_resource</string> </value> <value> <string>my_ticket_resource</string> </value>
...@@ -129,6 +140,23 @@ ...@@ -129,6 +140,23 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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> <pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle> </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