From e17e8d6d5c236302d4ce9b57eb14b52f0bc5f86a Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Fri, 6 May 2016 16:00:44 +0000
Subject: [PATCH] Fix InternetProtocolAddress.asText

  Reimplement for follow up the migration of PropertySheets from Products to ERP5
---
 product/ERP5/Document/InternetProtocolAddress.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/Document/InternetProtocolAddress.py b/product/ERP5/Document/InternetProtocolAddress.py
index 1a5396f738..eadf63eb1a 100644
--- a/product/ERP5/Document/InternetProtocolAddress.py
+++ b/product/ERP5/Document/InternetProtocolAddress.py
@@ -72,8 +72,10 @@ class InternetProtocolAddress(Coordinate):
     if result is None:
       if self.isDetailed():
         tmp_list = []
-        for prop in PropertySheet.InternetProtocolAddress._properties:
-          property_id = prop['id']
+        for prop in self.portal_property_sheets.\
+             InternetProtocolAddress.objectValues(
+               portal_type="Standard Property"):
+          property_id = prop.getReference()
           getter_name = 'get%s' % convertToUpperCase(property_id)
           getter_method = getattr(self, getter_name)
           value = getter_method('')
@@ -115,8 +117,10 @@ network_interface:eth0"""
 
   security.declareProtected(Permissions.AccessContentsInformation, 'isDetailed')
   def isDetailed(self):
-    for prop in PropertySheet.InternetProtocolAddress._properties:
-      property_id = prop['id']
+    for prop in self.portal_property_sheets.\
+           InternetProtocolAddress.objectValues(
+             portal_type="Standard Property"):
+      property_id = prop.getReference()
       tester_name = 'has%s' % convertToUpperCase(property_id)
       tester_method = getattr(self, tester_name)
       value = tester_method()
-- 
2.30.9