There are two ways, extend and include:
- with extends you create a new widget that needs to be registered in Odoo to be used
- with include you modify in place an existing Odoo widget and no need to be registered in Odoo to be used since the modified widget is already registered.
Where you can register you widget extensions, that depends on the type of widget that you use as base of your widget and also depends on the use that you will do of the widget. You could register your widget as:
- form field
- form tag
- form custom
- search field
- custom_filter
- client_action type
- view type
- list column field
as long as I know.
How you could register your widgets for every case? By example:
instance.web.views.add('form', 'instance.web.FormView');
instance.web.client_actions.add('easyrtc','instance.easyrtc.widget');
instance.web.form.widgets.add('char','instance.web.form.FieldChar');
instance.web.search.fields.add('char','instance.web.search.CharField');
instance.web.search.custom_filters.add('char', 'instance.web.search.ExtendedSearchProposition.Char');
instance.web.form.tags.add('button','instance.web.form.WidgetButton');
instance.web.form.custom_widgets.add('your','your class widget');
instance.web.list.columns.add('field','instance.web.list.Column');
You always will be registering your widget in an instance.web.Registry that Odoo will be using for pick your new widgets. The way that you instruct Odoo to pick your new widget varying for every type of widget and the type of Registry that you use.
Hope this helps