[Erp5-report] r9356 - /erp5/trunk/products/ERP5Type/Accessor/AcquiredProperty.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 23 16:32:29 CEST 2006


Author: seb
Date: Wed Aug 23 16:32:28 2006
New Revision: 9356

URL: http://svn.erp5.org?rev=9356&view=rev
Log:
make sure we do not change the address of the related organisation of a person, this fix must be reviewed by Jean-Paul

Modified:
    erp5/trunk/products/ERP5Type/Accessor/AcquiredProperty.py

Modified: erp5/trunk/products/ERP5Type/Accessor/AcquiredProperty.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Accessor/AcquiredProperty.py?rev=9356&r1=9355&r2=9356&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Accessor/AcquiredProperty.py (original)
+++ erp5/trunk/products/ERP5Type/Accessor/AcquiredProperty.py Wed Aug 23 16:32:28 2006
@@ -28,6 +28,7 @@
 
 from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method
 from Products.ERP5Type.PsycoWrapper import psyco
+from zLOG import LOG
 
 class Getter(Method):
     """
@@ -103,7 +104,8 @@
 
 class Setter(Method):
     """
-      Gets the default reference of a relation
+      Sets a value of a property wich can be acquired.
+      Since we set here the property, we must not call acquisition.
     """
     _need__name__=1
 
@@ -150,21 +152,10 @@
       self._reindex = reindex
 
     def __call__(self, instance, value, *args, **kw):
-      o = instance._getDefaultAcquiredProperty(self._key, None, self._null,
-            base_category=self._acquisition_base_category,
-            portal_type=self._acquisition_portal_type,
-            accessor_id=self._acquisition_accessor_id,
-            copy_value=self._acquisition_copy_value,
-            mask_value=self._acquisition_mask_value,
-            sync_value=self._acquisition_sync_value,
-            storage_id=self._storage_id,
-            alt_accessor_id=self._alt_accessor_id,
-            is_list_type=self._is_list_type,
-            is_tales_type=self._is_tales_type
-            )
+      from Products.ERP5Type.Utils import assertAttributePortalType
+      assertAttributePortalType(instance, self._storage_id, self._portal_type)
+      o = getattr(instance, self._storage_id, None)
       if o is None:
-        from Products.ERP5Type.Utils import assertAttributePortalType
-        assertAttributePortalType(instance, self._storage_id, self._portal_type)
         o = instance.newContent(id = self._storage_id, portal_type = self._portal_type[0])
       if self._reindex:
         o.setProperty(self._acquired_property, value, *args, **kw)




More information about the Erp5-report mailing list