*: 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>
28 lines
858 B
JavaScript
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;
|
|
},
|
|
});
|