mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-21 16:42:05 +02:00
Initial commit: Accounting packages
This commit is contained in:
commit
4ef34c2317
2661 changed files with 1709616 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
odoo.define('snailmail_account.NotificationManager', function (require) {
|
||||
"use strict";
|
||||
|
||||
var AbstractService = require('web.AbstractService');
|
||||
var core = require("web.core");
|
||||
|
||||
var SnailmailAccountNotificationManager = AbstractService.extend({
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
start: function () {
|
||||
this._super.apply(this, arguments);
|
||||
core.bus.on('web_client_ready', null, () => {
|
||||
this.call('bus_service', 'addEventListener', 'notification', this._onNotification.bind(this));
|
||||
});
|
||||
},
|
||||
|
||||
_onNotification: function({ detail: notifications }) {
|
||||
for (const { payload, type } of notifications) {
|
||||
if (type === "snailmail_invalid_address") {
|
||||
this.displayNotification({ title: payload.title, message: payload.message, type: 'danger' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
core.serviceRegistry.add('snailmail_account_notification_service', SnailmailAccountNotificationManager);
|
||||
|
||||
return SnailmailAccountNotificationManager;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue