Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2950 Представления

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?

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Автор

Thank you very much

Related Posts Ответы Просмотры Активность
1
мар. 24
1647
4
мар. 25
50139
1
февр. 23
2216
1
мая 22
2927
0
дек. 19
3568