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

Hello Odooers

Hope you are doing well.

Below is a snipping image.

The o2m field has a reference field of 'maintenance.equipment', How can I display 'Equipment Category'. Thank you for advise.  



อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hi all,

I change the o2m field to m2m field. All related fields can be displayed. now 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

you can do that
in py file
class YourModel(models.Model):

    _inherit = 'your.model'


    equipment_category = fields.Many2one(

        related='maintenance_equipment_id.category_id', 

        string='Equipment Category'

    )
Xml file


    your.model.form

    your.model

   

       

           

               

                   

                       

                           

                           

                       

                   

               

           

       

   


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
3209
0
มิ.ย. 24
1676
1
ม.ค. 24
2869
0
ต.ค. 23
2612
0
ต.ค. 23
1293