Odoo 11 how to override the auto generated modal views of one2many field

守給你的承諾、 提交于 2019-12-08 18:24:35

There are two options.

  1. Define one more form view with a higher priority (that's used for ordering of views). Odoo will load the view with the lowest priority (default is 16 btw), so your old view will be loaded in your menues. Now take the externel/xml id of the new view and "call" it in your employee form view like:
<field name="food_ids" context="{'form_view_ref': 'my_module.my_second_food_form_view'}" />
  1. Or you can just define form and tree views right in the employee form view, where you define your one2many field:
<field name="food_ids">
    <form>
        <!-- your form view here -->
    </form>
    <tree editable="bottom"> <!-- if you don't want it editable just delete the attribute -->
        <!-- your tree view here -->
    </tree>
</field>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!