There's more...

It is also possible to have some computed and related fields on such models. The only restriction is that the fields cannot be stored (and therefore, you cannot use them to group records or to search). However, in the preceding example, we could have made the editor of the book available by adding a column, defined as follows:

publisher_id = fields.Many2one('res.partner', related='book_id.publisher_id', readonly=True)

If you need to group by publisher, you need to store the field by adding it in the view definition, rather than using a related field.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset