Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3682 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thank you very much

Powiązane posty Odpowiedzi Widoki Czynność
External layout Rozwiązane
1
sie 25
2386
5
wrz 25
54291
1
lut 23
2867
1
maj 22
3469
0
gru 19
4094