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

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

   

       

           

               

                   

                       

                           

                           

                       

                   

               

           

       

   


形象
丢弃
相关帖文 回复 查看 活动
0
3月 15
3163
0
6月 24
1664
1
1月 24
2822
0
10月 23
2566
0
10月 23
1261