Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在OpenERP中单击按钮后禁用该按钮_Python_Openerp - Fatal编程技术网

Python 如何在OpenERP中单击按钮后禁用该按钮

Python 如何在OpenERP中单击按钮后禁用该按钮,python,openerp,Python,Openerp,这可能是一个简单的问题。但是,有人知道在OpenERP中单击按钮后如何禁用它吗? 请帮忙!!!!! 感谢您的帮助……如果我们谈论的是web界面,那么您可以使用javascript禁用它。如果您谈论的是web界面,那么可以使用javascript $('button').click(function(){$(this).prop('disabled', true);}); 有两种方法可以在视图中隐藏按钮 根据stat更改对象和显示按钮的状态 e、 g 这是account.invoice.line

这可能是一个简单的问题。但是,有人知道在OpenERP中单击按钮后如何禁用它吗? 请帮忙!!!!!
感谢您的帮助……

如果我们谈论的是web界面,那么您可以使用javascript禁用它。

如果您谈论的是web界面,那么可以使用javascript

$('button').click(function(){$(this).prop('disabled', true);});

有两种方法可以在视图中隐藏按钮

  • 根据stat更改对象和显示按钮的状态
  • e、 g

    这是
    account.invoice.line
    的示例,其中
    account\u id
    字段仅显示给属于
    account.group\u account\u user
    的用户


    希望这能解决你的问题。

    不过你会把javascript放在哪里?
    <button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
    
    <field name="account_id" groups="account.group_account_user"/>