如何删除“保存并更新"从odoo弹出按钮? [英] How to remove "save&new" button from popup in odoo?

查看:269
本文介绍了如何删除“保存并更新"从odoo弹出按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个one2many字段,当我单击以创建新记录时,我有2个按钮.

I have a one2many field, and when I click to create a new record, I have 2 buttons.

我要删除"Save & New"按钮并保持"Save & Close"按钮.

I want to remove the "Save & New" button and keep the "Save & Close" button.

推荐答案

我希望您不要介意卑鄙的骇客.

I hope you do not mind sleazy hacks.

在表单视图中,您可以尝试此操作.您可能需要先清除缓存,然后才能使用它.仅当您不希望它出现时才明智,但实际上这并不是仅出于外观和过程的安全考虑.您可能需要确保类选择器对于您的版本是正确的.

In your form view you can try this. You may need to clear your cache before it works for you. This is only sensible if you do not want it to appear but its not really a security thing just for looks and process. You may need to ensure the class selector is correct for your version.

我对此进行了测试,方法是将其放在显示的表单视图的xml中,而不是要在其中添加新的one2many记录的表单视图的xml中.为了清楚起见,此css必须位于弹出的表单视图中,并包含保存并新建"按钮.

I tested this by placing it in the xml for the form view that appears, not in the xml for the form view that you are adding a new one2many record within. So to be clear this css needs to be in the form view that pops up and contains the "Save & New" button.

<style>
     .oe_abstractformpopup-form-save-new {
          display:none !important;
     }
</style>

这篇关于如何删除“保存并更新"从odoo弹出按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆