Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4031 มุมมอง

Hi all,

I want to override a function in POS, which was writen by JS. So, I create __init__.py and __openerp__.py with 'depends ' : ['point_of_sale']. Next, I created my_module.js in /static/src/js

Via link : https://www.odoo.com/forum/help-1/question/how-can-i-extend-a-js-web-module-64

So, In my my_module.js, I wrote

openerp.my_module = function(instance){
var module = instance.sample // loading the namespace of the 'sample' module module.PosWidget.include({ start : function(){ console.log('Hello!'); // HERE IS MY CODE }, }); };

In "HERE IS MY CODE", in wrote whole original code and modify function "self.$('.deleteorder-button').click(function(){ }) as an alert().

self.$('.deleteorder-button').click(function(){
alert("HELLO");
});

It means : when I click butotn delete order in POS, I will get an alert("HELLO")

Where is my wrong? Can any one help me, please?

Thanks,

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
เม.ย. 25
1216
1
ส.ค. 24
1991
How to delete POS Sessions! Odoo 16 แก้ไขแล้ว
3
พ.ค. 24
11192
POS Session wont close แก้ไขแล้ว
1
ก.ย. 23
3539
0
ส.ค. 23
1693