From 6ea044e00cd855984cbc9a7b88abafdb71b7e838 Mon Sep 17 00:00:00 2001 From: Rafael Monnerat <rafael@nexedi.com> Date: Fri, 18 Sep 2009 19:58:27 +0000 Subject: [PATCH] Use ERP5Type.Log.log instead ERP5Site.log git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29113 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_dms/Document_getRelatedDocumentList.xml | 5 ++++- .../ERP5Type_getSecurityCategoryFromAssignmentTree.xml | 5 ++++- .../ERP5Type_getSecurityCategoryFromDestination.xml | 8 +++++--- .../SkinTemplateItem/portal_skins/erp5_dms/RSS.xml | 5 ++++- bt5/erp5_dms/bt/revision | 2 +- .../portal_skins/erp5_trade/Order_printAsODSSummary.xml | 5 ++++- .../erp5_trade/SaleOrder_setSaleOrderLineList.xml | 5 ++++- bt5/erp5_trade/bt/revision | 2 +- 8 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getRelatedDocumentList.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getRelatedDocumentList.xml index 853c0df6d8..8a2b3c6fd6 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getRelatedDocumentList.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getRelatedDocumentList.xml @@ -68,6 +68,7 @@ version of each of them.\n # BG - not much use, they\'re too different\n \n from Products.ERP5Type.Utils import convertToUpperCase, convertToMixedCase\n +from Products.ERP5Type.Log import log\n \n def getRelatedLatest(category):\n funcname = \'get%sValueList\' % convertToUpperCase(category)\n @@ -98,7 +99,7 @@ if relation_id == \'all\':\n dic[obj] = None\n return dic.keys()\n \n -context.log(\'Relation %s is not provided for in this script\' % relation)\n +log(\'Relation %s is not provided for in this script\' % relation)\n return [] # failover - undefined relation\n </string> </value> </item> @@ -141,6 +142,8 @@ return [] # failover - undefined relation\n <string>Products.ERP5Type.Utils</string> <string>convertToUpperCase</string> <string>convertToMixedCase</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>getRelatedLatest</string> <string>_getattr_</string> <string>relation_id</string> diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml index 6016b0df42..aa7fc632e7 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml @@ -67,6 +67,7 @@ Differences to the stock implementation:\n """\n \n # XXX For now, this script requires proxy manager to retrieve the Person object in all cases\n +from Products.ERP5Type.Log import log\n \n category_list = []\n \n @@ -112,7 +113,7 @@ for assignment in person_object.contentValues(filter={\'portal_type\': \'Assignm cdict[base_category] = \'/\'.join(grouplist[:-i])\n category_list.append(cdict)\n except RuntimeError,e:\n - context.log(str(e))\n + log(str(e))\n \n return category_list\n @@ -167,6 +168,8 @@ return category_list\n <string>portal_type</string> <string>strict</string> <string>root</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>category_list</string> <string>_getattr_</string> <string>context</string> diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml index e0b817163e..d621789423 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml @@ -57,7 +57,7 @@ Security categories assigned from the Person who is set as the destination\n of the document (e.g. in Memo type).\n """\n -\n +from Products.ERP5Type.Log import log\n category_list = []\n \n for ob in object.getDestinationValueList():\n @@ -72,7 +72,8 @@ for ob in object.getDestinationValueList():\n else:\n raise RuntimeError, "Error: \'%s\' property is required in order to update person security group" % (base_category)\n category_list.append(category_dict)\n -context.log(category_list)\n +\n +log(category_list)\n return category_list\n </string> </value> </item> @@ -122,6 +123,8 @@ return category_list\n <string>user_name</string> <string>object</string> <string>portal_type</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>category_list</string> <string>_getiter_</string> <string>_getattr_</string> @@ -132,7 +135,6 @@ return category_list\n <string>None</string> <string>_write_</string> <string>RuntimeError</string> - <string>context</string> </tuple> </value> </item> diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/RSS.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/RSS.xml index a4c2e21aee..3f2be4761c 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/RSS.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/RSS.xml @@ -181,6 +181,7 @@ from ZTUtils import Batch\n from ZTUtils import LazyFilter\n from Products.CMFCore.utils import getToolByName\n from Products.CMFDefault.utils import toUnicode\n +from Products.ERP5Type.Log import log\n \n req=context.REQUEST\n login,password=(req.get(\'login\'),req.get(\'password\'))\n @@ -190,7 +191,7 @@ if login is not None and password is not None:\n context.portal_skins.updateSkinCookie()\n context.setupCurrentSkin(context.REQUEST)\n \n -context.log(context.portal_membership.isAnonymousUser())\n +log(context.portal_membership.isAnonymousUser())\n ptool = getToolByName(script, \'portal_properties\')\n stool = getToolByName(script, \'portal_syndication\')\n \n @@ -289,6 +290,8 @@ return context.RSS_template(**options)\n <string>getToolByName</string> <string>Products.CMFDefault.utils</string> <string>toUnicode</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>_getattr_</string> <string>context</string> <string>req</string> diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision index d328906f64..65bdad7fa2 100644 --- a/bt5/erp5_dms/bt/revision +++ b/bt5/erp5_dms/bt/revision @@ -1 +1 @@ -1025 \ No newline at end of file +1026 \ No newline at end of file diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_printAsODSSummary.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_printAsODSSummary.xml index 1a578b1919..b70e82f53e 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_printAsODSSummary.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_printAsODSSummary.xml @@ -56,6 +56,7 @@ <value> <string># We wants to get data in order to do a nice summary of items inside the order\n # This report will mainly usefull when the same resource is ordered on many\n # different lines\n +from Products.ERP5Type.Log import log\n if target_language:\n container.REQUEST[\'AcceptLanguage\'].set(target_language, 10)\n \n @@ -91,7 +92,7 @@ def getMovementTitle(movement):\n parent_value = movement.getParentValue()\n while parent_value.getPortalType() not in order_type_list:\n title = parent_value.getTitle() + \' / \' + title\n - context.log(\'parent_value\', parent_value)\n + log(\'parent_value\', parent_value)\n parent_value = parent_value.getParentValue()\n return title\n \n @@ -263,6 +264,8 @@ return context.Order_viewODSSummary(format=format)\n <string>quantity_unit_list</string> <string>format</string> <string>kw</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>_getattr_</string> <string>_getitem_</string> <string>container</string> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml index 84c10f1917..8c6e3d3a76 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml @@ -59,6 +59,7 @@ which were already created so that they are not duplicated.\n """\n from Products.ERP5Type.Message import translateString\n +from Products.ERP5Type.Log import log\n result_list = []\n sale_order_line_list = context.contentValues(portal_type=\'Sale Order Line\')\n if sale_order_line_list!=[]:\n @@ -104,7 +105,7 @@ for line in listbox:\n else:\n # if there was no sale order line already defined\n # for the sale order, add a new sale order line\n - context.log("it goes in here second")\n + log("it goes in here second")\n if len(sale_order_line_list)==0 or line_id not in sale_order_line_id_list:\n sale_order_line= context.newContent(\n portal_type=\'Sale Order Line\',)\n @@ -180,6 +181,8 @@ return context.Base_redirect(form_id, keep_items=dict(\n <string>kw</string> <string>Products.ERP5Type.Message</string> <string>translateString</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>result_list</string> <string>_getattr_</string> <string>context</string> diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index ffad77660d..ddc27b0c1a 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -736 \ No newline at end of file +739 \ No newline at end of file -- 2.30.9