Commit c23a853f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Trade: Use Dynamic Category First property on Path to use Dynamic result...

Trade: Use Dynamic Category First property on Path to use Dynamic result instead of hard-defined one
parent 853b91df
...@@ -304,6 +304,7 @@ ...@@ -304,6 +304,7 @@
<string>my_view_mode_preferred_tax_use_list</string> <string>my_view_mode_preferred_tax_use_list</string>
<string>my_report_mode_node_category</string> <string>my_report_mode_node_category</string>
<string>my_view_mode_ledger</string> <string>my_view_mode_ledger</string>
<string>my_view_mode_use_dynamic_category_first</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_use_dynamic_category_first</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Use Dynamic Category First</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
<string>my_destination_project_title</string> <string>my_destination_project_title</string>
<string>my_destination_reference</string> <string>my_destination_reference</string>
<string>my_destination_carrier_title</string> <string>my_destination_carrier_title</string>
<string>my_use_dynamic_category_first</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_use_dynamic_category_first</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_use_dynamic_category_first</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -174,9 +174,11 @@ class TradeModelPath(Path): ...@@ -174,9 +174,11 @@ class TradeModelPath(Path):
self.getDestinationArrowBaseCategoryList(): self.getDestinationArrowBaseCategoryList():
category_url_list = self._getAcquiredCategoryMembershipList( category_url_list = self._getAcquiredCategoryMembershipList(
base_category, **kw) base_category, **kw)
if len(category_url_list) == 0 and len(dynamic_category_list) > 0: if len(dynamic_category_list) > 0 and (self.getUseDynamicCategoryFirst()\
or len(category_url_list) == 0):
category_url_list = self._filterCategoryList(dynamic_category_list, category_url_list = self._filterCategoryList(dynamic_category_list,
base_category, **kw) base_category, **kw) \
or category_url_list
if len(category_url_list) > 0: if len(category_url_list) > 0:
result[base_category] = category_url_list result[base_category] = category_url_list
return result return result
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/boolean</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>When true, will use the dynamic value of the category</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>use_dynamic_category_first_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: False</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