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 @@ ...@@ -68,17 +68,31 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>result = [] \n <value> <string>portal = context.getPortalObject()\n
if include_empty : \n
result = [[\'\', \'\'],]\n
\n \n
portal = context.getPortalObject() \n def getCurrencyItemList(include_empty=1, portal_path=""):\n
currency_module = getattr(portal, \'currency_module\', getattr(portal, \'currency\', None))\n result = []\n
if include_empty :\n
result = [[\'\', \'\'],]\n
currency_module = getattr(portal, \'currency_module\',\n
getattr(portal, \'currency\', None))\n
\n \n
for currency in currency_module.objectValues() : \n for currency in currency_module.contentValues():\n
# for currency, we intentionaly use reference (EUR) not title (Euros).\n # for currency, we intentionaly use reference (EUR) not title (Euros).\n
result.append((currency.getReference(), currency.getRelativeUrl()))\n result.append((currency.getReference() or currency.getTitleOrId(),\n
return result\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> </string> </value>
</item> </item>
<item> <item>
...@@ -87,6 +101,12 @@ return result\n ...@@ -87,6 +101,12 @@ return result\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <value>
...@@ -101,7 +121,7 @@ return result\n ...@@ -101,7 +121,7 @@ return result\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>include_empty = 1</string> </value> <value> <string>include_empty=1</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -128,15 +148,12 @@ return result\n ...@@ -128,15 +148,12 @@ return result\n
<value> <value>
<tuple> <tuple>
<string>include_empty</string> <string>include_empty</string>
<string>result</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>getattr</string> <string>getCurrencyItemList</string>
<string>None</string> <string>Products.ERP5Type.Cache</string>
<string>currency_module</string> <string>CachingMethod</string>
<string>_getiter_</string>
<string>currency</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -166,4 +183,25 @@ return result\n ...@@ -166,4 +183,25 @@ return result\n
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -146,7 +146,9 @@ ...@@ -146,7 +146,9 @@
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
...@@ -209,7 +211,7 @@ ...@@ -209,7 +211,7 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <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>
<item> <item>
<key> <string>display_maxwidth</string> </key> <key> <string>display_maxwidth</string> </key>
...@@ -217,7 +219,7 @@ ...@@ -217,7 +219,7 @@
</item> </item>
<item> <item>
<key> <string>display_width</string> </key> <key> <string>display_width</string> </key>
<value> <int>30</int> </value> <value> <int>20</int> </value>
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
...@@ -269,4 +271,23 @@ ...@@ -269,4 +271,23 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <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 2006-08-28 Romain
* Remove gender's paths * Remove gender's paths
......
17 18
\ 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