From 31f3201fa80b61941421c3c9679acadf8beaf5ee Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Thu, 24 Aug 2006 11:46:17 +0000 Subject: [PATCH] Can now create _asText script for Address. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9390 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/GeographicAddress.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/product/ERP5/Document/GeographicAddress.py b/product/ERP5/Document/GeographicAddress.py index c120ca5565..e49466c8a0 100644 --- a/product/ERP5/Document/GeographicAddress.py +++ b/product/ERP5/Document/GeographicAddress.py @@ -72,12 +72,14 @@ class GeographicAddress(Coordinate, Base): Returns the address as a complete formatted string with street address, zip, city and region """ - if country=='France' or country=='france' or country=='fr' : - return ('%s\n%s %s') % (self.getStreetAddress() or '', - self.getZipCode() or '', self.getCity() or '') - else : - return ('%s\n%s %s') % (self.getStreetAddress() or '', - self.getCity() or '', self.getZipCode() or '') + result = Coordinate.asText(self) + if result is None: + if country=='France' or country=='france' or country=='fr' : + return ('%s\n%s %s') % (self.getStreetAddress() or '', + self.getZipCode() or '', self.getCity() or '') + else : + return ('%s\n%s %s') % (self.getStreetAddress() or '', + self.getCity() or '', self.getZipCode() or '') security.declareProtected(Permissions.ModifyPortalContent, 'fromText') def fromText(self, coordinate_text): -- 2.30.9