跳至内容
菜单
此问题已终结
1 回复
2978 查看

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

相关帖文 回复 查看 活动
1
3月 24
1659
4
3月 25
50367
1
2月 23
2233
1
5月 22
2956
0
12月 19
3582