[Erp5-users] how to generate getDefaultEmailValue accessor

Bartłomiej Górny bartek at gorny.najlepsze.pl
Thu Jul 14 17:02:18 CEST 2005


Hi

My question is (I think): what entry in a Document or PropertySheet file 
is required for ERP5 to generate a getDefaultEmailValue accessor?

I tried to build a type being a kind of a person, but having a 
default_email like an Organisation (i.e. not acquired by subordination, 
but rather its own). I set up a Document (based on Person), an 
appropriate form (similar to that of Organisation), and put in my 
PropertySheet the following:

         { 'id'          : 'email',
           'storage_id'  : 'default_email',
           'description' : 'This persons default email',
           'type'        : 'content',
           'portal_type' : ('Email'),
           'acquisition_base_category' : ('region', ),
           'acquisition_portal_type'   : ('Category',),
           'acquisition_copy_value'    : 0,
           'acquisition_mask_value'    : 1,
           'acquisition_sync_value'    : 0,
           'acquisition_accessor_id'   : 'getDefaultEmailValue',
           'acquisition_depends'       : None,
           'mode'        : 'w' },

The problem is that the my_default_email_text field alway comes up 
empty, thus erasing the default email the next time 'update' is clicked. 
This is because context.getDefaultEmailText() returns empty string. And 
context.getDefaultEmailValue() throws an AttributeError.

The entry is the same as in Organisation, and so is almost everything 
else, so where's the catch???

Bartek Górny



More information about the Erp5-users mailing list