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

I'm interested how to display fields from the parent model in a form view.

in my model I have a relation

parent_id = fields.Many2one('parent.model')

if I try to show them in the form view I get only a link! The opposite works from the parent model to display children with the tree.

This displays only link?! 

<field name="parent_id">
<field name="company_street"/>
<field name="company_zip"/>
<field name="company_city"/>
</field>
الصورة الرمزية
إهمال
أفضل إجابة

you can use related fields.

eg:

company_street = fields.Char(related='parent_id.company_street')
الصورة الرمزية
إهمال
الكاتب

Thanks, got it working! I remember reading about this when I started learning odoo but at the time didn't get why and how to use it.

Good.

On Wed, Mar 14, 2018 at 12:40 PM, Samo Arko <samo.arko@tabla.si> wrote:

Thanks, got it working! I remember reading about this when I started learning odoo but at the time didn't get why and how to use it.

--
Samo Arko


Sent by Odoo S.A. using Odoo.




--
Hilar AK  Python / Odoo Developer

m: +917736617619
e: hilarak@gmail.com
Follow me:
twitteryoutubegithubstack-overflow


المنشورات ذات الصلة الردود أدوات العرض النشاط
1
ديسمبر 16
3104
4
يوليو 23
2140
2
فبراير 23
1970
2
يناير 20
132
2
ديسمبر 19
2953