19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:27 +01:00
parent d1963a3c3a
commit 2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions

View file

@ -17,6 +17,7 @@ const FAKE_RECORD = {
isTimeHidden: false,
rawRecord: {
name: "Meeting",
description: "<p>Test description</p>",
},
};
@ -41,6 +42,7 @@ test(`mount a CalendarCommonPopover`, async () => {
expect(`.popover-header`).toHaveText("Meeting");
expect(`.list-group`).toHaveCount(2);
expect(`.list-group.o_cw_popover_fields_secondary`).toHaveCount(1);
expect(`.list-group.o_cw_popover_fields_secondary div[name="description"]`).toHaveClass("text-wrap");
expect(`.card-footer .o_cw_popover_edit`).toHaveCount(1);
expect(`.card-footer .o_cw_popover_delete`).toHaveCount(1);
});

View file

@ -143,6 +143,7 @@ export const FAKE_FIELDS = {
default: 1,
},
name: { string: "Name", type: "char" },
description: { string: "Description", type: "html" },
start_date: { string: "Start Date", type: "date" },
stop_date: { string: "Stop Date", type: "date" },
start: { string: "Start Datetime", type: "datetime" },
@ -189,6 +190,12 @@ export const FAKE_MODEL = {
"event",
"calendar"
),
description: Field.parseFieldNode(
createElement("field", { name: "description" , class: "text-wrap"}),
{ event: { fields: FAKE_FIELDS } },
"event",
"calendar"
),
},
activeFields: {
name: {
@ -198,6 +205,13 @@ export const FAKE_MODEL = {
required: false,
onChange: false,
},
description: {
context: "{}",
invisible: false,
readonly: false,
required: false,
onChange: false,
},
},
rangeEnd: DEFAULT_DATE.endOf("month"),
rangeStart: DEFAULT_DATE.startOf("month"),

View file

@ -1445,7 +1445,6 @@ test(`create event with timezone in week mode European locale`, async () => {
</calendar>
`,
});
await selectTimeRange("2016-12-13 08:00:00", "2016-12-13 10:00:00");
expect(`.fc-event-main .fc-event-time`).toHaveText("08:00 - 10:00");
@ -1460,6 +1459,23 @@ test(`create event with timezone in week mode European locale`, async () => {
expect(`.fc-event-main`).toHaveCount(0);
});
test(`create multi day event in week mode`, async () => {
mockTimeZone(2);
patchWithCleanup(CalendarCommonRenderer.prototype, {
get options() {
return { ...super.options, selectAllow: () => true };
},
});
await mountView({
resModel: "event",
type: "calendar",
arch: `<calendar date_start="start" date_stop="stop" mode="week"/>`,
});
await selectTimeRange("2016-12-13 11:00:00", "2016-12-14 16:00:00");
expect(`.fc-event-main .fc-event-time`).toHaveText("11:00 - 16:00");
});
test(`default week start (US)`, async () => {
// if not given any option, default week start is on Sunday
mockTimeZone(-7);
@ -2187,6 +2203,51 @@ test(`set filter with many2many field on mobile`, async () => {
expect(`.o_event[data-event-id="5"] .fc-event-main`).toHaveCount(0);
});
test.tags("desktop");
test("many2many filter handles archived records without crashing on desktop", async () => {
CalendarPartner._fields.active = fields.Boolean({ default: true });
CalendarPartner._records.push({
id: 99,
name: "Joni",
active: false,
});
Event._records[0].attendee_ids = [99];
await mountView({
resModel: "event",
type: "calendar",
arch: `
<calendar date_start="start">
<field name="attendee_ids" filters="1"/>
</calendar>
`,
});
expect(`.o_calendar_filter_item`).toHaveCount(4);
});
test.tags("mobile");
test("many2many filter handles archived records without crashing on mobile", async () => {
CalendarPartner._fields.active = fields.Boolean({ default: true });
CalendarPartner._records.push({
id: 99,
name: "Joni",
active: false,
});
Event._records[0].attendee_ids = [99];
await mountView({
resModel: "event",
type: "calendar",
arch: `
<calendar date_start="start">
<field name="attendee_ids" filters="1"/>
</calendar>
`,
});
await contains(`.o_filter`).click();
expect(`.o_calendar_filter_item`).toHaveCount(4);
});
test.tags("desktop");
test(`set filter with one2many field on desktop`, async () => {
Event._fields.attendee_ids = fields.One2many({