تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3603 أدوات العرض

I have created a button as below

<button string="Click" custom="click"/>

Then create one JS file that will contain following code.

odoo.define('YOUR_MODULE.FILENAME', function (require) {
"use strict";

var form_widget = require('web.form_widgets');
var core = require('web.core');
var _t = core._t;
var QWeb = core.qweb;

form_widget.WidgetButton.include({
    on_click: function() {
         if(this.node.attrs.custom === "click"){

            // YOUR CODE

            return;
         }
         this._super();
    },
});
});

  File "D:\odoo-10.0\odoo\http.py", line 506, in response_wrap
    response = f(*args, **kw)
TypeError: call_button() takes at least 4 arguments (5 given)


and another doubt is what is the YOUR_MODULE.FILENAME here

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يونيو 24
887
0
يوليو 25
108
0
ديسمبر 24
909
2
أكتوبر 24
1066
1
أغسطس 24
2158