[MERGE] Sync with trunk
authorThibault Delavallée <tde@openerp.com>
Tue, 21 May 2013 12:36:24 +0000 (14:36 +0200)
committerThibault Delavallée <tde@openerp.com>
Tue, 21 May 2013 12:36:24 +0000 (14:36 +0200)
bzr revid: tde@openerp.com-20130521123624-u6cqs144rbuzrmpo

1  2 
addons/crm/crm_lead.py

diff --combined addons/crm/crm_lead.py
@@@ -274,7 -274,7 +274,7 @@@ class crm_lead(base_stage, format_addre
          'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
          'date_closed': fields.datetime('Closed', readonly=True),
          'stage_id': fields.many2one('crm.case.stage', 'Stage', track_visibility='onchange',
-                         domain="['&', '&', ('fold', '=', False), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"),
+                         domain="['&', ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"),
          'user_id': fields.many2one('res.users', 'Salesperson', select=True, track_visibility='onchange'),
          'referred': fields.char('Referred By', size=64),
          'date_open': fields.datetime('Opened', readonly=True),
          return [lead.section_id.message_get_reply_to()[0] if lead.section_id else False
                      for lead in self.browse(cr, uid, ids, context=context)]
  
 +    def _get_formview_action(self, cr, uid, id, context=None):
 +        action = super(crm_lead, self)._get_formview_action(cr, uid, id, context=context)
 +        obj = self.browse(cr, uid, id, context=context)
 +        if obj.type == 'opportunity':
 +            model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'crm_case_form_view_oppor')
 +            action.update({
 +                'views': [(view_id, 'form')],
 +                })
 +        return action
 +
      def message_get_suggested_recipients(self, cr, uid, ids, context=None):
          recipients = super(crm_lead, self).message_get_suggested_recipients(cr, uid, ids, context=context)
          for lead in self.browse(cr, uid, ids, context=context):