Files
odoo_source/addons/hr_holidays/static/tests/helpers/mock_server.js
T
tsm-odoo 3573a7fef4 [IMP] mail, *: use wowlEnv instead of the legacy one
*: bus, calendar, hr, hr_holidays, im_livechat, mail, mail_bot, note, project,
sms, snailmail, test_mail, web, website_livechat, website_slides.

task-2582313

closes odoo/odoo#83774

Related: odoo/enterprise#26493
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-30 19:40:53 +02:00

28 lines
858 B
JavaScript

/** @odoo-module **/
import '@mail/../tests/helpers/mock_server'; // ensure mail overrides are applied first
import { patch } from "@web/core/utils/patch";
import { MockServer } from "@web/../tests/helpers/mock_server";
patch(MockServer.prototype, 'hr_holidays', {
/**
* Overrides to add out of office to employees.
*
* @override
*/
_mockResPartnerMailPartnerFormat(ids) {
const partnerFormats = this._super(...arguments);
const partners = this.getRecords(
'res.partner',
[['id', 'in', ids]],
{ active_test: false },
);
for (const partner of partners) {
// Not a real field but ease the testing
partnerFormats.get(partner.id).out_of_office_date_end = partner.out_of_office_date_end;
}
return partnerFormats;
},
});