i would like to know how to override create method in the new odoo API. to replace this :
def create(self, cr, uid, vals, context=None):
new_id = super(CRM_Lead, self).create(cr, uid, vals, context=context)
lead = self.browse(cr, uid, new_id, context=context)
self._compute_stage_deadline(cr, uid, lead, context)
Yo can see an example here:
_inherit = "account.journal"
def create(self, vals):
rec = super(AccountJournal, self).create(vals)
Make sure you use the exact name of the python class in the super function and also that you return the same object you get from it.
please see the below link from v7 to new API code
About This Community
|Asked: 8/11/14, 3:44 AM|
|Seen: 16798 times|
|Last updated: 11/26/15, 5:11 AM|