Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
395 Переглядів

Hello everybody!!

Please, who can explain to me how to modify an existing class using inherits in odoo

Thanks in advance

Аватар
Відмінити
Найкраща відповідь

There are three types of inheritance in Odoo. If you want to modify an existing model you should use the "_inherit" attribute and set it to the model you want to modify.

e.g. _inherit = "model.name"

Make sure that you do not set a value to the "_name" attribute since this would create a new model with that name and have the same properties as the model mentioned in the "_inherit" attribute. If you do not use "_name" it will modify the existing model by the name mentioned in the "_inherit" attribute.

Thereafter whatever the columns you define will be added to the existing model and whatever the functions you define will alter the behaviour of existing model.

Hope this helps. :)

Аватар
Відмінити
Найкраща відповідь

See in documentation how Build an Odoo module: https://www.odoo.com/documentation/8.0/howtos/backend.html

Аватар
Відмінити
Автор

Thanks for the answer but i didnt understand it very well. can you give me a simple example please

Many other links: https://www.odoo.com/forum/help-1/question/how-i-can-create-module-openerp-7-16336

Related Posts Відповіді Переглядів Дія
2
серп. 25
3391
1
лип. 25
1564
1
серп. 25
1152
0
трав. 25
1888
2
квіт. 25
4170