diff --git a/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_preferred_gap.xml b/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_preferred_gap.xml index 85418d84398779435d99acf15646299668a79355..45217afd61029c837f6fc7b209fadf77e3fe960d 100644 --- a/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_preferred_gap.xml +++ b/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_preferred_gap.xml @@ -51,8 +51,8 @@ <key> <string>_keys</string> </key> <value> <list> - <string>table_0</string> - <string>table_1</string> +<string>table_0</string> +<string>table_1</string> </list> </value> </item> @@ -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 </dtml-if>\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> </item> @@ -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 </dtml-if>\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> </item> diff --git a/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_gap.catalog_keys.xml b/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_strict_membership_preferred_gap.catalog_keys.xml similarity index 100% rename from bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_gap.catalog_keys.xml rename to bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_strict_membership_preferred_gap.catalog_keys.xml diff --git a/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_gap.xml b/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_strict_membership_preferred_gap.xml similarity index 84% rename from bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_gap.xml rename to bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_strict_membership_preferred_gap.xml index 64bbb5dee9a93be2421cc60e371c49f31fd6ea98..dd4492bdf01a6ab876e39302582b2f0b31530835 100644 --- a/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_gap.xml +++ b/bt5/erp5_accounting/CatalogMethodTemplateItem/portal_catalog/erp5_mysql/z_related_strict_membership_preferred_gap.xml @@ -51,8 +51,8 @@ <key> <string>_keys</string> </key> <value> <list> - <string>table_0</string> - <string>table_1</string> +<string>table_0</string> +<string>table_1</string> </list> </value> </item> @@ -78,15 +78,20 @@ table_1</string> </value> </item> <item> <key> <string>id</string> </key> - <value> <string>z_related_gap</string> </value> + <value> <string>z_related_strict_membership_preferred_gap</string> </value> </item> <item> <key> <string>src</string> </key> <value> <string encoding="cdata"><![CDATA[ <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>.uid = catalog.uid +AND <dtml-var table_0>.uid = catalog.uid\n +AND <dtml-var table_0>.category_strict_membership = 1\n + ]]></string> </value> </item> @@ -125,8 +130,13 @@ AND <dtml-var table_0>.uid = catalog.uid <value> <string encoding="cdata"><![CDATA[ <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>.uid = catalog.uid +AND <dtml-var table_0>.uid = catalog.uid\n +AND <dtml-var table_0>.category_strict_membership = 1\n + ]]></string> </value> </item> diff --git a/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml b/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml index 05565a8656acdf4ada22c17db1f3b2bb55961bac..3e65965e9b7c5cbf54310a35c7539179e1aeced9 100644 --- a/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml +++ b/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml @@ -1,4 +1,4 @@ <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_strict_membership_id | category,catalog/id/z_related_strict_membership_preferred_gap</key> </key_list> \ No newline at end of file diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.xml index a7f21d26ffc7c3f277ee86425ac6cae431bb170c..64c7e31a1b6863d99fe117f2b8636b56e664e5f0 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.xml @@ -71,6 +71,7 @@ <value> <string encoding="cdata"><![CDATA[ try:\n + # XXX not used !\n currency = kwd[\'accounting_transaction_line_currency\']\n id = currency.split(\'/\')[-1]\n except KeyError:\n @@ -80,7 +81,19 @@ if not id:\n id = \' \'\n \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> @@ -105,7 +118,7 @@ return context.portal_catalog(**kwd)\n </item> <item> <key> <string>_params</string> </key> - <value> <string>**kwd</string> </value> + <value> <string>sort_on=None, **kwd</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -125,12 +138,13 @@ return context.portal_catalog(**kwd)\n <dictionary> <item> <key> <string>co_argcount</string> </key> - <value> <int>0</int> </value> + <value> <int>1</int> </value> </item> <item> <key> <string>co_varnames</string> </key> <value> <tuple> + <string>sort_on</string> <string>kwd</string> <string>_getitem_</string> <string>currency</string> @@ -138,6 +152,10 @@ return context.portal_catalog(**kwd)\n <string>id</string> <string>KeyError</string> <string>_write_</string> + <string>new_sort_on</string> + <string>None</string> + <string>_getiter_</string> + <string>sort_on_item</string> <string>_apply_</string> <string>context</string> </tuple> @@ -151,7 +169,9 @@ return context.portal_catalog(**kwd)\n <item> <key> <string>func_defaults</string> </key> <value> - <none/> + <tuple> + <none/> + </tuple> </value> </item> <item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountList/listbox.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountList/listbox.xml index b9365e30fc252eddaa15eb54a1d2019783bbbd79..5fa1cd9e898f88ebeb0becd274021d70074ce5d1 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountList/listbox.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountList/listbox.xml @@ -524,6 +524,10 @@ <list/> </value> </item> + <item> + <key> <string>page_template</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>portal_types</string> </key> <value> @@ -556,7 +560,7 @@ </item> <item> <key> <string>report_tree</string> </key> - <value> <int>0</int> </value> + <value> <int>1</int> </value> </item> <item> <key> <string>search</string> </key> @@ -598,8 +602,8 @@ <value> <list> <tuple> - <string>id</string> - <string>id</string> + <string>preferred_gap_id</string> + <string>ASC</string> </tuple> </list> </value> diff --git a/bt5/erp5_accounting/bt/change_log b/bt5/erp5_accounting/bt/change_log index c76984f146c58fce89071e732380e03384e39bfc..3fe9c99b05ec194756f6c062b18c1c84a3b5e7fb 100644 --- a/bt5/erp5_accounting/bt/change_log +++ b/bt5/erp5_accounting/bt/change_log @@ -1,3 +1,6 @@ +2006-08-21 jerome +* filter GAP ID using strict_membership in account module list. + 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. diff --git a/bt5/erp5_accounting/bt/template_catalog_method_id_list b/bt5/erp5_accounting/bt/template_catalog_method_id_list index 75cd38255e4007af51098846f0fbc7bb9d279b8b..e2db9dbd5070f272c91e52e2bf511283eb370c92 100644 --- a/bt5/erp5_accounting/bt/template_catalog_method_id_list +++ b/bt5/erp5_accounting/bt/template_catalog_method_id_list @@ -1,2 +1,2 @@ -erp5_mysql/z_related_gap -erp5_mysql/z_related_preferred_gap \ No newline at end of file +erp5_mysql/z_related_preferred_gap +erp5_mysql/z_related_strict_membership_preferred_gap \ No newline at end of file diff --git a/bt5/erp5_accounting/bt/template_catalog_related_key_list b/bt5/erp5_accounting/bt/template_catalog_related_key_list index c91a6f13b200f3d6748f7f776b44976decb0765f..8618c43a71df0dcaab188aa853027ba6457ffc49 100644 --- a/bt5/erp5_accounting/bt/template_catalog_related_key_list +++ b/bt5/erp5_accounting/bt/template_catalog_related_key_list @@ -1,2 +1,2 @@ preferred_gap_id | category,catalog/id/z_related_preferred_gap -gap_id | category,catalog/id/z_related_gap \ No newline at end of file +preferred_gap_strict_membership_id | category,catalog/id/z_related_strict_membership_preferred_gap \ No newline at end of file