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 redefine model if class _inherit 1 model , set _name different create new model 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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -