Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Convert lead to customer button [Closed]
The Question has been closed for reason: duplicate questionby
I want to create button in lead form which creates customer by entered lead information and if creation was successfully deletes what lead and redirects to newly created customer.
I am not very experienced in python, but trying to learn something.
As I find out for the customer creation I have to call _create_lead_partner() function in crm_lead, so I created new module, inherited crm_lead class created my function which calls _create_lead_customer() function, but always missing something, getting error like TypeError: _create_lead_partner() got multiple values for keyword argument 'context'.
My function looks like what,
def custom_create_contact(self, cr, uid, lead, context=None):
a = self._create_lead_partner(self, cr, uid, lead, context=None)
I calls it with button
<button name="custom_create_contact" string="Create Customer" type="object" class="oe_highlight"/>
maybe someone can tell me meaning of this error:
File "/opt/odoo/openerp/api.py", line 715, in __new__
self.registry = RegistryManager.get(cr.dbname)
AttributeError: 'crm.lead' object has no attribute 'dbname'
from my module i call other function from inherited class
_inherit = 'crm.lead'
def custom_create_contact(self, cr, uid, ids, context=None):
res = self.handle_partner_assignation(self, cr, uid, ids)
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/27/15, 3:25 AM|
|Seen: 727 times|
|Last updated: 8/31/15, 2:33 PM|