Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ enable=anomalous-backslash-in-string,
eval-used,
incoherent-interpreter-exec-perm,
license-allowed,
manifest-author-string,
manifest-deprecated-key,
manifest-required-author,
manifest-required-key,
Expand Down
2 changes: 1 addition & 1 deletion ecommerce_first_last_name/static/src/js/website_sale.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @odoo-module **/
/* @odoo-module */

import websiteSaleAddress from "@website_sale/js/address";

Expand Down
2 changes: 1 addition & 1 deletion eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const config = [{
},

}, {
files: ["**/*.esm.js", "**/*test.js", "**/static/src/js/**/*.js"],
files: ["**/*.esm.js", "**/*test.js", "**/static/src/**/*.js"],

languageOptions: {
ecmaVersion: 2024,
Expand Down
29 changes: 29 additions & 0 deletions mail_sound/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
========================
Mail Sound Notifications
========================

This module enhances Odoo's notification system by ensuring that sound notifications
are played for all incoming messages, regardless of the browser window's focus state.

**Key Features:**

* Plays notification sounds even when the browser window has focus
* Works for channel messages, direct messages, and @mentions
* Filters out sounds for self-authored messages
* Seamless integration with Odoo 18.0's service-based architecture

**Use Case:**

By default, Odoo only plays notification sounds when the browser window is out of focus.
This module ensures users never miss important messages by playing sounds in all cases,
providing better awareness of incoming communications.

**Table of contents**

.. contents::
:local:

Configuration
=============

No configuration required. The module works automatically after installation.
1 change: 1 addition & 0 deletions mail_sound/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
19 changes: 19 additions & 0 deletions mail_sound/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Mail Sound Notifications",
"version": "18.0.1.0.0",
"category": "Discuss",
"summary": "Play sound when receiving messages",
"author": "Nitrokey GmbH",
"website": "https://github.com/Nitrokey/odoo-modules",
"license": "AGPL-3",
"depends": ["mail"],
"data": [],
"assets": {
"web.assets_backend": [
"mail_sound/static/src/services/out_of_focus_service_patch.js",
],
},
"installable": True,
"auto_install": False,
"application": False,
}
36 changes: 36 additions & 0 deletions mail_sound/static/src/services/out_of_focus_service_patch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* @odoo-module */

import {OutOfFocusService} from "@mail/core/common/out_of_focus_service";
import {patch} from "@web/core/utils/patch";

/**
* Patch the OutOfFocusService to always play notification sounds
* regardless of browser focus state.
*
* This extends the standard notification behavior to play sounds
* even when the browser window has focus, ensuring users never
* miss notifications.
*/
patch(OutOfFocusService.prototype, {
/**
* Override notify to always play sound for incoming messages.
*
* @override
* @param {Object} message - The message object
*/
async notify(message) {
// Call parent implementation to maintain standard notification behavior
await super.notify(...arguments);
const currentUser = this.env.services["mail.store"].self;
const currentUserId = currentUser?.id;

// Always play sound for messages from other users
// The parent notify() already handles the focus-dependent behavior,
// so we add unconditional sound playback here
if (message && message.author && message.author.id !== currentUserId) {
// Play the notification sound using the internal _playSound method
// This ensures sound plays regardless of browser focus state
this._playSound();
}
},
});
4 changes: 2 additions & 2 deletions payment_bitcoin/static/src/js/bitcoin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @odoo-module **/
/* @odoo-module */

import publicWidget from "@web/legacy/js/public/public_widget";
import {_t} from "@web/core/l10n/translation";
import publicWidget from "@web/legacy/js/public/public_widget";
import {rpc} from "@web/core/network/rpc";

// In Odoo 18, the frontend payment form widget is PaymentForm in the publicWidget registry.
Expand Down
5 changes: 3 additions & 2 deletions payment_bitcoin/static/src/js/countdown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @odoo-module **/
/* @odoo-module */

import publicWidget from "@web/legacy/js/public/public_widget";

Expand All @@ -24,7 +24,8 @@ publicWidget.registry.reloadDuration = publicWidget.Widget.extend({
let seconds = secondsNode ? parseInt(secondsNode.textContent || "0", 10) : 0;
const timeCounter = document.getElementById("timecounter");
if (!timeCounter) {
return; // Nothing to update.
// Nothing to update.
return;
}
timeCounter.style.fontSize = "60px";

Expand Down