Commit 2d51e2a3 authored by Jérome Perrin's avatar Jérome Perrin

fix sorting by GAP ID in account module.

remove related_gap_id, as it's now automatically generated.
add z_related_strict_membership_preferred_gap catalog method.




git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9272 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9101602f
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>table_0</string> <string>table_0</string>
<string>table_1</string> <string>table_1</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -89,8 +89,7 @@ table_1</string> </value> ...@@ -89,8 +89,7 @@ table_1</string> </value>
AND <dtml-var table_1>.relative_url LIKE <dtml-sqlvar expr="portal_preferences.getPreferredAccountingTransactionGap()+\'%\'" type="string">\n AND <dtml-var table_1>.relative_url LIKE <dtml-sqlvar expr="portal_preferences.getPreferredAccountingTransactionGap()+\'%\'" type="string">\n
</dtml-if>\n </dtml-if>\n
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n
AND <dtml-var table_0>.uid = catalog.uid\n AND <dtml-var table_0>.uid = catalog.uid
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -133,8 +132,7 @@ AND <dtml-var table_0>.uid = catalog.uid\n ...@@ -133,8 +132,7 @@ AND <dtml-var table_0>.uid = catalog.uid\n
AND <dtml-var table_1>.relative_url LIKE <dtml-sqlvar expr="portal_preferences.getPreferredAccountingTransactionGap()+\'%\'" type="string">\n AND <dtml-var table_1>.relative_url LIKE <dtml-sqlvar expr="portal_preferences.getPreferredAccountingTransactionGap()+\'%\'" type="string">\n
</dtml-if>\n </dtml-if>\n
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n
AND <dtml-var table_0>.uid = catalog.uid\n AND <dtml-var table_0>.uid = catalog.uid
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>table_0</string> <string>table_0</string>
<string>table_1</string> <string>table_1</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -78,15 +78,20 @@ table_1</string> </value> ...@@ -78,15 +78,20 @@ table_1</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>z_related_gap</string> </value> <value> <string>z_related_strict_membership_preferred_gap</string> </value>
</item> </item>
<item> <item>
<key> <string>src</string> </key> <key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid\n <dtml-var table_1>.uid = <dtml-var table_0>.category_uid\n
<dtml-if expr="portal_preferences.getPreferredAccountingTransactionGap()">\n
AND <dtml-var table_1>.relative_url LIKE <dtml-sqlvar expr="portal_preferences.getPreferredAccountingTransactionGap()+\'%\'" type="string">\n
</dtml-if>\n
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n
AND <dtml-var table_0>.uid = catalog.uid AND <dtml-var table_0>.uid = catalog.uid\n
AND <dtml-var table_0>.category_strict_membership = 1\n
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -125,8 +130,13 @@ AND <dtml-var table_0>.uid = catalog.uid ...@@ -125,8 +130,13 @@ AND <dtml-var table_0>.uid = catalog.uid
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid\n <dtml-var table_1>.uid = <dtml-var table_0>.category_uid\n
<dtml-if expr="portal_preferences.getPreferredAccountingTransactionGap()">\n
AND <dtml-var table_1>.relative_url LIKE <dtml-sqlvar expr="portal_preferences.getPreferredAccountingTransactionGap()+\'%\'" type="string">\n
</dtml-if>\n
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.gap.getUid()">\n
AND <dtml-var table_0>.uid = catalog.uid AND <dtml-var table_0>.uid = catalog.uid\n
AND <dtml-var table_0>.category_strict_membership = 1\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
<key_list> <key_list>
<key>gap_id | category,catalog/id/z_related_gap</key>
<key>preferred_gap_id | category,catalog/id/z_related_preferred_gap</key> <key>preferred_gap_id | category,catalog/id/z_related_preferred_gap</key>
<key>preferred_gap_strict_membership_id | category,catalog/id/z_related_strict_membership_preferred_gap</key>
</key_list> </key_list>
\ No newline at end of file
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
try:\n try:\n
# XXX not used !\n
currency = kwd[\'accounting_transaction_line_currency\']\n currency = kwd[\'accounting_transaction_line_currency\']\n
id = currency.split(\'/\')[-1]\n id = currency.split(\'/\')[-1]\n
except KeyError:\n except KeyError:\n
...@@ -80,7 +81,19 @@ if not id:\n ...@@ -80,7 +81,19 @@ if not id:\n
id = \'&nbsp;\'\n id = \'&nbsp;\'\n
\n \n
kwd[\'select_expression\'] = "\'%s\' AS accounting_transaction_line_currency" % id\n kwd[\'select_expression\'] = "\'%s\' AS accounting_transaction_line_currency" % id\n
return context.portal_catalog(**kwd)\n \n
# XXX workaround for #458, we rewrite sort_on id to sort_on using\n
# strict_membership.\n
new_sort_on = []\n
if sort_on is not None:\n
for sort_on_item in sort_on:\n
if sort_on_item[0] == \'preferred_gap_id\':\n
new_sort_on.append(\n
(\'preferred_gap_strict_membership_id\', sort_on_item[1]))\n
else:\n
new_sort_on.append(sort_on_item)\n
\n
return context.portal_catalog(sort_on=new_sort_on, **kwd)\n
]]></string> </value> ]]></string> </value>
...@@ -105,7 +118,7 @@ return context.portal_catalog(**kwd)\n ...@@ -105,7 +118,7 @@ return context.portal_catalog(**kwd)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kwd</string> </value> <value> <string>sort_on=None, **kwd</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -125,12 +138,13 @@ return context.portal_catalog(**kwd)\n ...@@ -125,12 +138,13 @@ return context.portal_catalog(**kwd)\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>sort_on</string>
<string>kwd</string> <string>kwd</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>currency</string> <string>currency</string>
...@@ -138,6 +152,10 @@ return context.portal_catalog(**kwd)\n ...@@ -138,6 +152,10 @@ return context.portal_catalog(**kwd)\n
<string>id</string> <string>id</string>
<string>KeyError</string> <string>KeyError</string>
<string>_write_</string> <string>_write_</string>
<string>new_sort_on</string>
<string>None</string>
<string>_getiter_</string>
<string>sort_on_item</string>
<string>_apply_</string> <string>_apply_</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
...@@ -151,7 +169,9 @@ return context.portal_catalog(**kwd)\n ...@@ -151,7 +169,9 @@ return context.portal_catalog(**kwd)\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -524,6 +524,10 @@ ...@@ -524,6 +524,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
...@@ -556,7 +560,7 @@ ...@@ -556,7 +560,7 @@
</item> </item>
<item> <item>
<key> <string>report_tree</string> </key> <key> <string>report_tree</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
...@@ -598,8 +602,8 @@ ...@@ -598,8 +602,8 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>id</string> <string>preferred_gap_id</string>
<string>id</string> <string>ASC</string>
</tuple> </tuple>
</list> </list>
</value> </value>
......
2006-08-21 jerome
* filter GAP ID using strict_membership in account module list.
2006-08-11 jerome 2006-08-11 jerome
* remove InvoiceTransactionLine_getDestinationItemList and InvoiceTransactionLine_getSourceItemList in favor of AccountingTransactionLine_getNodeItemList, which fixes source/destination inversion on lines ids for Purchase Invoice Transactions. * remove InvoiceTransactionLine_getDestinationItemList and InvoiceTransactionLine_getSourceItemList in favor of AccountingTransactionLine_getNodeItemList, which fixes source/destination inversion on lines ids for Purchase Invoice Transactions.
......
erp5_mysql/z_related_gap erp5_mysql/z_related_preferred_gap
erp5_mysql/z_related_preferred_gap erp5_mysql/z_related_strict_membership_preferred_gap
\ No newline at end of file \ No newline at end of file
preferred_gap_id | category,catalog/id/z_related_preferred_gap preferred_gap_id | category,catalog/id/z_related_preferred_gap
gap_id | category,catalog/id/z_related_gap preferred_gap_strict_membership_id | category,catalog/id/z_related_strict_membership_preferred_gap
\ No newline at end of file \ 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