Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3115 มุมมอง

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
1769
4
มี.ค. 25
50974
1
ก.พ. 23
2304
1
พ.ค. 22
3058
0
ธ.ค. 19
3651