diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml index 62cf8af3124afde28ed43d6b2fe487dd0179cf09..1bc44adf75f4b9fdfef8bf9cfe43177856ccf435 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml @@ -636,6 +636,8 @@ destination_section_where_expression</string> </value> SELECT COUNT(DISTINCT uid) AS count FROM (\n <dtml-else>\n SELECT catalog.*,\n + ( SELECT path FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_path,\n + ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n FROM (\n @@ -662,6 +664,7 @@ destination_section_where_expression</string> </value> <dtml-var sequence-item>\n </dtml-in>\n , delivery.start_date as operation_date\n + , delivery.destination_section_uid as delivery_mirror_section_uid\n , \'source\' as section_mark\n , catalog.source_reference as specific_reference\n <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n @@ -672,10 +675,6 @@ destination_section_where_expression</string> </value> </dtml-if>\n </dtml-let>\n </dtml-if>\n - <dtml-if delivery_mirror_section_title>\n - , mirror_section_catalog.title as delivery_mirror_section_title\n - , mirror_section_catalog.path as delivery_mirror_section_path\n - </dtml-if>\n <dtml-if select_expression><dtml-var select_expression> </dtml-if>\n </dtml-if>\n \n @@ -854,6 +853,7 @@ UNION\n <dtml-var sequence-item>\n </dtml-in>\n , delivery.stop_date as operation_date\n + , delivery.source_section_uid as delivery_mirror_section_uid\n , \'destination\' as section_mark\n , catalog.destination_reference as specific_reference\n <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n @@ -864,10 +864,6 @@ UNION\n </dtml-if>\n </dtml-let>\n </dtml-if>\n - <dtml-if delivery_mirror_section_title>\n - , mirror_section_catalog.title as delivery_mirror_section_title\n - , mirror_section_catalog.path as delivery_mirror_section_path\n - </dtml-if>\n <dtml-if select_expression><dtml-var select_expression> </dtml-if>\n </dtml-if>\n \n @@ -1297,6 +1293,8 @@ UNION\n SELECT COUNT(DISTINCT uid) AS count FROM (\n <dtml-else>\n SELECT catalog.*,\n + ( SELECT path FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_path,\n + ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n FROM (\n @@ -1323,6 +1321,7 @@ UNION\n <dtml-var sequence-item>\n </dtml-in>\n , delivery.start_date as operation_date\n + , delivery.destination_section_uid as delivery_mirror_section_uid\n , \'source\' as section_mark\n , catalog.source_reference as specific_reference\n <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n @@ -1333,10 +1332,6 @@ UNION\n </dtml-if>\n </dtml-let>\n </dtml-if>\n - <dtml-if delivery_mirror_section_title>\n - , mirror_section_catalog.title as delivery_mirror_section_title\n - , mirror_section_catalog.path as delivery_mirror_section_path\n - </dtml-if>\n <dtml-if select_expression><dtml-var select_expression> </dtml-if>\n </dtml-if>\n \n @@ -1515,6 +1510,7 @@ UNION\n <dtml-var sequence-item>\n </dtml-in>\n , delivery.stop_date as operation_date\n + , delivery.source_section_uid as delivery_mirror_section_uid\n , \'destination\' as section_mark\n , catalog.destination_reference as specific_reference\n <dtml-if "section_category">, category.uid as category_uid</dtml-if>\n @@ -1525,10 +1521,6 @@ UNION\n </dtml-if>\n </dtml-let>\n </dtml-if>\n - <dtml-if delivery_mirror_section_title>\n - , mirror_section_catalog.title as delivery_mirror_section_title\n - , mirror_section_catalog.path as delivery_mirror_section_path\n - </dtml-if>\n <dtml-if select_expression><dtml-var select_expression> </dtml-if>\n </dtml-if>\n \n diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyTitle.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyTitle.xml index ed23813c62bfd0327e5b48d65a52c391753381fe..fdb7aa0dd8230b73b77f19f95041562852d6af17 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyTitle.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyTitle.xml @@ -77,16 +77,10 @@ if brain is not None:\n else:\n transaction = context\n \n -mirror_section_key = \'mirror_section_value_%s\' % transaction.getId()\n -\n -try:\n - mirror_section = context.REQUEST[mirror_section_key]\n -except KeyError:\n - if transaction.AccountingTransaction_isSourceView():\n - mirror_section = transaction.getDestinationSectionValue()\n - else:\n - mirror_section = transaction.getSourceSectionValue()\n - context.REQUEST.set(mirror_section_key, mirror_section)\n +if transaction.AccountingTransaction_isSourceView():\n + mirror_section = transaction.getDestinationSectionValue()\n +else:\n + mirror_section = transaction.getSourceSectionValue()\n \n if mirror_section is not None:\n return mirror_section.getTitle()\n @@ -141,10 +135,7 @@ if mirror_section is not None:\n <string>AttributeError</string> <string>None</string> <string>transaction</string> - <string>mirror_section_key</string> - <string>_getitem_</string> <string>mirror_section</string> - <string>KeyError</string> </tuple> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyUrl.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyUrl.xml index fe7bda23770725a2edf74fbcd4ccf7cae0364199..6435fe7530e4d0f26db3ebf8420b85f9a1ffede7 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyUrl.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getThirdPartyUrl.xml @@ -66,10 +66,15 @@ <item> <key> <string>_body</string> </key> <value> <string># XXX bad name: AccountingTransaction_getMirrorSectionUrl sounds more consistent\n -url_template = \'%s/Entity_viewAccountingTransactionList?reset:int=1\'\n +view_name = \'Entity_viewAccountingTransactionList?reset:int=1\'\n \n try:\n - return url_template % context.getPortalObject().restrictedTraverse(context.delivery_mirror_section_path).absolute_url()\n + delivery_mirror_section_path = context.delivery_mirror_section_path\n + if delivery_mirror_section_path is not None:\n + relative_path = \'/\'.join(delivery_mirror_section_path.split(\'/\')[2:])\n + return \'%s/%s/%s\' % (context.portal_url(), relative_path, view_name)\n + else:\n + return None\n except AttributeError:\n pass\n \n @@ -78,19 +83,13 @@ if brain is not None:\n else:\n transaction = context\n \n -mirror_section_key = \'mirror_section_value_%s\' % transaction.getId()\n -\n -try:\n - mirror_section = context.REQUEST[mirror_section_key]\n -except KeyError:\n - if transaction.AccountingTransaction_isSourceView():\n - mirror_section = transaction.getDestinationSectionValue()\n - else:\n - mirror_section = transaction.getSourceSectionValue()\n - context.REQUEST.set(mirror_section_key, mirror_section)\n +if transaction.AccountingTransaction_isSourceView():\n + mirror_section = transaction.getDestinationSectionValue()\n +else:\n + mirror_section = transaction.getSourceSectionValue()\n \n if mirror_section is not None:\n - return url_template % mirror_section.absolute_url()\n + return \'%s/%s\' % (mirror_section.absolute_url(), view_name)\n </string> </value> </item> <item> @@ -137,16 +136,16 @@ if mirror_section is not None:\n <string>selection</string> <string>selection_name</string> <string>kwd</string> - <string>url_template</string> + <string>view_name</string> <string>_getattr_</string> <string>context</string> - <string>AttributeError</string> + <string>delivery_mirror_section_path</string> <string>None</string> - <string>transaction</string> - <string>mirror_section_key</string> <string>_getitem_</string> + <string>relative_path</string> + <string>AttributeError</string> + <string>transaction</string> <string>mirror_section</string> - <string>KeyError</string> </tuple> </value> </item> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 5156988895747eb2ca7584975c2cb3bfa0816719..c8a110e7e87316b30c8d157f061feb45c9e49cb8 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -619 \ No newline at end of file +621 \ No newline at end of file