something like this:
var warning = require('web.warinig');
warning.UserError('blablabla');
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
something like this:
var warning = require('web.warinig');
warning.UserError('blablabla');
Hello mark,
You can use do_warn or do_notify function to create notification on top-right Odoo screen.
this.do_warn(title, message, sticky, className);
Same params for do_notify.
If you want display warning in popup(dialog) then you can use alert dialog.
var Dialog = require('web.Dialog');
Dialog.alert(this, message, options);
Hi Jigar, thanks for the comprehensive answer!
what is i wanted to send these notifications from python code ?
for odoo 16
import { useService } from "@web/core/utils/hooks";
export class TstMsg extends Component {
setup() {this.notification = useService("notification");
this.notification.add("Test msg", {title: "TEST", type: "danger"});
}
}I can see the following error:
Uncaught Javascript Error > this. do_warn is not a function
this.do_notify("Success", "Your Message has been send successfully...");
I can see the following error:
Uncaught Javascript Error > this.do_notify is not a function
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscreva-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
1
mai. 21
|
16619 | |||
|
1
abr. 21
|
5368 | |||
|
1
abr. 20
|
3953 | |||
|
0
mar. 20
|
2837 | |||
|
Creation of DOM from XML
Resolvido
|
1
fev. 20
|
4728 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.