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
Post a Comment