在需要弹窗的按钮后面跟上这样一个属性: 属性:confirm_method 后台对应一个属性名为pre_cancel的方法: #预取消确定defpre_cancel(self): self.ensure_one()return_("Note: The document cannot be recovered if it has been cancelled, are you sure?") 这个方法只会在运行name=action_cancel之前,进行一个显...
odoo10的方法:点击跳转 现在就变得很简单了,只用在界面定义,不用方法关联py文件 见代码: 之前是 confirm_method绑定一个函数,现在比较直接。缺点应该就是内容过大xml文件不好看?但是这是缺点吗?哈哈哈
odoo.define('module_xxx.xxx', function (require) { 'use strict'; var rpc = require('web.rpc'); $('.xxx_confirm').on('click', function(e){ var $btn = $(this); $btn.prop('disabled', true); rpc.query({ model: '模块.模型', method: '模型函数', args: [{ 参数: 值, }],...
如果你说的是按钮上面加confirm,是可以的。如下, 如果还要做其他操作,就需要通过js处理了。重写按钮或者用widget
屏幕的左上角呈现出三个按钮。第一个为 Confirm ,用于对贷款予以确认。第二个是 Upload ,其有助于将相应的文件上传至贷款。最后一个是 Compute 。 当单击“计算”按钮之际,会出现另一个窗口,正如下面的屏幕截图所呈现的那样。其中提及贷款金额、利率、贷款期限、开始日期以及付款。
function do_confirm_action(modelName, modelMethod){ // do something //... $("button[name='action_confirm']").attr("disabled", true); } codePojects\odoo14\custom\estate\views\webclient_templates.xml 代码语言:javascript 代码运行次数:0 运行 AI代码解释 <?xml version="1.0" encoding="utf-8...
光纤模块通常需要确认兼容码,因为目前市面上存在2种,一种是高性能的兼容模块,一种是原交换机品牌光...
所以,等请求完成再启用按钮。 实现版本2 供demo_wizard_views.xml实现版本2使用 function do_confirm_action(modelName, modelMethod, context){
function do_confirm_action(modelName, modelMethod){ // do something //... $("button[name='action_confirm']").attr("disabled", true); } 1. 2. 3. 4. 5. codePojects\odoo14\custom\estate\views\webclient_templates.xml <?xml version="1.0" encoding="utf-8"?> ...
function do_confirm_action(modelName, modelMethod, context){ $("button[name='action_confirm']").attr("disabled", true); // 点击按钮后,禁用按钮状态,比较重复点击导致重复发送请求 var wizard_dialog = $(event.currentTarget.offsetParent.parentElement.parentElement); ...