diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index 4ad711e09c6..aecb32cb5ac 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -74,7 +74,7 @@ class MailMail(models.Model): def default_get(self, fields): # protection for `default_type` values leaking from menu action context (e.g. for invoices) # To remove when automatic context propagation is removed in web client - if self._context.get('default_type') not in self._all_columns['message_type'].column.selection: + if self._context.get('default_type') not in type(self).message_type.base_field.selection: self = self.with_context(dict(self._context, default_type=None)) return super(MailMail, self).default_get(fields) diff --git a/openerp/models.py b/openerp/models.py index ddcc720ecbb..582f4e66a65 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -2987,20 +2987,6 @@ class BaseModel(object): for name, source in parent._inherit_fields.iteritems(): struct[name] = (parent_model, parent_field, source[2], source[3]) - @property - def _all_columns(self): - """ Returns a dict mapping all fields names (self fields and inherited - field via _inherits) to a ``column_info`` object giving detailed column - information. This property is deprecated, use ``_fields`` instead. - """ - result = {} - # do not inverse for loops, since local fields may hide inherited ones! - for k, (parent, m2o, col, original_parent) in self._inherit_fields.iteritems(): - result[k] = fields.column_info(k, col, parent, m2o, original_parent) - for k, col in self._columns.iteritems(): - result[k] = fields.column_info(k, col) - return result - @api.model def _inherits_check(self): for table, field_name in self._inherits.items(): diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 8275efa4b4a..d4db13ba953 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1814,46 +1814,3 @@ class property(function): fnct_search=self._property_search, **args ) - - -class column_info(object): - """ Struct containing details about an osv column, either one local to - its model, or one inherited via _inherits. - - .. attribute:: name - - name of the column - - .. attribute:: column - - column instance, subclass of :class:`_column` - - .. attribute:: parent_model - - if the column is inherited, name of the model that contains it, - ``None`` for local columns. - - .. attribute:: parent_column - - the name of the column containing the m2o relationship to the - parent model that contains this column, ``None`` for local columns. - - .. attribute:: original_parent - - if the column is inherited, name of the original parent model that - contains it i.e in case of multilevel inheritance, ``None`` for - local columns. - """ - __slots__ = ['name', 'column', 'parent_model', 'parent_column', 'original_parent'] - - def __init__(self, name, column, parent_model=None, parent_column=None, original_parent=None): - self.name = name - self.column = column - self.parent_model = parent_model - self.parent_column = parent_column - self.original_parent = original_parent - - def __str__(self): - return '%s(%s, %s, %s, %s, %s)' % ( - self.__class__.__name__, self.name, self.column, - self.parent_model, self.parent_column, self.original_parent)