How to Inherit multiple models in odoo 10 -
does know how inherit multiple models in odoo 10?
i think below code right?
class test(models.model): _inherit = ['hr.employee','hr.employee.category']
first answer of question yes. inherit multiple class _name
property required . 3 types of inheritance possible in odoo
_inherit = 'model_1' _inherit = _inherit = ['model_1', 'model_2'] _inherits = {'res.partner': 'partner_id'}
we can inherit model or without _name
our '_name' property
if _name same value inherited class basic inheritance.
if forget add
_inherit
redefinemodel
if class_inherit
1 model , set_name
different create newmodel
in new database table.if class inherit many model you have set
_name
if override existing model way may have trouble, should avoided. better use create new classes inherit abstract model.
Comments
Post a Comment