تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3071 أدوات العرض

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
مارس 24
1737
4
مارس 25
50859
1
فبراير 23
2295
1
مايو 22
3026
0
ديسمبر 19
3650