diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 008e8048a5d..fe749c6013b 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -199,7 +199,10 @@ class res_partner(osv.osv, format_address): 'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'), 'website': fields.char('Website', size=64, help="Website of Partner or Company"), 'comment': fields.text('Notes'), - 'address': fields.one2many('res.partner.address', 'partner_id', 'Contacts'), # should be removed in version 7, but kept until then for backward compatibility + 'address': fields.one2many('res.partner.address', 'partner_id', 'Addresses', + deprecated="The address information is now directly stored on each Partner record. "\ + "Multiple contacts with their own address can be added via the child_ids relationship. "\ + "This field will be removed as of OpenERP 7.1."), 'category_id': fields.many2many('res.partner.category', id1='partner_id', id2='category_id', string='Tags'), 'credit_limit': fields.float(string='Credit Limit'), 'ean13': fields.char('EAN13', size=13), @@ -218,7 +221,8 @@ class res_partner(osv.osv, format_address): 'city': fields.char('City', size=128), 'state_id': fields.many2one("res.country.state", 'State'), 'country_id': fields.many2one('res.country', 'Country'), - 'country': fields.related('country_id', type='many2one', relation='res.country', string='Country'), # for backward compatibility + 'country': fields.related('country_id', type='many2one', relation='res.country', string='Country', + deprecated="This field will be removed as of OpenERP 7.1, use country_id instead"), 'email': fields.char('Email', size=240), 'phone': fields.char('Phone', size=64), 'fax': fields.char('Fax', size=64), diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 037d2a90986..82fb2e9e185 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1552,24 +1552,16 @@ def field_to_dict(model, cr, user, field, context=None): res['fnct_search'] = field._fnct_search and field._fnct_search.func_name or False res['fnct_inv'] = field._fnct_inv and field._fnct_inv.func_name or False res['fnct_inv_arg'] = field._fnct_inv_arg or False - res['func_obj'] = field._obj or False if isinstance(field, many2many): (table, col1, col2) = field._sql_names(model) - res['related_columns'] = [col1, col2] - res['third_table'] = table - for arg in ('string', 'readonly', 'states', 'size', 'required', 'group_operator', - 'change_default', 'translate', 'help', 'select', 'selectable', 'groups'): - if getattr(field, arg): - res[arg] = getattr(field, arg) - for arg in ('digits', 'invisible', 'filters'): + res['m2m_join_columns'] = [col1, col2] + res['m2m_join_table'] = table + for arg in ('string', 'readonly', 'states', 'size', 'group_operator', 'required', + 'change_default', 'translate', 'help', 'select', 'selectable', 'groups', + 'deprecated', 'digits', 'invisible', 'filters'): if getattr(field, arg, None): res[arg] = getattr(field, arg) - if field.string: - res['string'] = field.string - if field.help: - res['help'] = field.help - if hasattr(field, 'selection'): if isinstance(field.selection, (tuple, list)): res['selection'] = field.selection