Skip to content
Closed
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
6 changes: 4 additions & 2 deletions addons/bus/static/src/js/services/assets_watchdog_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { browser } from "@web/core/browser/browser";
import { registry } from "@web/core/registry";

export const assetsWatchdogService = {
start(env) {
dependencies: ["notification"],

start(env, { notification }) {
const assets = {};
let assetsChangedNotificationId = null;
let bundleNotifTimerID = null;
Expand Down Expand Up @@ -32,7 +34,7 @@ export const assetsWatchdogService = {
// We wait until things settle down
browser.clearTimeout(bundleNotifTimerID);
bundleNotifTimerID = browser.setTimeout(() => {
assetsChangedNotificationId = env.services.notification.create(
assetsChangedNotificationId = notification.create(
env._t("The page appears to be out of date."),
{
title: env._t("Refresh"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { ConnectionLostError } from "@web/core/network/rpc_service";
import { registry } from "@web/core/registry";

export const calendarNotificationService = {
start(env) {
dependencies: ["action", "notification", "rpc"],

start(env, { action, notification, rpc }) {
let calendarNotifTimeouts = {};
let nextCalendarNotifTimeout = null;
const calendarNotif = {};
Expand Down Expand Up @@ -40,7 +42,7 @@ export const calendarNotificationService = {
return;
}
calendarNotifTimeouts[key] = browser.setTimeout(function () {
const notificationID = env.services.notification.create(notif.message, {
const notificationID = notification.create(notif.message, {
title: notif.title,
type: "warning",
sticky: true,
Expand All @@ -52,26 +54,26 @@ export const calendarNotificationService = {
name: env._t("OK"),
primary: true,
onClick: async () => {
await env.services.rpc("/calendar/notify_ack");
env.services.notification.close(calendarNotif[key]);
await rpc("/calendar/notify_ack");
notification.close(calendarNotif[key]);
},
},
{
name: env._t("Details"),
onClick: async () => {
await env.services.action.doAction(
await action.doAction(
"calendar.action_calendar_event_notify",
{
resId: notif.event_id,
}
);
env.services.notification.close(calendarNotif[key]);
notification.close(calendarNotif[key]);
},
},
{
name: env._t("Snooze"),
onClick: () => {
env.services.notification.close(calendarNotif[key]);
notification.close(calendarNotif[key]);
},
},
],
Expand All @@ -92,7 +94,7 @@ export const calendarNotificationService = {

async function getNextCalendarNotif() {
try {
const result = await env.services.rpc("/calendar/notify", {}, { shadow: true });
const result = await rpc("/calendar/notify", {}, { shadow: true });
displayCalendarNotification(result);
} catch (error) {
if (!(error instanceof ConnectionLostError)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
// odoo.define('web.company_autocomplete', function (require) {
// "use strict";
/** @odoo-module **/

// const AbstractWebClient = require('web.AbstractWebClient');
// const session = require('web.session');
import { registry } from "@web/core/registry";

// return AbstractWebClient.include({
export const companyAutocompleteService = {
dependencies: ["orm", "user"],

// start: function () {
// if (session.iap_company_enrich) {
// const current_company_id = session.user_companies.current_company;
// this._rpc({
// model: 'res.company',
// method: 'iap_enrich_auto',
// args: [current_company_id],
// }, {
// shadow: true,
// });
// }
start(env, { orm, user }) {
if (odoo.session_info.iap_company_enrich) {
const currentCompanyId = user.current_company.id;
orm.call("res.company", "iap_enrich_auto", [currentCompanyId], {}, { shadow: true });
}
},
};

// return this._super.apply(this, arguments);
// },

// });

// });
registry
.category("services")
.add("partner_autocomplete.companyAutocomplete", companyAutocompleteService);