最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

class - Odoo difference in Javascript extend and include - Stack Overflow

programmeradmin2浏览0评论

In Odoo one can extend or include on a class (in Javascript). What is the difference in Odoo between extend and include?

In Odoo one can extend or include on a class (in Javascript). What is the difference in Odoo between extend and include?

Share Improve this question asked Apr 18, 2018 at 4:50 Developer Marius ŽilėnasDeveloper Marius Žilėnas 6,1192 gold badges45 silver badges76 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 23

When you extend, instances from the parent class remain untouched, but instances from the new child class will have the extended features.

OTOH, when you include, you are adding the new features to the prototype of the parent class, which means that automatically all instances of such class include the extended behavior.


You know, JS works with prototypes; i wrote about class and instance just to make it easier to understand.

发布评论

评论列表(0)

  1. 暂无评论