微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

odoo:在many2many 领域中即时创作?

如何解决odoo:在many2many 领域中即时创作?


在我的 many2many 字段中,我想在单击“添加”时即时创建,而不是显示包含记录列表的弹出窗口。
我使用了此代码,但它仅适用于一个 one2many 字段。
<page name="tutors" string="Tutors">
          <field name="students_n_responsible" mode="kanban" context="{'default_is_representative': True,'default_type': 'private'}" domain="[('is_representative','=',True)]">
            <kanban>
              <templates>
                <t t-name="kanban-Box">
                  <t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
                  <div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'">
                    <div class="o_kanban_image">
                      <img alt="Contact image" t-if="record.image_128.raw_value" t-att-src="kanban_image('res.partner','image_128',record.id.raw_value)"/>
                    </div>
                    <div class="oe_kanban_details">
                      <field name="name"/>
                      <div t-if="record.email.raw_value"><field name="email" widget="email"/></div>
                      <div>
                        <field name="zip"/>
                        <field name="city"/>
                        <field name="city_id"/>
                        <field name="country_id"/>
                      </div>
                      <div t-if="record.mobile.raw_value">Mobile: <t t-esc="record.mobile.value"/></div>
                      <div t-if="record.phone.raw_value">Phone: <t t-esc="record.phone.value"/></div>
                    </div>
                  </div>
                </t>
              </templates>
            </kanban>
            <form string="Legal representative">
              <sheet>
                <field name="type" required="1" widget="radio" options="{'horizontal': true}"/>
                <field name="parent_id" invisible="1"/>
                <hr/>
                <group col="12">
                  <group colspan="5">
                    <field name="name" string="Contact Name" attrs="{'required' : [('type','contact')]}"/>
                    <field name="title" placeholder="e.g. Mr." attrs="{'invisible': [('type','!=','contact')]}"/>
                    <field name="function" placeholder="e.g. Sales Director" attrs="{'invisible': [('type','contact')]}"/>
                    <label for="street" string="Address" attrs="{'invisible': [('type','contact')]}"/>
                    <div attrs="{'invisible': [('type','contact')]}">
                      <div class="o_address_format" name="div_address">
                        <field name="street" placeholder="Street..." class="o_address_street"/>
                        <field name="street2" placeholder="Street 2..." class="o_address_street"/>
                        <field name="city" placeholder="City" class="o_address_city"/>
                        <field name="state_id" class="o_address_state" placeholder="State" options="{'no_open': True,'no_quick_create': True}" context="{'country_id': country_id,'default_country_id': country_id,'zip': zip}"/>
                        <field name="zip" placeholder="ZIP" class="o_address_zip"/>
                        <field name="country_id" placeholder="Country" class="o_address_country" options="{&quot;no_open&quot;: True,&quot;no_create&quot;: True}"/>
                      </div>
                    </div>
                    <field name="comment" placeholder="Internal notes..."/>
                  </group>
                  <group colspan="5">
                    <field name="email" widget="email"/>
                    <field name="phone" widget="phone"/>
                    <field name="mobile" widget="phone"/>
                    <field name="company_id" invisible="1"/>
                  </group>
                  <group colspan="1">
                    <field name="image_1920" widget="image" class="oe_avatar" nolabel="1" options="{'image_preview': 'image_128'}"/>
                  </group>
                </group>
                <field name="lang" invisible="True"/>
                <field name="user_id" invisible="True"/>
              </sheet>
            </form>
          </field>
        </page>

这是我说的弹出窗口。我不想要它,而是我需要一个视图表单。

enter image description here

你能帮我吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。