mirror of
https://github.com/bringout/oca-ocb-security.git
synced 2026-04-23 23:02:02 +02:00
Initial commit: Security packages
This commit is contained in:
commit
bb469e4763
1399 changed files with 278378 additions and 0 deletions
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
|
|
@ -0,0 +1,71 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 70 70">
|
||||
<defs>
|
||||
<mask id="mask" x="0" y="0" width="70" height="70" maskUnits="userSpaceOnUse">
|
||||
<g id="mask-2" data-name="mask">
|
||||
<g id="b">
|
||||
<path id="a" d="M4,0H65c4,0,5,1,5,5V65c0,4-1,5-5,5H4c-3,0-4-1-4-5V5C0,1,1,0,4,0Z" fill="#fff" fill-rule="evenodd"/>
|
||||
</g>
|
||||
</g>
|
||||
</mask>
|
||||
<linearGradient id="linear-gradient" x1="-998.51" y1="-216.96" x2="-999.51" y2="-217.96" gradientTransform="matrix(70, 0, 0, -70, 69966, -15187.42)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#94b6c8"/>
|
||||
<stop offset="1" stop-color="#6a9eba"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g mask="url(#mask)">
|
||||
<g>
|
||||
<path d="M0,0H70V70H0Z" fill-rule="evenodd" fill="url(#linear-gradient)"/>
|
||||
<path d="M4,1H65c2.67,0,4.33.67,5,2V0H0V3C.67,1.67,2,1,4,1Z" fill="#fff" fill-opacity="0.38" fill-rule="evenodd"/>
|
||||
<path d="M45.3,69H4c-2,0-4-.14-4-4V33.43l13-13,21.72.11,2.69-2.68L57.05,23l-.28,29L54.33,54.5l.5,1.33,1.34-1.31.88-.16-.37,3.25Z" fill="#393939" fill-rule="evenodd" opacity="0.32" style="isolation: isolate"/>
|
||||
<path d="M4,69H65c2.67,0,4.33-1,5-3v4H0V66A3.92,3.92,0,0,0,4,69Z" fill-opacity="0.38" fill-rule="evenodd"/>
|
||||
<g>
|
||||
<g opacity="0.4">
|
||||
<g>
|
||||
<g>
|
||||
<ellipse cx="21.42" cy="36.92" rx="2.88" ry="4.39"/>
|
||||
<path d="M10.74,22.56V51.79a.57.57,0,0,0,.46.56l21.13,3.9a.56.56,0,0,0,.67-.56V18.3a.57.57,0,0,0-.68-.56L11.19,22A.58.58,0,0,0,10.74,22.56ZM21.42,44.28c-3.23,0-5.85-3.29-5.85-7.36s2.62-7.35,5.85-7.35,5.85,3.29,5.85,7.35S24.65,44.28,21.42,44.28Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon points="36.56 46.29 35.73 46.29 34.89 46.29 34.89 50.77 35.73 50.77 36.56 50.77 37.39 50.77 37.39 46.29 36.56 46.29"/>
|
||||
<path d="M54,19.65H34.92V25.7H53.48V52.56H34.92v1.78H54a1.21,1.21,0,0,0,1.26-1.25V21A1.31,1.31,0,0,0,54,19.65Z"/>
|
||||
<polygon points="49.91 27.49 48.12 27.49 46.33 27.49 46.33 31.97 48.12 31.97 49.91 31.97 51.7 31.97 51.7 27.49 49.91 27.49"/>
|
||||
<polygon points="49.91 33.76 48.12 33.76 46.33 33.76 46.33 38.24 48.12 38.24 49.91 38.24 51.7 38.24 51.7 33.76 49.91 33.76"/>
|
||||
<polygon points="49.91 40.02 48.12 40.02 46.33 40.02 46.33 44.5 48.12 44.5 49.91 44.5 51.7 44.5 51.7 40.02 49.91 40.02"/>
|
||||
<polygon points="42.76 27.49 40.97 27.49 39.18 27.49 39.18 31.97 40.97 31.97 42.76 31.97 44.54 31.97 44.54 27.49 42.76 27.49"/>
|
||||
<polygon points="42.76 33.76 40.97 33.76 39.18 33.76 39.18 38.24 40.97 38.24 42.76 38.24 44.54 38.24 44.54 33.76 42.76 33.76"/>
|
||||
<polygon points="42.76 40.02 40.97 40.02 39.18 40.02 39.18 44.5 40.97 44.5 42.76 44.5 44.54 44.5 44.54 40.02 42.76 40.02"/>
|
||||
<polygon points="42.76 46.29 40.97 46.29 39.18 46.29 39.18 50.77 40.97 50.77 42.76 50.77 44.54 50.77 44.54 46.29 42.76 46.29"/>
|
||||
<polygon points="36.56 27.49 35.73 27.49 34.89 27.49 34.89 31.97 35.73 31.97 36.56 31.97 37.39 31.97 37.39 27.49 36.56 27.49"/>
|
||||
<polygon points="36.56 33.76 35.73 33.76 34.89 33.76 34.89 38.24 35.73 38.24 36.56 38.24 37.39 38.24 37.39 33.76 36.56 33.76"/>
|
||||
<polygon points="36.56 40.02 35.73 40.02 34.89 40.02 34.89 44.5 35.73 44.5 36.56 44.5 37.39 44.5 37.39 40.02 36.56 40.02"/>
|
||||
</g>
|
||||
<polygon points="49.37 56.99 48.33 56.99 48.33 56.35 51.17 56.35 51.17 56.99 50.13 56.99 50.13 59.83 49.37 59.83 49.37 56.99 49.37 56.99"/>
|
||||
<polygon points="51.33 56.35 52.4 56.35 53.21 58.74 53.22 58.74 53.99 56.35 55.06 56.35 55.06 59.83 54.34 59.83 54.34 57.37 54.34 57.37 53.49 59.83 52.9 59.83 52.05 57.39 52.04 57.39 52.04 59.83 51.33 59.83 51.33 56.35"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<ellipse cx="23.41" cy="34.93" rx="2.88" ry="4.39" fill="#fff"/>
|
||||
<path d="M12.73,20.57V49.79a.57.57,0,0,0,.47.56l21.13,3.91a.57.57,0,0,0,.67-.57V16.31a.57.57,0,0,0-.68-.57L13.19,20A.57.57,0,0,0,12.73,20.57ZM23.41,42.28c-3.23,0-5.85-3.29-5.85-7.35s2.62-7.36,5.85-7.36,5.86,3.29,5.86,7.36S26.65,42.28,23.41,42.28Z" fill="#fff"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon points="38.56 44.29 37.72 44.29 36.89 44.29 36.89 48.77 37.72 48.77 38.56 48.77 39.39 48.77 39.39 44.29 38.56 44.29" fill="#fff"/>
|
||||
<path d="M56,17.65H36.92V23.7H55.48V50.56H36.92v1.79H56a1.22,1.22,0,0,0,1.26-1.25V19A1.32,1.32,0,0,0,56,17.65Z" fill="#fff"/>
|
||||
<polygon points="51.9 25.49 50.12 25.49 48.33 25.49 48.33 29.97 50.12 29.97 51.9 29.97 53.69 29.97 53.69 25.49 51.9 25.49" fill="#fff"/>
|
||||
<polygon points="51.9 31.76 50.12 31.76 48.33 31.76 48.33 36.24 50.12 36.24 51.9 36.24 53.69 36.24 53.69 31.76 51.9 31.76" fill="#fff"/>
|
||||
<polygon points="51.9 38.02 50.12 38.02 48.33 38.02 48.33 42.5 50.12 42.5 51.9 42.5 53.69 42.5 53.69 38.02 51.9 38.02" fill="#fff"/>
|
||||
<polygon points="44.75 25.49 42.97 25.49 41.18 25.49 41.18 29.97 42.97 29.97 44.75 29.97 46.54 29.97 46.54 25.49 44.75 25.49" fill="#fff"/>
|
||||
<polygon points="44.75 31.76 42.97 31.76 41.18 31.76 41.18 36.24 42.97 36.24 44.75 36.24 46.54 36.24 46.54 31.76 44.75 31.76" fill="#fff"/>
|
||||
<polygon points="44.75 38.02 42.97 38.02 41.18 38.02 41.18 42.5 42.97 42.5 44.75 42.5 46.54 42.5 46.54 38.02 44.75 38.02" fill="#fff"/>
|
||||
<polygon points="44.75 44.29 42.97 44.29 41.18 44.29 41.18 48.77 42.97 48.77 44.75 48.77 46.54 48.77 46.54 44.29 44.75 44.29" fill="#fff"/>
|
||||
<polygon points="38.56 25.49 37.72 25.49 36.89 25.49 36.89 29.97 37.72 29.97 38.56 29.97 39.39 29.97 39.39 25.49 38.56 25.49" fill="#fff"/>
|
||||
<polygon points="38.56 31.76 37.72 31.76 36.89 31.76 36.89 36.24 37.72 36.24 38.56 36.24 39.39 36.24 39.39 31.76 38.56 31.76" fill="#fff"/>
|
||||
<polygon points="38.56 38.02 37.72 38.02 36.89 38.02 36.89 42.5 37.72 42.5 38.56 42.5 39.39 42.5 39.39 38.02 38.56 38.02" fill="#fff"/>
|
||||
</g>
|
||||
<polygon points="51.37 55 50.33 55 50.33 54.36 53.16 54.36 53.16 55 52.13 55 52.13 57.83 51.37 57.83 51.37 55 51.37 55" fill="#fff"/>
|
||||
<polygon points="53.33 54.36 54.4 54.36 55.21 56.74 55.22 56.74 55.98 54.36 57.05 54.36 57.05 57.83 56.34 57.83 56.34 55.37 56.33 55.37 55.48 57.83 54.9 57.83 54.05 55.39 54.04 55.39 54.04 57.83 53.33 57.83 53.33 54.36" fill="#fff"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 450 B |
|
|
@ -0,0 +1,25 @@
|
|||
.o_calendar_sidebar {
|
||||
.bg-primary {
|
||||
background-color: $o-enterprise-primary-color;
|
||||
}
|
||||
.o_microsoft_sync_button {
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.o_microsoft_sync_button_configured {
|
||||
color: white;
|
||||
height: 2em;
|
||||
|
||||
&:hover {
|
||||
#microsoft_check {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&:not(:hover) {
|
||||
#microsoft_stop {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { AttendeeCalendarCommonPopover } from "@calendar/views/attendee_calendar/common/attendee_calendar_common_popover";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
patch(AttendeeCalendarCommonPopover.prototype, "microsoft_calendar_microsoft_calendar_common_popover", {
|
||||
get isEventArchivable() {
|
||||
return this._super() || (this.isCurrentUserOrganizer && this.props.record.rawRecord.microsoft_id);
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { AttendeeCalendarController } from "@calendar/views/attendee_calendar/attendee_calendar_controller";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { ConfirmationDialog, AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
|
||||
|
||||
patch(AttendeeCalendarController.prototype, "microsoft_calendar_microsoft_calendar_controller", {
|
||||
setup() {
|
||||
this._super(...arguments);
|
||||
this.dialog = useService("dialog");
|
||||
this.notification = useService("notification");
|
||||
},
|
||||
|
||||
async onMicrosoftSyncCalendar() {
|
||||
await this.orm.call(
|
||||
"res.users",
|
||||
"restart_microsoft_synchronization",
|
||||
[[this.user.userId]],
|
||||
);
|
||||
const syncResult = await this.model.syncMicrosoftCalendar();
|
||||
if (syncResult.status === "need_auth") {
|
||||
window.location.assign(syncResult.url);
|
||||
} else if (syncResult.status === "need_config_from_admin") {
|
||||
if (this.isSystemUser) {
|
||||
this.dialog.add(ConfirmationDialog, {
|
||||
title: this.env._t("Configuration"),
|
||||
body: this.env._t("The Outlook Synchronization needs to be configured before you can use it, do you want to do it now?"),
|
||||
confirm: this.actionService.doAction.bind(this.actionService, syncResult.action),
|
||||
});
|
||||
} else {
|
||||
this.dialog.add(AlertDialog, {
|
||||
title: this.env._t("Configuration"),
|
||||
body: this.env._t("An administrator needs to configure Outlook Synchronization before you can use it!"),
|
||||
});
|
||||
}
|
||||
} else if (syncResult.status === "need_refresh") {
|
||||
await this.model.load();
|
||||
}
|
||||
},
|
||||
|
||||
async onStopMicrosoftSynchronization() {
|
||||
this.dialog.add(ConfirmationDialog, {
|
||||
body: this.env._t("You are about to stop the synchronization of your calendar with Outlook. Are you sure you want to continue?"),
|
||||
confirm: async () => {
|
||||
await this.orm.call(
|
||||
"res.users",
|
||||
"stop_microsoft_synchronization",
|
||||
[[this.user.userId]],
|
||||
);
|
||||
this.notification.add(
|
||||
this.env._t("The synchronization with Outlook calendar was successfully stopped."),
|
||||
{
|
||||
title: this.env._t("Success"),
|
||||
type: "success",
|
||||
},
|
||||
);
|
||||
await this.model.load();
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates>
|
||||
<t t-name="microsoft_calendar.MicrosoftCalendarController" t-inherit="calendar.AttendeeCalendarController" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//div[@id='calendar_sync_wrapper']" position="attributes">
|
||||
<attribute name="t-if">true</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//div[@id='microsoft_calendar_sync']" position="replace">
|
||||
<div id="microsoft_calendar_sync" class="o_calendar_sync">
|
||||
<button t-if="!model.microsoftIsSync" type="button" id="microsoft_sync_pending" class="o_microsoft_sync_button o_microsoft_sync_pending btn btn-secondary btn" t-on-click="onMicrosoftSyncCalendar">
|
||||
<b><i class='fa fa-refresh'/> Outlook</b>
|
||||
</button>
|
||||
<!-- class change on hover -->
|
||||
<button t-else="" type="button" id="microsoft_sync_configured" class="me-1 o_microsoft_sync_button o_microsoft_sync_button_configured btn text-bg-primary" t-on-click="onStopMicrosoftSynchronization"
|
||||
t-on-mouseenter="(ev) => {ev.target.classList.remove('text-bg-primary');ev.target.classList.add('text-bg-danger');}"
|
||||
t-on-mouseleave="(ev) => {ev.target.classList.remove('text-bg-danger');ev.target.classList.add('text-bg-primary');}">
|
||||
<b>
|
||||
<i id="microsoft_check" class='fa fa-check'/>
|
||||
<i id="microsoft_stop" class='fa fa-times'/>
|
||||
<span class="mx-1">Outlook</span>
|
||||
</b>
|
||||
</button>
|
||||
</div>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { AttendeeCalendarModel } from "@calendar/views/attendee_calendar/attendee_calendar_model";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
patch(AttendeeCalendarModel, "microsoft_calendar_microsoft_calendar_model", {
|
||||
services: [...AttendeeCalendarModel.services, "rpc"],
|
||||
});
|
||||
|
||||
patch(AttendeeCalendarModel.prototype, "microsoft_calendar_microsoft_calendar_model_functions", {
|
||||
setup(params, { rpc }) {
|
||||
this._super(...arguments);
|
||||
this.rpc = rpc;
|
||||
this.isAlive = params.isAlive;
|
||||
this.microsoftIsSync = true;
|
||||
this.microsoftPendingSync = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
async updateData() {
|
||||
const _super = this._super.bind(this);
|
||||
if (this.microsoftPendingSync) {
|
||||
return _super(...arguments);
|
||||
}
|
||||
try {
|
||||
await Promise.race([
|
||||
new Promise(resolve => setTimeout(resolve, 1000)),
|
||||
this.syncMicrosoftCalendar(true)
|
||||
]);
|
||||
} catch (error) {
|
||||
if (error.event) {
|
||||
error.event.preventDefault();
|
||||
}
|
||||
console.error("Could not synchronize microsoft events now.", error);
|
||||
this.microsoftPendingSync = false;
|
||||
}
|
||||
if (this.isAlive()) {
|
||||
return _super(...arguments);
|
||||
}
|
||||
},
|
||||
|
||||
async syncMicrosoftCalendar(silent = false) {
|
||||
this.microsoftPendingSync = true;
|
||||
const result = await this.rpc(
|
||||
"/microsoft_calendar/sync_data",
|
||||
{
|
||||
model: this.resModel,
|
||||
fromurl: window.location.href
|
||||
},
|
||||
{
|
||||
silent,
|
||||
},
|
||||
);
|
||||
if (["need_config_from_admin", "need_auth", "sync_stopped"].includes(result.status)) {
|
||||
this.microsoftIsSync = false;
|
||||
} else if (result.status === "no_new_event_from_microsoft" || result.status === "need_refresh") {
|
||||
this.microsoftIsSync = true;
|
||||
}
|
||||
this.microsoftPendingSync = false;
|
||||
return result;
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { MockServer } from "@web/../tests/helpers/mock_server";
|
||||
|
||||
patch(MockServer.prototype, "microsoft_calendar_mock_server", {
|
||||
/**
|
||||
* Simulate the creation of a custom appointment type
|
||||
* by receiving a list of slots.
|
||||
* @override
|
||||
*/
|
||||
async _performRPC(route, args) {
|
||||
if (route === '/microsoft_calendar/sync_data') {
|
||||
return Promise.resolve({status: 'no_new_event_from_microsoft'});
|
||||
}
|
||||
return this._super(...arguments);
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { click, getFixture, patchDate, makeDeferred, nextTick} from "@web/../tests/helpers/utils";
|
||||
import { setupViewRegistries } from "@web/../tests/views/helpers";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { userService } from "@web/core/user_service";
|
||||
import { createWebClient, doAction } from "@web/../tests/webclient/helpers";
|
||||
|
||||
const serviceRegistry = registry.category("services");
|
||||
|
||||
let target;
|
||||
let serverData;
|
||||
const uid = -1;
|
||||
|
||||
QUnit.module('Microsoft Calendar', {
|
||||
beforeEach: function () {
|
||||
patchDate(2016, 11, 12, 8, 0, 0);
|
||||
serverData = {
|
||||
models: {
|
||||
'calendar.event': {
|
||||
fields: {
|
||||
id: {string: "ID", type: "integer"},
|
||||
user_id: {string: "user", type: "many2one", relation: 'user'},
|
||||
partner_id: {string: "user", type: "many2one", relation: 'partner', related: 'user_id.partner_id'},
|
||||
name: {string: "name", type: "char"},
|
||||
start: {string: "start datetime", type: "datetime"},
|
||||
stop: {string: "stop datetime", type: "datetime"},
|
||||
partner_ids: {string: "attendees", type: "one2many", relation: 'partner'},
|
||||
},
|
||||
},
|
||||
'appointment.type': {
|
||||
fields: {},
|
||||
records: [],
|
||||
},
|
||||
user: {
|
||||
fields: {
|
||||
id: {string: "ID", type: "integer"},
|
||||
display_name: {string: "Displayed name", type: "char"},
|
||||
partner_id: {string: "partner", type: "many2one", relation: 'partner'},
|
||||
image_1920: {string: "image", type: "integer"},
|
||||
},
|
||||
records: [
|
||||
{id: 4, display_name: "user 4", partner_id: 4},
|
||||
]
|
||||
},
|
||||
partner: {
|
||||
fields: {
|
||||
id: {string: "ID", type: "integer"},
|
||||
display_name: {string: "Displayed name", type: "char"},
|
||||
image_1920: {string: "image", type: "integer"},
|
||||
},
|
||||
records: [
|
||||
{id: 4, display_name: "partner 4", image_1920: 'DDD'},
|
||||
{id: 5, display_name: "partner 5", image_1920: 'DDD'},
|
||||
]
|
||||
},
|
||||
filter_partner: {
|
||||
fields: {
|
||||
id: {string: "ID", type: "integer"},
|
||||
user_id: {string: "user", type: "many2one", relation: 'user'},
|
||||
partner_id: {string: "partner", type: "many2one", relation: 'partner'},
|
||||
partner_checked: {string: "checked", type: "boolean"},
|
||||
},
|
||||
records: [
|
||||
{id: 3, user_id: uid, partner_id: 4, partner_checked: true}
|
||||
]
|
||||
},
|
||||
},
|
||||
views: {},
|
||||
};
|
||||
target = getFixture();
|
||||
setupViewRegistries();
|
||||
serviceRegistry.add(
|
||||
"user",
|
||||
{
|
||||
...userService,
|
||||
start() {
|
||||
const fakeUserService = userService.start(...arguments);
|
||||
Object.defineProperty(fakeUserService, "userId", {
|
||||
get: () => uid,
|
||||
});
|
||||
return fakeUserService;
|
||||
},
|
||||
},
|
||||
{ force: true }
|
||||
);
|
||||
}
|
||||
}, function () {
|
||||
|
||||
QUnit.test("component is destroyed while sync microsoft calendar", async function (assert) {
|
||||
assert.expect(4);
|
||||
const def = makeDeferred();
|
||||
serverData.actions = {
|
||||
1: {
|
||||
id: 1,
|
||||
name: "Partners",
|
||||
res_model: "calendar.event",
|
||||
type: "ir.actions.act_window",
|
||||
views: [
|
||||
[false, "list"],
|
||||
[false, "calendar"],
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
serverData.views = {
|
||||
"calendar.event,false,calendar": `
|
||||
<calendar class="o_calendar_test" js_class="attendee_calendar" date_start="start" date_stop="stop">
|
||||
<field name="name"/>
|
||||
<field name="partner_ids" write_model="filter_partner" write_field="partner_id"/>
|
||||
</calendar>`,
|
||||
"calendar.event,false,list": `<tree sample="1" />`,
|
||||
"calendar.event,false,search": `<search />`,
|
||||
};
|
||||
|
||||
const webClient = await createWebClient({
|
||||
serverData,
|
||||
async mockRPC(route, args) {
|
||||
if (route === '/microsoft_calendar/sync_data') {
|
||||
assert.step(route);
|
||||
return def;
|
||||
} else if (route === '/web/dataset/call_kw/calendar.event/search_read') {
|
||||
assert.step(route);
|
||||
} else if (route === '/web/dataset/call_kw/res.partner/get_attendee_detail') {
|
||||
return Promise.resolve([]);
|
||||
} else if (route === '/web/dataset/call_kw/res.users/has_group') {
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
await doAction(webClient, 1);
|
||||
|
||||
click(target.querySelector(".o_cp_switch_buttons .o_calendar"));
|
||||
await nextTick();
|
||||
|
||||
click(target.querySelector(".o_cp_switch_buttons .o_calendar"));
|
||||
await nextTick();
|
||||
|
||||
def.resolve();
|
||||
await nextTick();
|
||||
|
||||
assert.verifySteps([
|
||||
"/microsoft_calendar/sync_data",
|
||||
"/microsoft_calendar/sync_data",
|
||||
"/web/dataset/call_kw/calendar.event/search_read"
|
||||
], "Correct RPC calls were made");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue