我如何将动作附加到按钮上 [英] How do i make and attache action to button

查看:65
本文介绍了我如何将动作附加到按钮上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我现在在Odoo 10表单"SET geprint"上创建了一个按钮,我想将一个动作附加到该按钮上.如果我按下按钮,则布尔geprint的值必须更改为1.我如何才能做到这一点?

Hello I have created a button on my Odoo 10 form "SET geprint" now i want to attach an action to the button. If i press the button the value of the boolean geprint must change to 1. How can I make this possible?

如果可能的话,我也想在列表视图中创建该按钮以更新多个记录. 感谢您的帮助

If possible i would also like to create that button in the list view to update multiple records. Thx for your help

我尝试了您的代码,但是现在出现以下错误 (要更新的名称字段为x_geprint) 按钮代码:

I tried your code but i am getting the following error now (name field to update is x_geprint) button code :

推荐答案

进行服务器操作(设置->技术->服务器操作)

Make a server action (settings - > technical - > Server actions)

在链接中搜索动作编号后,请查看图片(我的号码是638)

After that search for the action number in your link please see image (my number is 638)

然后转到您要在其中添加按钮的表单.在我的示例中,其stock.move

Then go to the form where you want to add the button. In my example its stock.move

进入编辑formview并添加以下代码

Go into edit formview and add the following code

<button name="638" string=" Set geprint" type="action" />

这篇关于我如何将动作附加到按钮上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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