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

* add a field to change id on currencies, only enabled for manager (because...

* add a field to change id on currencies, only enabled for manager (because changing a currency id may reindex many related objects)
* sort and cache in CurrencyModule_getCurrencyItemList
* make symbol field not required on Currency_view




git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9529 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1d43dfbd
......@@ -68,17 +68,31 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>result = [] \n
if include_empty : \n
result = [[\'\', \'\'],]\n
<value> <string>portal = context.getPortalObject()\n
\n
portal = context.getPortalObject() \n
currency_module = getattr(portal, \'currency_module\', getattr(portal, \'currency\', None))\n
def getCurrencyItemList(include_empty=1, portal_path=""):\n
result = []\n
if include_empty :\n
result = [[\'\', \'\'],]\n
currency_module = getattr(portal, \'currency_module\',\n
getattr(portal, \'currency\', None))\n
\n
for currency in currency_module.objectValues() : \n
# for currency, we intentionaly use reference (EUR) not title (Euros).\n
result.append((currency.getReference(), currency.getRelativeUrl()))\n
return result\n
for currency in currency_module.contentValues():\n
# for currency, we intentionaly use reference (EUR) not title (Euros).\n
result.append((currency.getReference() or currency.getTitleOrId(),\n
currency.getRelativeUrl()))\n
\n
result.sort(lambda x,y: cmp(x[0], y[0]))\n
return result\n
\n
from Products.ERP5Type.Cache import CachingMethod\n
getCurrencyItemList = CachingMethod(\n
getCurrencyItemList,\n
id=\'CurrencyModule_getCurrencyItemList\',\n
cache_duration=30000, )\n
\n
return getCurrencyItemList( include_empty=include_empty,\n
portal_path=portal.getPath() )\n
</string> </value>
</item>
<item>
......@@ -87,6 +101,12 @@ return result\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
......@@ -101,7 +121,7 @@ return result\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>include_empty = 1</string> </value>
<value> <string>include_empty=1</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -128,15 +148,12 @@ return result\n
<value>
<tuple>
<string>include_empty</string>
<string>result</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>getattr</string>
<string>None</string>
<string>currency_module</string>
<string>_getiter_</string>
<string>currency</string>
<string>getCurrencyItemList</string>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
</tuple>
</value>
</item>
......@@ -166,4 +183,25 @@ return result\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -146,7 +146,9 @@
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -209,7 +211,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value> <string>ID of the currency. Be aware that changing this ID will reindex all related objects.</string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
......@@ -217,7 +219,7 @@
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>30</int> </value>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
......@@ -269,4 +271,23 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getPortalObject().portal_membership.checkPermission("Manage portal", here)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -245,7 +245,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
2006-08-29 jerome
* add a field to change id on currencies, only enabled for manager (because changing a currency id may reindex many related objects)
* sort and cache in CurrencyModule_getCurrencyItemList
2006-08-28 Romain
* Remove gender's paths
......
17
\ No newline at end of file
18
\ 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