Search code examples
odooodoo-15

Odoo How to use custom fields in the address layout


I have inherited the res.partner model and added a custom field named "firm1" Now, I need to display this field on every report in the address block. To configure this I went to contacts > Countries > 'My Country' and tried to add my custom field like this:

demonstration of how I tried to add the custom field

however, when saving I get the message "The layout contains an invalid format key"

enter image description here


Solution

  • You probably have to override either res.partner._address_fields() or res.partner._formatting_address_fields() to add your new field to the returned list of address field names.