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
- 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.form.custom_widgets.add('your','your class widget');
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