Skip to Content
Menu
This question has been flagged
1 Reply
3597 Views

I want to use displayNotification in my customFunction but when i code like this self.displayNotification(), error because displayNotification is not function.

btw my self is i call ErrorDialog like RPCEErrordialog or something 

Avatar
Discard
Hi zzz,

Can you send your custom function so i refer.

nikhilnakrani143@gmail.com

Best Answer

Hi zzz,


Checked in odoo about this, First of all we have two JS structures in Odoo 16.


For OWL: odoo.define we have example 


self. displayNotification({ title: result. warning, type: 'danger' }); GOLD

this. displayNotification({ title: result. warning, type: 'danger' });


For OWL: /* @odoo-module */ we have example 


this.widget.displayNotification({

message: this.env._t("No available collaborator, please

try again later."),

sticky: true,

}); 


Use 'This' and 'Self' According to functionality of function.


Hope this answer will help you.

Thanks & Regards,
Email:  odoo@aktivsoftware.com
Skype: kalpeshmaheshwari


Avatar
Discard
Related Posts Replies Views Activity
1
Jun 23
2120
1
May 23
2069
1
Oct 22
4226
0
May 20
3225
2
Jan 20
8867