Person.py 6.15 KB
Newer Older
1
#############################################################################
Jean-Paul Smets's avatar
Jean-Paul Smets committed
2 3
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
Jean-Paul Smets's avatar
Jean-Paul Smets committed
4
#                    Jean-Paul Smets-Solanes <jp@nexedi.com>
Jean-Paul Smets's avatar
Jean-Paul Smets committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
##############################################################################


class Person:
    """
        Person properties and categories
    """

    _properties = (
        # Personal properties
        {   'id'          : 'first_name',
            'description' : '',
            'type'        : 'string',
            'mode'        : 'w' },
        {   'id'          : 'last_name',
            'description' : '',
            'type'        : 'string',
            'mode'        : 'w' },
        {   'id'          : 'middle_name',
            'description' : '',
            'type'        : 'string',
            'mode'        : 'w' },
        {   'id'          : 'prefix',
            'description' : '',
            'type'        : 'string',
            'mode'        : 'w' },
        {   'id'          : 'suffix',
            'description' : '',
            'type'        : 'string',
            'mode'        : 'w' },
        {   'id'          : 'birthday',
            'description' : '',
            'type'        : 'date',
            'mode'        : 'w' },
61 62 63
        {   'id'          : 'social_code',
            'description' : 'The social code of this person',
            'type'        : 'string',
Kevin Deldycke's avatar
Kevin Deldycke committed
64
            'mode'        : 'w' },
Kevin Deldycke's avatar
Kevin Deldycke committed
65
        {   'id'          : 'partners_number',
66 67 68 69 70 71 72 73
            'description' : '',
            'type'        : 'int',
            'mode'        : 'w' },
        {   'id'          : 'children_number',
            'description' : '',
            'type'        : 'int',
            'mode'        : 'w' },

Yoshinori Okuji's avatar
Yoshinori Okuji committed
74
        # Compatibility with early releases
Kevin Deldycke's avatar
Kevin Deldycke committed
75

Jean-Paul Smets's avatar
Jean-Paul Smets committed
76 77 78
        # Contact fields
        { 'id'          : 'address',
          'storage_id'  : 'default_address',
Kevin Deldycke's avatar
Kevin Deldycke committed
79
          'description' : 'The current address of the person',
80
          'type'        : 'content',
Jean-Paul Smets's avatar
Jean-Paul Smets committed
81 82 83 84 85 86 87 88
          'portal_type' : ('Address'),
          'acquisition_base_category' : ('subordination', ),
          'acquisition_portal_type'   : ('Organisation',),
          'acquisition_copy_value'    : 0,
          'acquisition_mask_value'    : 1,
          'acquisition_sync_value'    : 0,
          'acquisition_accessor_id'   : 'getDefaultAddressValue',
          'acquisition_depends'       : None,
89
          'alt_accessor_id'           : ('getCareerDefaultAddressValue',),
Jean-Paul Smets's avatar
Jean-Paul Smets committed
90 91 92
          'mode'        : 'w' },
        { 'id'          : 'telephone',
          'storage_id'  : 'default_telephone',
Kevin Deldycke's avatar
Kevin Deldycke committed
93
          'description' : 'The current telephone of the person',
94
          'type'        : 'content',
Jean-Paul Smets's avatar
Jean-Paul Smets committed
95 96 97 98 99 100 101 102 103 104 105
          'portal_type' : ('Telephone'),
          'acquisition_base_category' : ('subordination', ),
          'acquisition_portal_type'   : ('Organisation',),
          'acquisition_copy_value'    : 0,
          'acquisition_mask_value'    : 1,
          'acquisition_sync_value'    : 0,
          'acquisition_accessor_id'   : 'getDefaultTelephoneValue',
          'acquisition_depends'       : None,
          'mode'        : 'w' },
        { 'id'          : 'fax',
          'storage_id'  : 'default_fax',
Kevin Deldycke's avatar
Kevin Deldycke committed
106
          'description' : 'The current fax of the person',
107
          'type'        : 'content',
Jean-Paul Smets's avatar
Jean-Paul Smets committed
108 109 110 111 112 113 114 115 116 117 118
          'portal_type' : ('Fax'),
          'acquisition_base_category' : ('subordination', ),
          'acquisition_portal_type'   : ('Organisation',),
          'acquisition_copy_value'    : 0,
          'acquisition_mask_value'    : 1,
          'acquisition_sync_value'    : 0,
          'acquisition_accessor_id'   : 'getDefaultFaxValue',
          'acquisition_depends'       : None,
          'mode'        : 'w' },
        { 'id'          : 'email',
          'storage_id'  : 'default_email',
Kevin Deldycke's avatar
Kevin Deldycke committed
119
          'description' : 'The current email of the person',
120
          'type'        : 'content',
Jean-Paul Smets's avatar
Jean-Paul Smets committed
121 122 123 124 125 126 127 128 129
          'portal_type' : ('Email'),
          'acquisition_base_category' : ('subordination', ),
          'acquisition_portal_type'   : ('Organisation',),
          'acquisition_copy_value'    : 0,
          'acquisition_mask_value'    : 1,
          'acquisition_sync_value'    : 0,
          'acquisition_accessor_id'   : 'getDefaultEmailValue',
          'acquisition_depends'       : None,
          'mode'        : 'w' },
Jean-Paul Smets's avatar
Jean-Paul Smets committed
130
        # Subordination properties
131 132
        { 'id'          : 'career',
          'storage_id'  : 'default_career',
Kevin Deldycke's avatar
Kevin Deldycke committed
133
          'description' : 'The current career step of a person.',
134 135
          'type'        : 'content',
          'portal_type' : ('Career'),
Kevin Deldycke's avatar
Kevin Deldycke committed
136 137
          'acquired_property_id' : ('subordination_title', 'subordination', 'value_uids',
                                    'subordination_uid_list',
138
                                    'grade', 'skill_list', 'role','function',
Kevin Deldycke's avatar
Kevin Deldycke committed
139 140
                                   ),
          'mode'        : 'w' },
Jean-Paul Smets's avatar
Jean-Paul Smets committed
141 142
        )

Kevin Deldycke's avatar
Kevin Deldycke committed
143 144 145
    _categories = ( 'region', 'gender', 'product_line', 'subordination', 'nationality', 'marital_status',
                    # Acquired Categories via Career
                    'grade', 'role',
146
                    # Virtual Categories
147
                    'source_region', 'destination_region', )