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

Add a related keys for queries on explanation in inventory API

In inventory API queries, stock table is already selected, and we want the query parameters to be applied on this stock table, whereas default related keys would add stock table one more time
parent 9c61fa00
...@@ -72,7 +72,7 @@ if budget_cell is None:\n ...@@ -72,7 +72,7 @@ if budget_cell is None:\n
kw = budget_model.getInventoryQueryDict(budget_cell)\n kw = budget_model.getInventoryQueryDict(budget_cell)\n
\n \n
if engaged_budget:\n if engaged_budget:\n
kw.setdefault(\'explanation_simulation_state\',\n kw.setdefault(\'stock_explanation_simulation_state\',\n
portal.getPortalReservedInventoryStateList() +\n portal.getPortalReservedInventoryStateList() +\n
portal.getPortalCurrentInventoryStateList() +\n portal.getPortalCurrentInventoryStateList() +\n
portal.getPortalTransitInventoryStateList())\n portal.getPortalTransitInventoryStateList())\n
......
...@@ -77,7 +77,7 @@ class BudgetLine(Predicate, XMLMatrix, VariatedMixin): ...@@ -77,7 +77,7 @@ class BudgetLine(Predicate, XMLMatrix, VariatedMixin):
"""Returns all the engagements in a dict where the keys are the cells, and """Returns all the engagements in a dict where the keys are the cells, and
the value is the engaged budget. the value is the engaged budget.
""" """
kw.setdefault('explanation_simulation_state', kw.setdefault('stock_explanation_simulation_state',
self.getPortalReservedInventoryStateList() + self.getPortalReservedInventoryStateList() +
self.getPortalCurrentInventoryStateList() + self.getPortalCurrentInventoryStateList() +
self.getPortalTransitInventoryStateList()) self.getPortalTransitInventoryStateList())
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>table_0</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_related_explanation_from_stock</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
<dtml-var table_0>.uid = stock.explanation_uid
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<key>predicate_uid | predicate/uid/z_related_predicate</key> <key>predicate_uid | predicate/uid/z_related_predicate</key>
<key>related_resource_from_use_category_uid | category,category/category_uid/z_related_resource_from_use</key> <key>related_resource_from_use_category_uid | category,category/category_uid/z_related_resource_from_use</key>
<key>resourceType | stock,catalog/portal_type/z_related_resource_from_stock</key> <key>resourceType | stock,catalog/portal_type/z_related_resource_from_stock</key>
<key>stock_explanation_portal_type | catalog/portal_type/z_related_explanation_from_stock</key>
<key>stock_explanation_simulation_state | catalog/simulation_state/z_related_explanation_from_stock</key>
<key>stock_function_category_strict_membership_uid | category/category_uid/z_related_strict_membership_function_uid_from_stock</key> <key>stock_function_category_strict_membership_uid | category/category_uid/z_related_strict_membership_function_uid_from_stock</key>
<key>stock_function_category_uid | category/category_uid/z_related_function_uid_from_stock</key> <key>stock_function_category_uid | category/category_uid/z_related_function_uid_from_stock</key>
<key>stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock</key> <key>stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock</key>
......
...@@ -86,6 +86,7 @@ erp5_mysql_innodb/z_related_base_category_id ...@@ -86,6 +86,7 @@ erp5_mysql_innodb/z_related_base_category_id
erp5_mysql_innodb/z_related_career_skill erp5_mysql_innodb/z_related_career_skill
erp5_mysql_innodb/z_related_children erp5_mysql_innodb/z_related_children
erp5_mysql_innodb/z_related_explanation erp5_mysql_innodb/z_related_explanation
erp5_mysql_innodb/z_related_explanation_from_stock
erp5_mysql_innodb/z_related_function_uid_from_stock erp5_mysql_innodb/z_related_function_uid_from_stock
erp5_mysql_innodb/z_related_funding_uid_from_stock erp5_mysql_innodb/z_related_funding_uid_from_stock
erp5_mysql_innodb/z_related_grand_parent erp5_mysql_innodb/z_related_grand_parent
......
...@@ -59,4 +59,6 @@ related_resource_from_use_category_uid | category,category/category_uid/z_relate ...@@ -59,4 +59,6 @@ related_resource_from_use_category_uid | category,category/category_uid/z_relate
stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock
stock_funding_category_uid | category/category_uid/z_related_funding_uid_from_stock stock_funding_category_uid | category/category_uid/z_related_funding_uid_from_stock
stock_payment_request_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_request_uid_from_stock stock_payment_request_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_request_uid_from_stock
stock_payment_request_category_uid | category/category_uid/z_related_payment_request_uid_from_stock stock_payment_request_category_uid | category/category_uid/z_related_payment_request_uid_from_stock
\ No newline at end of file stock_explanation_portal_type | catalog/portal_type/z_related_explanation_from_stock
stock_explanation_simulation_state | catalog/simulation_state/z_related_explanation_from_stock
\ 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