Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2728 Weergaven

I am trying to use my own custom fields in the address layout generation of odoo like this:


However I get the error "The layout contains an invalid format key"


What can I do in order to use my own custom fields?

I have inherited the res.partner and added the custom field with the name "firm1" so it should work?

Avatar
Annuleer
Beste antwoord

Hi,

You can inherit res.partner and super this function and pass your new fields in res.partner

class ResPartner(models.Model):
_inherit = "res.partner"

@api.model
def _formatting_address_fields(self):
"""Returns the list of address fields usable to format addresses."""
return super(ResPartner, self)._formatting_address_fields() + ['new_field1']


Hope this will help you

Thanks

Avatar
Annuleer
Auteur

Thank you very much

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 24
1431
4
mrt. 25
48201
1
feb. 23
1953
1
mei 22
2818
0
dec. 19
3389