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.
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
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/11/14, 3:44 AM|
|Seen: 24164 times|
|Last updated: 11/26/15, 5:11 AM|