Edit the models/library_book.py file to add the new related field:
- Ensure that we have a field for the book publisher:
class LibraryBook(models.Model): # ... publisher_id = fields.Many2one( 'res.partner', string='Publisher')
- Now, add the related field for the publisher's city:
# class LibraryBook(models.Model): # ... publisher_city = fields.Char( 'Publisher City', related='publisher_id.city',
readonly=True)
Finally, we need to upgrade the add-on module for the new fields to be available in the model.