如何在odoo中以相同的表单视图或日历视图显示两个模型的详细信息

时间:2016-01-25 11:05:30

标签: python xml odoo-8

我的模型如下

class Book_MRoom(models.Model):
    _name="book.meeting"
    #_inherit = 'meeting.room'

    name=fields.Char(string="Enter booking person name",required=True)
    company_name=fields.Many2one('company','Enter your company name',required=True)
    start_time=fields.Datetime(string="Starting date",select=True,required=True)
    end_time=fields.Datetime(string="Ending date",select=True)
        meeting_room=fields.Many2one('mroom', 'select the room')

class Book_DRoom(models.Model):
    _name="book.discussion"
    #_inherit = 'discussion.room'

    name=fields.Char(string="Enter booking person name",required=True)
    company_name=fields.Many2one('company','Enter your company name',required=True)
    start_time=fields.Datetime(string="Starting date",select=True,required=True)
    end_time=fields.Datetime(string="Ending date")
    discussion_room=fields.Many2one('droom','select the room')

class CompanyData(models.Model):
    _name="company"
        _rec_name='companyname'

    companyname=fields.Char(string="Enter the name of the company")
    companyID=fields.Char(string="Enter the ID of company")`

我的观看文件如下

<record model="ir.ui.view" id="meeting-calender">
   <field name="name">meeting-calender-view</field>
   <field name="model">company</field>
   <field name="type">calendar</field>
   <field name="arch" type="xml">
      <calendar string="bookingstatus" date_start="start_time" date_stop="end_time" display="[name]">
          <field name="meeting_room"/>
          <field name="name"/>
          <field name="companyname"/>
      </calendar>
   </field>
 </record>

在我的日历视图中,我已将公司指定为我的模型。但在日历视图中,我需要使用book.meeting和book.discussion模型的字段。怎么可能?

0 个答案:

没有答案