i just started studing Odoo 13 making some customizations.
I need to create a new Crm Opportunity when i create new contact.
from odoo import models, fields, api, crmlead
from datetime import datetime
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.model
def create(self, values):
result = super(ResPartner, self).create(values)
CrmLead.create({
'company_id': 1,
'priority': '0',
'name': 'murri',
'partner_id': 3705,
'planned_revenue': 0,
'date_deadline': datetime.date(2020, 10, 26)
})
return result
I tried to extend ResPartner but i give an error
ImportError: cannot import name 'crmlead' from 'odoo
Define the
destination
model
which you creating from thesource
model
.