In Odoo one can extend
or include
on a class (in Javascript). What is the difference in Odoo between extend
and include
?
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. 😉
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With