[IMP] use model._fields instead of model._all_columns to cover all fields
[odoo/odoo.git] / addons / mail / mail_mail.py
index f474a07..d849b4b 100644 (file)
@@ -73,7 +73,7 @@ class mail_mail(osv.Model):
     def default_get(self, cr, uid, fields, context=None):
         # 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 context and context.get('default_type') and context.get('default_type') not in self._all_columns['type'].column.selection:
+        if context and context.get('default_type') and context.get('default_type') not in self._fields['type'].selection:
             context = dict(context, default_type=None)
         return super(mail_mail, self).default_get(cr, uid, fields, context=context)