[IMP] Sale_crm: Warning moved to view init of osv memory wizard for make sale from crm
bzr revid: mra@mra-laptop-20100811120554-xki60bm01pi003kt
This commit is contained in:
parent
096ec13381
commit
54367603a0
|
@ -48,6 +48,18 @@ class crm_make_sale(osv.osv_memory):
|
|||
return False
|
||||
lead = lead_obj.read(cr, uid, active_id, ['partner_id'])
|
||||
return lead['partner_id']
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('active_ids', False) and context['active_ids']:
|
||||
oppr = self.pool.get('crm.lead').browse(cr, uid, context['active_ids'])
|
||||
for line in oppr:
|
||||
if not line.section_id:
|
||||
raise osv.except_osv(_('Warning !'), _(' Sales Team is not specified.'))
|
||||
return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)
|
||||
|
||||
|
||||
|
||||
def makeOrder(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue