[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:
MTR(OpenERP) 2010-08-11 17:35:54 +05:30 committed by Mustufa Rangwala
parent 096ec13381
commit 54367603a0
1 changed files with 12 additions and 0 deletions

View File

@ -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):
"""