Error converting lead to opportunity

Bug #631598 reported by Daniel Watkins (credativ)
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Steps to reproduce:
  1) Create a Lead
  2) Open in form view and click the Convert to Opportunity button
  3) Select the 'Convert to Opportunity' action in the Select Action dialog. Click Next.
  4) Click 'Create Opportunity'.

Expected Behaviour:
   Lead converted to Opportunity.

Observed Behaviour:
   Backtrace. See below.

Version Observed:
   Latest -addons, recent -server.

Environment Information :
System : Linux-2.6.32-2-amd64-x86_64-with-debian-squeeze-sid
OS Name : posix
Distributor ID: Debian
Description: Debian GNU/Linux testing (squeeze)
Release: testing
Codename: squeeze
Operating System Release : 2.6.32-2-amd64
Operating System Version : #1 SMP Fri Feb 12 00:01:47 UTC 2010
Operating System Architecture : 64bit
Operating System Locale : en_GB.UTF8
Python Version : 2.6.6rc1+
OpenERP-Client Version : 6.0dev
Last revision No. & ID :1528 codehost@crowberry-20100902035141-0kbr4u8siwoxmqbq
Traceback (most recent call last):
  File "/home/dwa/openerp-6/server/bin/netsvc.py", line 431, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/dwa/openerp-6/server/bin/service/web_services.py", line 589, in dispatch
    res = fn(db, uid, *params)
  File "/home/dwa/openerp-6/server/bin/osv/osv.py", line 61, in wrapper
    self.abortResponse(1, inst.name, 'warning', inst.value)
  File "/home/dwa/openerp-6/server/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/dwa/openerp-6/server/bin/osv/osv.py", line 135, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/dwa/openerp-6/server/bin/osv/osv.py", line 125, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/dwa/openerp-6/server/bin/addons/crm/wizard/crm_lead_to_opportunity.py", line 86, in action_apply
    lead_obj.history(cr, uid, [lead], _('Opportunity'), details='Converted to Opportunity', context=context)
  File "/home/dwa/openerp-6/server/bin/addons/mail_gateway/mail_gateway.py", line 161, in history
    obj.create(cr, uid, data, context=context)
  File "/home/dwa/openerp-6/server/bin/addons/fetchmail/fetchmail.py", line 198, in create
    res = super(mailgate_message,self).create(cr, uid, values, context=context)
  File "/home/dwa/openerp-6/server/bin/osv/orm.py", line 3603, in create
    % (vals[field], field))
except_orm: ('ValidateError', 'The value "lead" for the field "type" is not in the selection')

Related branches

Revision history for this message
Daniel Watkins (credativ) (daniel-watkins-credativ) wrote :

I've done some basic debugging, and I believe the problem is that 'default_type' is being passed in the context from action_apply in crm_lead_to_opportunity.py through to history in mail_gateway.py.

The permissible values for 'type' when the error is thrown are "[('pop', 'POP Server'), ('imap', 'IMAP Server')]". Clearly the two types being talked about are different.

Revision history for this message
Ravindra Mekhiya(OpenERP) (rme-openerp) wrote :

Hello Daniel,

Would you please update the code and after recheck notify us?
There seems no error at my end when converting form lead to opportunity.

Let me know if I am wrong.

Thanks.

Revision history for this message
Daniel Watkins (credativ) (daniel-watkins-credativ) wrote :

I will do, but I'm hitting an error updating trunk, which I've filed as bug 634080.

Revision history for this message
Daniel Watkins (credativ) (daniel-watkins-credativ) wrote :

I've worked around that issue, so have tested.

If I uninstall the fetchmail module, then I don't get this error. So that'll be where it is originating...

Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Julian Robbins (joolsr) wrote :

Yes, this is quite a significant issue when using Fetchmail

Revision history for this message
Julian Robbins (joolsr) wrote :

I get the same exact error when doing the following

When creating an Opportunity from Lead. When you get to the bit about Revenue, Probability and Partner, it by default uses the name of the original description (from lead Name) in the Partner field. But when I removed this from Partner field to try and leave Partner blank, when you look at the Opportunity it's there but still has a partner of the filled in description name, rather than blank. Think its showing this info rather than adding to DB, as it doesn't appear to stay when you revisit the opportunity later on.

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Hello Daniel,
It has been fixed in trunk-addons,
revision-id: <email address hidden>
revision no: 4931
Thanks for reporting,

Changed in openobject-addons:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.