python - Odoo inherit using name of class -


i have problem when try inherit on odoo core odoo. in document of odoo, have inherit variable "_name", in case variable none, _name = none . so, try inherit class still not working.

this class core :

class basemodel(object): 

and code :

from openerp import fields, models, api  class basemodel(models.basemodel):     _inherit = 'basemodel' 

you don't need use _inherit, if inherit existing odoo model. if want create new model can use:

class custommodel(models.abstractmodel):     _name="custom.model" 

(abstractmodel same basemodel, it's used in source instead of basemodel).

and can inherit model with

class anothermodel(models.model):     _inherit="custom.model"     _name="another.model" 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -