Our server code will usually run inside a method of a model, as is the case for
do_mass_update() in the preceding code.
In this context,
self represents the recordset being acted upon. Instances of model classes are actually recordsets. For actions executed from views, this will be only the record currently selected on it. If it's a form view, it is usually a single record, but in tree views, there can be several records.
self.env object allows us to access our running environment; this includes the information on the current session, such as the current user and session context, and also access all the other models available in the server.
To better explore programming on the server side, we can use the server interactive ...