From 812c4615bc351758cc281818fa0fc223ddb19dd4 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Wed, 12 Sep 2007 09:22:20 +0000
Subject: [PATCH] Add a method asNumericCode. This is easier than using a
 python script, because of the security management with proxy roles.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16287 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Currency.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/product/ERP5/Document/Currency.py b/product/ERP5/Document/Currency.py
index ccd5ef60fd..8a8e577fa4 100644
--- a/product/ERP5/Document/Currency.py
+++ b/product/ERP5/Document/Currency.py
@@ -71,3 +71,8 @@ class Currency(Resource):
     if to_currency is self:
       return quantity
     return quantity
+
+  security.declareProtected(Permissions.AccessContentsInformation, 'asNumericCode')
+  def asNumericCode(self):
+    """Return a numeric code defined in ISO 4217."""
+    return self.Base_convertCurrencyCodeToNumericCode(self.getReference())
-- 
2.30.9