From c143f1dca2834873a5ad7e32609301913e93bf3c Mon Sep 17 00:00:00 2001 From: "Xavier Bol (xbo)" Date: Mon, 2 Oct 2023 17:52:57 +0200 Subject: [PATCH 01/18] [IMP] web: manage `parent_of` operator in domain in mockServer Before this commit, `child_of` operator is managed in the mockServer but not the `parent_of` one. This commit manages `parent_of` operator in mockServer to be able to find the record when the domain used contains that operator task-3376776 --- addons/web/static/tests/helpers/mock_server.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/web/static/tests/helpers/mock_server.js b/addons/web/static/tests/helpers/mock_server.js index b0106a15742..8f17b09a51a 100644 --- a/addons/web/static/tests/helpers/mock_server.js +++ b/addons/web/static/tests/helpers/mock_server.js @@ -2198,6 +2198,21 @@ export class MockServer { }); } criterion = [criterion[0], "in", childIDs]; + } else if (criterion[1] === "parent_of") { + // 'parent_of' operator is not supported by domain.js, so we replace + // in by the 'in' operator (with the ids of parent and its ancestors) + const childID = criterion[2]; + const parentIDs = []; + const recordPerID = {}; + for (const record of records) { + recordPerID[record.id] = record; + } + let record = recordPerID[childID]; + while (record) { + parentIDs.push(record.id); + record = record.parent_id && recordPerID[record.parent_id]; + } + criterion = [criterion[0], "in", parentIDs]; } // In case of many2many field, if domain operator is '=' generally change it to 'in' operator const field = model.fields[criterion[0]] || {}; From adbcf6e1da6c9f93ec4a59d5d15b6525f505f7f9 Mon Sep 17 00:00:00 2001 From: "Xavier Bol (xbo)" Date: Thu, 5 Oct 2023 11:21:38 +0200 Subject: [PATCH 02/18] [FIX] web: remove border-end-0 in search view Before this commit, when search menu is not displayed in the search view, then the border right is missing. This commit removes `border-end-0` class added in the search view to always have a border. Even with the search menu, it does not seem to have an extra border. task-3376776 --- addons/web/static/src/search/search_bar/search_bar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/search/search_bar/search_bar.xml b/addons/web/static/src/search/search_bar/search_bar.xml index 6ca07cb9777..58559a2a2ee 100644 --- a/addons/web/static/src/search/search_bar/search_bar.xml +++ b/addons/web/static/src/search/search_bar/search_bar.xml @@ -93,7 +93,7 @@ @@ -300,31 +289,8 @@
  • -
  • - -
    - - - - - - - - -
    -
    +
  • +
  • diff --git a/addons/hr_holidays/static/src/components/hr_presence_status/hr_presence_status.js b/addons/hr_holidays/static/src/components/hr_presence_status/hr_presence_status.js new file mode 100644 index 00000000000..ae4e86ef2ac --- /dev/null +++ b/addons/hr_holidays/static/src/components/hr_presence_status/hr_presence_status.js @@ -0,0 +1,22 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch"; + +import { HrPresenceStatus } from "@hr/components/hr_presence_status/hr_presence_status"; + +patch(HrPresenceStatus.prototype, { + get classNames() { + const classNames = super.classNames; + if (this.value.startsWith("presence_holiday")) { + return `${classNames} fa-plane`; + } + return classNames; + }, + + get color() { + if (this.value.startsWith("presence_holiday")) { + return `text-${this.value === "presence_holiday_present" ? "success" : "warning"}`; + } + return super.color; + }, +}); diff --git a/addons/hr_holidays/views/hr_views.xml b/addons/hr_holidays/views/hr_views.xml index d928483343d..3d1801bc204 100644 --- a/addons/hr_holidays/views/hr_views.xml +++ b/addons/hr_holidays/views/hr_views.xml @@ -94,21 +94,6 @@ - - - - - - - On Time Off - - @@ -124,23 +109,6 @@ - - - - - - - - - @@ -151,14 +119,8 @@ - - not last_activity or not user_id or not id - - - -