0

-使用完整代码编辑-

我有家长的看法:

 <record model="ir.ui.view" id="view_wpa_publication_form">
  <field name="name">WPA Publication View Form</field>
  <field name="model">wpa.publication</field>
  <field name="type">form</field>
  <field name="arch" type="xml">
    <form string="Publications">
      <group colspan="4" col="6">
          <field name="name" on_change="onchange_publication(name)" colspan="4"/>
          <field name="active"/>
          <field name="issn"/>
          <field name="supplier_id"/>
          <field name="periodicity"/>
      </group>
      <separator string="Editions" colspan="2"/>
      <separator string="Ad Categories" colspan="2"/>
      <field name="edition_ids" mode="tree" colspan="2" nolabel="1">
        <tree string="" editable="bottom">
          <field name="date"/>
        </tree>
        <form>  
            <field name="publication_id"/>
            <field name="date"/>
        </form>
      </field>
      <field name="category_ids" mode="tree" colspan="2" nolabel="1">
        <tree string="" editable="bottom">
          <field name="category_id"/>
          <field name="price"/>
          <field name="functioning"/>
        </tree>
        <form>  
            <field name="publication_id"/>
            <field name="category_id"/>
            <field name="price"/>
            <field name="functioning"/>
        </form>
      </field>            
    </form>
  </field>
</record>

所以我有一个子视图,我想在一个有 2 页(标签)的笔记本中转换我的名字和我的名字 2

我有正确的 Xpath 用选项卡替换这两个字段,但我无法将机器人页面放在同一个笔记本中:

        <xpath expr="//separator[@string='Editions']" position="replace"/>
        <xpath expr="//field[@name='edition_ids']" position="replace">
            <notebook colspan="4">
                <page string="Editions">
                  <field name="edition_ids" mode="tree" colspan="2" nolabel="1">
                    <tree string="" editable="bottom">
                      <field name="date"/>
                    </tree>
                    <form>  
                        <field name="publication_id"/>
                        <field name="date"/>
                    </form>
                  </field>                            
                </page>
                <page string="Ad Categories">
                  <field name="category_ids" mode="tree" colspan="2" nolabel="1">
                    <tree string="" editable="bottom">
                      <field name="category_id"/>
                      <field name="price"/>
                      <field name="functioning"/>
                    </tree>
                    <form>  
                        <field name="publication_id"/>
                        <field name="category_id"/>
                        <field name="price"/>
                        <field name="functioning"/>
                    </form>
                  </field>
                </page>
                <page string="Awards">
                  <field name="publication_id" mode="tree" colspan="2" nolabel="1">
                    <tree string="" editable="bottom">
                      <field name="award"/>
                    </tree>
                    <form>  
                        <field name="award"/>

                    </form>
                  </field>                            
                </page>
                </notebook>
        </xpath>

        <xpath expr="//separator[@string='Ad Categories']" position="replace"/>
        <xpath expr="//field[@name='category_ids']" position="replace">
        <notebook colspan="4">
        </notebook>     
        </xpath>

如何替换两者并将它们放入笔记本中,然后添加第三个标签?现在我得到的是:在此处输入图像描述

4

1 回答 1

0

尝试这个:

<xpath expr="//separator[@string='String 3']" position="replace"/>
<xpath expr="//separator[@string='String 2']" position="replace"/>
<xpath expr="//field[@name='myField']" position="replace"/>
        <xpath expr="//field[@name='field']" position="replace">
            <notebook colspan="4">
                <page string="Page1">
                my stuff
                </page>
                <page string="Page2">
                  more stuff
                </page>
            </notebook>
         </xpath>
于 2018-01-21T11:58:51.393 回答