[REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed direct access to owl global object.
For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`
Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:
`import { xml } from "@odoo/owl";`
task-id 3498859
closes odoo/odoo#137517
Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit is contained in:
@@ -9,8 +9,7 @@ import { parseDate, formatDate } from "@web/core/l10n/dates";
|
||||
|
||||
import { formatMonetary } from "@web/views/fields/formatters";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class AccountPaymentPopOver extends Component {}
|
||||
AccountPaymentPopOver.props = {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class ChangeLine extends Component {}
|
||||
ChangeLine.template = "account.ResequenceChangeLine";
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class ListItem extends Component {}
|
||||
ListItem.template = "account.GroupedItemTemplate";
|
||||
|
||||
+1
-2
@@ -4,8 +4,7 @@ import { _t } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class JournalDashboardActivity extends Component {
|
||||
static props = { ...standardFieldProps };
|
||||
|
||||
@@ -4,9 +4,7 @@ import { _t } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { FileInput } from "@web/core/file_input/file_input";
|
||||
|
||||
const { Component, onWillUnmount } = owl;
|
||||
|
||||
import { Component, onWillUnmount } from "@odoo/owl";
|
||||
|
||||
export class MailAttachments extends Component {
|
||||
static template = "account.mail_attachments";
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class OpenMoveWidget extends Component {
|
||||
static props = { ...standardFieldProps };
|
||||
|
||||
+1
-2
@@ -6,8 +6,7 @@ import { X2ManyField, x2ManyField } from "@web/views/fields/x2many/x2many_field"
|
||||
import { TextField, ListTextField } from "@web/views/fields/text/text_field";
|
||||
import { CharField } from "@web/views/fields/char/char_field";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
|
||||
const { Component, useEffect } = owl;
|
||||
import { Component, useEffect } from "@odoo/owl";
|
||||
|
||||
export class SectionAndNoteListRenderer extends ListRenderer {
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,15 @@ import { parseFloat } from "@web/views/fields/parsers";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { getCurrency } from "@web/core/currency";
|
||||
|
||||
const { Component, onPatched, onWillUpdateProps, onWillRender, toRaw, useRef, useState } = owl;
|
||||
import {
|
||||
Component,
|
||||
onPatched,
|
||||
onWillUpdateProps,
|
||||
onWillRender,
|
||||
toRaw,
|
||||
useRef,
|
||||
useState,
|
||||
} from "@odoo/owl";
|
||||
|
||||
/**
|
||||
A line of some TaxTotalsComponent, giving the values of a tax group.
|
||||
|
||||
+8
-2
@@ -17,8 +17,14 @@ import { useOpenMany2XRecord } from "@web/views/fields/relational_utils";
|
||||
import { parseFloat as oParseFloat } from "@web/views/fields/parsers";
|
||||
import { formatPercentage } from "@web/views/fields/formatters";
|
||||
import { SelectCreateDialog } from "@web/views/view_dialogs/select_create_dialog";
|
||||
|
||||
const { Component, useState, useRef, useExternalListener, onWillStart, onPatched } = owl;
|
||||
import {
|
||||
Component,
|
||||
useState,
|
||||
useRef,
|
||||
useExternalListener,
|
||||
onWillStart,
|
||||
onPatched,
|
||||
} from "@odoo/owl";
|
||||
|
||||
const PLAN_APPLICABILITY = {
|
||||
mandatory: _t("Mandatory"),
|
||||
|
||||
@@ -8,8 +8,7 @@ import { useInputField } from "@web/views/fields/input_field_hook";
|
||||
|
||||
import { recommendations, ConcretePolicy } from "./password_policy";
|
||||
import { Meter } from "./password_meter";
|
||||
|
||||
const { Component, onWillStart, useState } = owl;
|
||||
import { Component, onWillStart, useState } from "@odoo/owl";
|
||||
|
||||
export class PasswordField extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { computeScore } from "./password_policy";
|
||||
|
||||
const { Component, xml } = owl;
|
||||
import { Component, xml } from "@odoo/owl";
|
||||
|
||||
export class Meter extends Component {
|
||||
get title() {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, xml } = owl;
|
||||
import { Component, xml } from "@odoo/owl";
|
||||
|
||||
export class BarcodeHandlerField extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { isBrowserChrome, isMobileOS } from "@web/core/browser/feature_detection";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { session } from "@web/session";
|
||||
|
||||
const { EventBus, whenReady } = owl;
|
||||
import { EventBus, whenReady } from "@odoo/owl";
|
||||
|
||||
function isEditable(element) {
|
||||
return element.matches('input,textarea,[contenteditable="true"]');
|
||||
|
||||
@@ -17,8 +17,7 @@ import { registry } from "@web/core/registry";
|
||||
import { uiService } from "@web/core/ui/ui_service";
|
||||
import { getFixture, mount, nextTick, patchWithCleanup } from "@web/../tests/helpers/utils";
|
||||
import { BaseAutomationErrorDialog } from "@base_automation/base_automation_error_dialog";
|
||||
|
||||
const { toRaw } = owl;
|
||||
import { toRaw } from "@odoo/owl";
|
||||
|
||||
const serviceRegistry = registry.category("services");
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { registry } from "@web/core/registry";
|
||||
import { CharField, charField } from "@web/views/fields/char/char_field";
|
||||
import { useDebounced } from "@web/core/utils/timing";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { useState } from "@odoo/owl";
|
||||
|
||||
const { useState } = owl;
|
||||
export const DELAY = 400;
|
||||
|
||||
export class IbanWidget extends CharField {
|
||||
|
||||
@@ -4,8 +4,8 @@ import { _t } from "@web/core/l10n/translation";
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useAutofocus, useService } from "@web/core/utils/hooks";
|
||||
import { Component, useState } from "@odoo/owl";
|
||||
|
||||
const { Component, useState } = owl;
|
||||
const cogMenuRegistry = registry.category("cogMenu");
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { View } from "@web/views/view";
|
||||
import { makeContext } from "@web/core/context";
|
||||
|
||||
const { Component, onWillStart } = owl;
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class BoardAction extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -10,8 +10,7 @@ import { renderToString } from "@web/core/utils/render";
|
||||
import { useSortable } from "@web/core/utils/sortable";
|
||||
import { standardViewProps } from "@web/views/standard_view_props";
|
||||
import { BoardAction } from "./board_action";
|
||||
|
||||
const { blockDom, Component, useState, useRef } = owl;
|
||||
import { blockDom, Component, useState, useRef } from "@odoo/owl";
|
||||
|
||||
export class BoardController extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
|
||||
const { EventBus } = owl;
|
||||
import { EventBus } from "@odoo/owl";
|
||||
|
||||
let multiTabId = 0;
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,7 @@ import { registry } from "@web/core/registry";
|
||||
import { session } from "@web/session";
|
||||
import { isIosApp } from "@web/core/browser/feature_detection";
|
||||
import { WORKER_VERSION } from "@bus/workers/websocket_worker";
|
||||
|
||||
const { EventBus } = owl;
|
||||
import { EventBus } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Communicate with a SharedWorker in order to provide a single websocket
|
||||
|
||||
+24
-30
@@ -1,28 +1,27 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from '@web/core/registry';
|
||||
import { registry } from "@web/core/registry";
|
||||
import { session } from "@web/session";
|
||||
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const { Component } = owl;
|
||||
const providerData = {
|
||||
'google': {
|
||||
'restart_sync_method': 'restart_google_synchronization',
|
||||
'sync_route': '/google_calendar/sync_data'
|
||||
google: {
|
||||
restart_sync_method: "restart_google_synchronization",
|
||||
sync_route: "/google_calendar/sync_data",
|
||||
},
|
||||
'microsoft': {
|
||||
'restart_sync_method': 'restart_microsoft_synchronization',
|
||||
'sync_route': '/microsoft_calendar/sync_data'
|
||||
}
|
||||
}
|
||||
|
||||
microsoft: {
|
||||
restart_sync_method: "restart_microsoft_synchronization",
|
||||
sync_route: "/microsoft_calendar/sync_data",
|
||||
},
|
||||
};
|
||||
|
||||
export class CalendarConnectProvider extends Component {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.orm = useService('orm');
|
||||
this.rpc = useService('rpc');
|
||||
this.orm = useService("orm");
|
||||
this.rpc = useService("rpc");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,27 +33,22 @@ export class CalendarConnectProvider extends Component {
|
||||
async onConnect(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopImmediatePropagation();
|
||||
if (!await this.props.record.save()) {
|
||||
return; // handled by view
|
||||
if (!(await this.props.record.save())) {
|
||||
return; // handled by view
|
||||
}
|
||||
await this.orm.call(
|
||||
this.props.record.resModel,
|
||||
'action_calendar_prepare_external_provider_sync',
|
||||
"action_calendar_prepare_external_provider_sync",
|
||||
[this.props.record.resId]
|
||||
)
|
||||
);
|
||||
// See google/microsoft_calendar for the origin of this shortened version
|
||||
const { restart_sync_method, sync_route } = providerData[this.props.record.data.external_calendar_provider];
|
||||
await this.orm.call(
|
||||
'res.users',
|
||||
restart_sync_method,
|
||||
[[session.uid]]
|
||||
);
|
||||
const response = await this.rpc(
|
||||
sync_route, {
|
||||
model: 'calendar.event',
|
||||
fromurl: window.location.href,
|
||||
}
|
||||
);
|
||||
const { restart_sync_method, sync_route } =
|
||||
providerData[this.props.record.data.external_calendar_provider];
|
||||
await this.orm.call("res.users", restart_sync_method, [[session.uid]]);
|
||||
const response = await this.rpc(sync_route, {
|
||||
model: "calendar.event",
|
||||
fromurl: window.location.href,
|
||||
});
|
||||
await this._beforeLeaveContext();
|
||||
if (response.status === "need_auth") {
|
||||
window.location.assign(response.url);
|
||||
@@ -74,7 +68,7 @@ export class CalendarConnectProvider extends Component {
|
||||
CalendarConnectProvider.props = {
|
||||
...standardWidgetProps,
|
||||
};
|
||||
CalendarConnectProvider.template = 'calendar.CalendarConnectProvider';
|
||||
CalendarConnectProvider.template = "calendar.CalendarConnectProvider";
|
||||
|
||||
const calendarConnectProvider = {
|
||||
component: CalendarConnectProvider,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { Dialog } from "@web/core/dialog/dialog";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class AskRecurrenceUpdatePolicyDialog extends Component {
|
||||
setup() {
|
||||
@@ -24,7 +23,7 @@ export class AskRecurrenceUpdatePolicyDialog extends Component {
|
||||
}
|
||||
|
||||
get selected() {
|
||||
return Object.entries(this.possibleValues).find(state => state[1].checked)[0];
|
||||
return Object.entries(this.possibleValues).find((state) => state[1].checked)[0];
|
||||
}
|
||||
|
||||
set selected(val) {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { FormController } from "@web/views/form/form_controller";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { onWillStart } = owl;
|
||||
import { onWillStart } from "@odoo/owl";
|
||||
|
||||
export class CalendarFormController extends FormController {
|
||||
setup() {
|
||||
@@ -13,24 +12,24 @@ export class CalendarFormController extends FormController {
|
||||
onWillStart(async () => {
|
||||
this.discussVideocallLocation = await ormService.call(
|
||||
"calendar.event",
|
||||
"get_discuss_videocall_location",
|
||||
"get_discuss_videocall_location"
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
async beforeExecuteActionButton(clickParams) {
|
||||
const action = clickParams.name;
|
||||
if (action == 'clear_videocall_location' || action === 'set_discuss_videocall_location') {
|
||||
if (action == "clear_videocall_location" || action === "set_discuss_videocall_location") {
|
||||
let newVal = false;
|
||||
let videoCallSource = 'custom'
|
||||
let videoCallSource = "custom";
|
||||
let changes = {};
|
||||
if (action === 'set_discuss_videocall_location') {
|
||||
if (action === "set_discuss_videocall_location") {
|
||||
newVal = this.discussVideocallLocation;
|
||||
videoCallSource = 'discuss';
|
||||
changes.access_token = this.discussVideocallLocation.split('/').pop();
|
||||
videoCallSource = "discuss";
|
||||
changes.access_token = this.discussVideocallLocation.split("/").pop();
|
||||
}
|
||||
changes = Object.assign(changes, {
|
||||
videocall_location: newVal,
|
||||
|
||||
@@ -6,8 +6,7 @@ import { loadJS } from "@web/core/assets";
|
||||
// temporary for OnNoResultReturned bug
|
||||
import { UncaughtCorsError } from "@web/core/errors/error_service";
|
||||
const errorHandlerRegistry = registry.category("error_handlers");
|
||||
|
||||
const { Component, onWillRender, useEffect, useRef, useState, xml } = owl;
|
||||
import { Component, onWillRender, useEffect, useRef, useState, xml } from "@odoo/owl";
|
||||
|
||||
const MONDIALRELAY_SCRIPT_URL = "https://widget.mondialrelay.com/parcelshop-picker/jquery.plugin.mondialrelay.parcelshoppicker.min.js"
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class IconSelectionField extends Component {
|
||||
get icon() {
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { registry } from '@web/core/registry';
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
|
||||
|
||||
const { onWillStart, useState, onWillUpdateProps, Component } = owl;
|
||||
import { onWillStart, useState, onWillUpdateProps, Component } from "@odoo/owl";
|
||||
|
||||
export class DepartmentChart extends Component {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
this.action = useService('action');
|
||||
this.orm = useService('orm');
|
||||
this.action = useService("action");
|
||||
this.orm = useService("orm");
|
||||
this.state = useState({
|
||||
hierarchy: {}
|
||||
hierarchy: {},
|
||||
});
|
||||
onWillStart(async () => await this.fetchHierarchy(this.props.record.resId));
|
||||
|
||||
@@ -24,18 +23,20 @@ export class DepartmentChart extends Component {
|
||||
}
|
||||
|
||||
async fetchHierarchy(departmentId) {
|
||||
this.state.hierarchy = await this.orm.call('hr.department', 'get_department_hierarchy', [departmentId]);
|
||||
this.state.hierarchy = await this.orm.call("hr.department", "get_department_hierarchy", [
|
||||
departmentId,
|
||||
]);
|
||||
}
|
||||
|
||||
openDepartmentEmployees(departmentId) {
|
||||
this.action.doAction('hr.act_employee_from_department', {
|
||||
this.action.doAction("hr.act_employee_from_department", {
|
||||
additionalContext: {
|
||||
'active_id': departmentId,
|
||||
}
|
||||
active_id: departmentId,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
DepartmentChart.template = 'hr.DepartmentChart';
|
||||
DepartmentChart.template = "hr.DepartmentChart";
|
||||
DepartmentChart.props = {
|
||||
...standardWidgetProps,
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
|
||||
|
||||
import { useOpenChat } from "@mail/core/web/open_chat_hook";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class HrEmployeeChat extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,28 +2,30 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useComponent } = owl;
|
||||
import { useComponent } from "@odoo/owl";
|
||||
|
||||
export function useArchiveEmployee() {
|
||||
const component = useComponent();
|
||||
const action = useService("action");
|
||||
return (id) => {
|
||||
action.doAction({
|
||||
type: 'ir.actions.act_window',
|
||||
name: _t('Employee Termination'),
|
||||
res_model: 'hr.departure.wizard',
|
||||
views: [[false, 'form']],
|
||||
view_mode: 'form',
|
||||
target: 'new',
|
||||
context: {
|
||||
'active_id': id,
|
||||
'toggle_active': true,
|
||||
}
|
||||
}, {
|
||||
onClose: async () => {
|
||||
await component.model.load();
|
||||
action.doAction(
|
||||
{
|
||||
type: "ir.actions.act_window",
|
||||
name: _t("Employee Termination"),
|
||||
res_model: "hr.departure.wizard",
|
||||
views: [[false, "form"]],
|
||||
view_mode: "form",
|
||||
target: "new",
|
||||
context: {
|
||||
active_id: id,
|
||||
toggle_active: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
{
|
||||
onClose: async () => {
|
||||
await component.model.load();
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { graphView } from "@web/views/graph/graph_view";
|
||||
import { pivotView } from "@web/views/pivot/pivot_view";
|
||||
|
||||
const { useComponent } = owl;
|
||||
import { useComponent } from "@odoo/owl";
|
||||
|
||||
const viewRegistry = registry.category("views");
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ContractWarningTooltip extends Component {
|
||||
get tooltipInfo() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { useService } from '@web/core/utils/hooks';
|
||||
import { getCurrency } from '@web/core/currency';
|
||||
|
||||
const { Component, onWillStart, useState } = owl;
|
||||
import { Component, onWillStart, useState } from "@odoo/owl";
|
||||
|
||||
export class ExpenseDashboard extends Component {
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { useBus, useService } from '@web/core/utils/hooks';
|
||||
|
||||
const { useRef, useEffect, useState } = owl;
|
||||
import { useRef, useEffect, useState } from "@odoo/owl";
|
||||
|
||||
export const ExpenseDocumentDropZone = (T) => class ExpenseDocumentDropZone extends T {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { onMounted, onPatched, useRef } = owl;
|
||||
import { onMounted, onPatched, useRef } from "@odoo/owl";
|
||||
|
||||
export const ExpenseMobileQRCode = (T) => class ExpenseMobileQRCode extends T {
|
||||
setup() {
|
||||
|
||||
@@ -10,8 +10,7 @@ import { listView } from "@web/views/list/list_view";
|
||||
|
||||
import { ListController } from "@web/views/list/list_controller";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
|
||||
const { onWillStart } = owl;
|
||||
import { onWillStart } from "@odoo/owl";
|
||||
|
||||
export class ExpenseListController extends ExpenseDocumentUpload(ListController) {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { KanbanController } from "@web/views/kanban/kanban_controller";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useRef } = owl;
|
||||
import { useRef } from "@odoo/owl";
|
||||
|
||||
export class HrFleetKanbanController extends KanbanController {
|
||||
setup() {
|
||||
|
||||
@@ -1,18 +1,29 @@
|
||||
/* @odoo-module */
|
||||
|
||||
import { usePopover } from "@web/core/popover/popover_hook";
|
||||
import { useNewAllocationRequest } from '@hr_holidays/views/hooks';
|
||||
|
||||
const { Component } = owl;
|
||||
import { useNewAllocationRequest } from "@hr_holidays/views/hooks";
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class TimeOffCardPopover extends Component {}
|
||||
|
||||
TimeOffCardPopover.template = 'hr_holidays.TimeOffCardPopover';
|
||||
TimeOffCardPopover.props = ['allocated', 'approved', 'planned', 'left', 'employeeId', 'holidayStatusId', 'close?', 'onClickNewAllocationRequest?'];
|
||||
TimeOffCardPopover.template = "hr_holidays.TimeOffCardPopover";
|
||||
TimeOffCardPopover.props = [
|
||||
"allocated",
|
||||
"approved",
|
||||
"planned",
|
||||
"left",
|
||||
"employeeId",
|
||||
"holidayStatusId",
|
||||
"close?",
|
||||
"onClickNewAllocationRequest?",
|
||||
];
|
||||
|
||||
export class TimeOffCard extends Component {
|
||||
setup() {
|
||||
this.popover = usePopover(TimeOffCardPopover, { position: "right", popoverClass: "bg-view" });
|
||||
this.popover = usePopover(TimeOffCardPopover, {
|
||||
position: "right",
|
||||
popoverClass: "bg-view",
|
||||
});
|
||||
this.newAllocationRequest = useNewAllocationRequest();
|
||||
}
|
||||
|
||||
@@ -35,9 +46,9 @@ export class TimeOffCard extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
TimeOffCard.template = 'hr_holidays.TimeOffCard';
|
||||
TimeOffCard.props = ['name', 'data', 'requires_allocation', 'employeeId', 'holidayStatusId'];
|
||||
TimeOffCard.template = "hr_holidays.TimeOffCard";
|
||||
TimeOffCard.props = ["name", "data", "requires_allocation", "employeeId", "holidayStatusId"];
|
||||
|
||||
export class TimeOffCardMobile extends TimeOffCard {}
|
||||
|
||||
TimeOffCardMobile.template = 'hr_holidays.TimeOffCardMobile';
|
||||
TimeOffCardMobile.template = "hr_holidays.TimeOffCardMobile";
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/* @odoo-module */
|
||||
|
||||
import { TimeOffCard } from './time_off_card';
|
||||
import { useNewAllocationRequest } from '@hr_holidays/views/hooks';
|
||||
import { TimeOffCard } from "./time_off_card";
|
||||
import { useNewAllocationRequest } from "@hr_holidays/views/hooks";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, useState, onWillStart } = owl;
|
||||
import { Component, useState, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class TimeOffDashboard extends Component {
|
||||
setup() {
|
||||
@@ -13,8 +12,8 @@ export class TimeOffDashboard extends Component {
|
||||
this.state = useState({
|
||||
holidays: [],
|
||||
});
|
||||
useBus(this.env.timeOffBus, 'update_dashboard', async () => {
|
||||
await this.loadDashboardData()
|
||||
useBus(this.env.timeOffBus, "update_dashboard", async () => {
|
||||
await this.loadDashboardData();
|
||||
});
|
||||
|
||||
onWillStart(async () => {
|
||||
@@ -25,17 +24,12 @@ export class TimeOffDashboard extends Component {
|
||||
async loadDashboardData() {
|
||||
const context = {};
|
||||
if (this.props.employeeId !== null) {
|
||||
context['employee_id'] = this.props.employeeId;
|
||||
context["employee_id"] = this.props.employeeId;
|
||||
}
|
||||
|
||||
this.state.holidays = await this.orm.call(
|
||||
'hr.leave.type',
|
||||
'get_days_all_request',
|
||||
[],
|
||||
{
|
||||
context: context
|
||||
}
|
||||
);
|
||||
this.state.holidays = await this.orm.call("hr.leave.type", "get_days_all_request", [], {
|
||||
context: context,
|
||||
});
|
||||
}
|
||||
async newAllocationRequest() {
|
||||
await this.newRequest(this.props.employeeId);
|
||||
@@ -43,5 +37,5 @@ export class TimeOffDashboard extends Component {
|
||||
}
|
||||
|
||||
TimeOffDashboard.components = { TimeOffCard };
|
||||
TimeOffDashboard.template = 'hr_holidays.TimeOffDashboard';
|
||||
TimeOffDashboard.props = ['employeeId'];
|
||||
TimeOffDashboard.template = "hr_holidays.TimeOffDashboard";
|
||||
TimeOffDashboard.props = ["employeeId"];
|
||||
|
||||
@@ -5,13 +5,13 @@ import { useService } from "@web/core/utils/hooks";
|
||||
import { useRecordObserver } from "@web/model/relational_model/utils";
|
||||
|
||||
import { formatDate } from "@web/core/l10n/dates";
|
||||
import { Component, useState, onWillStart } from "@odoo/owl";
|
||||
|
||||
const { Component, useState, onWillStart } = owl;
|
||||
const { DateTime } = luxon;
|
||||
|
||||
export class LeaveStatsComponent extends Component {
|
||||
setup() {
|
||||
this.orm = useService('orm');
|
||||
this.orm = useService("orm");
|
||||
|
||||
this.state = useState({
|
||||
leaves: [],
|
||||
@@ -53,7 +53,7 @@ export class LeaveStatsComponent extends Component {
|
||||
}
|
||||
|
||||
get thisYear() {
|
||||
return this.date.toFormat('yyyy');
|
||||
return this.date.toFormat("yyyy");
|
||||
}
|
||||
|
||||
async loadDepartmentLeaves(date, department, employee) {
|
||||
@@ -62,25 +62,25 @@ export class LeaveStatsComponent extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const dateFrom = date.startOf('month');
|
||||
const dateTo = date.endOf('month');
|
||||
const dateFrom = date.startOf("month");
|
||||
const dateTo = date.endOf("month");
|
||||
|
||||
const departmentLeaves = await this.orm.searchRead(
|
||||
'hr.leave',
|
||||
"hr.leave",
|
||||
[
|
||||
['department_id', '=', department[0]],
|
||||
['state', '=', 'validate'],
|
||||
['holiday_type', '=', 'employee'],
|
||||
['date_from', '<=', dateTo],
|
||||
['date_to', '>=', dateFrom],
|
||||
["department_id", "=", department[0]],
|
||||
["state", "=", "validate"],
|
||||
["holiday_type", "=", "employee"],
|
||||
["date_from", "<=", dateTo],
|
||||
["date_to", ">=", dateFrom],
|
||||
],
|
||||
['employee_id', 'date_from', 'date_to', 'number_of_days'],
|
||||
["employee_id", "date_from", "date_to", "number_of_days"]
|
||||
);
|
||||
|
||||
this.state.departmentLeaves = departmentLeaves.map((leave) => {
|
||||
return Object.assign({}, leave, {
|
||||
dateFrom: formatDate(DateTime.fromSQL(leave.date_from, { zone: 'utc' }).toLocal()),
|
||||
dateTo: formatDate(DateTime.fromSQL(leave.date_to, { zone: 'utc' }).toLocal()),
|
||||
dateFrom: formatDate(DateTime.fromSQL(leave.date_from, { zone: "utc" }).toLocal()),
|
||||
dateTo: formatDate(DateTime.fromSQL(leave.date_to, { zone: "utc" }).toLocal()),
|
||||
sameEmployee: leave.employee_id[0] === employee[0],
|
||||
});
|
||||
});
|
||||
@@ -92,25 +92,25 @@ export class LeaveStatsComponent extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const dateFrom = date.startOf('year');
|
||||
const dateTo = date.endOf('year');
|
||||
const dateFrom = date.startOf("year");
|
||||
const dateTo = date.endOf("year");
|
||||
this.state.leaves = await this.orm.readGroup(
|
||||
'hr.leave',
|
||||
"hr.leave",
|
||||
[
|
||||
['employee_id', '=', employee[0]],
|
||||
['state', '=', 'validate'],
|
||||
['date_from', '<=', dateTo],
|
||||
['date_to', '>=', dateFrom]
|
||||
["employee_id", "=", employee[0]],
|
||||
["state", "=", "validate"],
|
||||
["date_from", "<=", dateTo],
|
||||
["date_to", ">=", dateFrom],
|
||||
],
|
||||
['holiday_status_id', 'number_of_days:sum'],
|
||||
['holiday_status_id'],
|
||||
["holiday_status_id", "number_of_days:sum"],
|
||||
["holiday_status_id"]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
LeaveStatsComponent.template = 'hr_holidays.LeaveStatsComponent';
|
||||
LeaveStatsComponent.template = "hr_holidays.LeaveStatsComponent";
|
||||
|
||||
export const leaveStatsComponent = {
|
||||
component: LeaveStatsComponent,
|
||||
};
|
||||
registry.category('view_widgets').add('hr_leave_stats', leaveStatsComponent);
|
||||
registry.category("view_widgets").add("hr_leave_stats", leaveStatsComponent);
|
||||
|
||||
@@ -2,17 +2,16 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
|
||||
import { CalendarController } from '@web/views/calendar/calendar_controller';
|
||||
import { FormViewDialog } from '@web/views/view_dialogs/form_view_dialog';
|
||||
import { CalendarController } from "@web/views/calendar/calendar_controller";
|
||||
import { FormViewDialog } from "@web/views/view_dialogs/form_view_dialog";
|
||||
import { Dropdown, DropdownItem } from "@web/core/dropdown/dropdown";
|
||||
|
||||
import { serializeDate } from "@web/core/l10n/dates";
|
||||
|
||||
import { TimeOffCalendarFilterPanel } from './filter_panel/calendar_filter_panel';
|
||||
import { TimeOffFormViewDialog } from '../view_dialog/form_view_dialog';
|
||||
import { useLeaveCancelWizard } from '../hooks';
|
||||
|
||||
const { EventBus, useSubEnv } = owl;
|
||||
import { TimeOffCalendarFilterPanel } from "./filter_panel/calendar_filter_panel";
|
||||
import { TimeOffFormViewDialog } from "../view_dialog/form_view_dialog";
|
||||
import { useLeaveCancelWizard } from "../hooks";
|
||||
import { EventBus, useSubEnv } from "@odoo/owl";
|
||||
|
||||
export class TimeOffCalendarController extends CalendarController {
|
||||
setup() {
|
||||
@@ -37,24 +36,26 @@ export class TimeOffCalendarController extends CalendarController {
|
||||
newTimeOffRequest() {
|
||||
const context = {};
|
||||
if (this.employeeId) {
|
||||
context['default_employee_id'] = this.employeeId;
|
||||
context["default_employee_id"] = this.employeeId;
|
||||
}
|
||||
if (this.model.meta.scale == 'day') {
|
||||
context['default_date_from'] = serializeDate(
|
||||
this.model.data.range.start.set({ hours: 7 }), "datetime"
|
||||
if (this.model.meta.scale == "day") {
|
||||
context["default_date_from"] = serializeDate(
|
||||
this.model.data.range.start.set({ hours: 7 }),
|
||||
"datetime"
|
||||
);
|
||||
context['default_date_to'] = serializeDate(
|
||||
this.model.data.range.end.set({ hours: 19 }), "datetime"
|
||||
context["default_date_to"] = serializeDate(
|
||||
this.model.data.range.end.set({ hours: 19 }),
|
||||
"datetime"
|
||||
);
|
||||
}
|
||||
|
||||
this.displayDialog(FormViewDialog, {
|
||||
resModel: 'hr.leave',
|
||||
title: _t('New Time Off'),
|
||||
resModel: "hr.leave",
|
||||
title: _t("New Time Off"),
|
||||
viewId: this.model.formViewId,
|
||||
onRecordSaved: () => {
|
||||
this.model.load();
|
||||
this.env.timeOffBus.trigger('update_dashboard');
|
||||
this.env.timeOffBus.trigger("update_dashboard");
|
||||
},
|
||||
context: context,
|
||||
});
|
||||
@@ -67,14 +68,14 @@ export class TimeOffCalendarController extends CalendarController {
|
||||
body: _t("Are you sure you want to delete this record?"),
|
||||
confirm: async () => {
|
||||
await this.model.unlinkRecord(record.resId);
|
||||
this.env.timeOffBus.trigger('update_dashboard');
|
||||
this.env.timeOffBus.trigger("update_dashboard");
|
||||
},
|
||||
cancel: () => {},
|
||||
});
|
||||
} else {
|
||||
this.leaveCancelWizard(record.resId, () => {
|
||||
this.model.load();
|
||||
this.env.timeOffBus.trigger('update_dashboard');
|
||||
this.env.timeOffBus.trigger("update_dashboard");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -82,12 +83,13 @@ export class TimeOffCalendarController extends CalendarController {
|
||||
async editRecord(record, context = {}, shouldFetchFormViewId = true) {
|
||||
const onDialogClosed = () => {
|
||||
this.model.load();
|
||||
this.env.timeOffBus.trigger('update_dashboard');
|
||||
this.env.timeOffBus.trigger("update_dashboard");
|
||||
};
|
||||
|
||||
return new Promise((resolve) => {
|
||||
this.displayDialog(
|
||||
TimeOffFormViewDialog, {
|
||||
TimeOffFormViewDialog,
|
||||
{
|
||||
resModel: this.model.resModel,
|
||||
resId: record.id || false,
|
||||
context,
|
||||
@@ -96,7 +98,7 @@ export class TimeOffCalendarController extends CalendarController {
|
||||
onRecordSaved: onDialogClosed,
|
||||
onRecordDeleted: (record) => this.deleteRecord(record),
|
||||
onLeaveCancelled: onDialogClosed,
|
||||
size: 'md',
|
||||
size: "md",
|
||||
},
|
||||
{ onClose: () => resolve() }
|
||||
);
|
||||
|
||||
+23
-24
@@ -2,18 +2,17 @@
|
||||
|
||||
import { CalendarFilterPanel } from "@web/views/calendar/filter_panel/calendar_filter_panel";
|
||||
import { TimeOffCardMobile } from "../../../dashboard/time_off_card";
|
||||
import { getFormattedDateSpan } from '@web/views/calendar/utils';
|
||||
import { getFormattedDateSpan } from "@web/views/calendar/utils";
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { serializeDate } from "@web/core/l10n/dates";
|
||||
|
||||
const { useState, onWillStart, onWillUpdateProps } = owl;
|
||||
import { useState, onWillStart, onWillUpdateProps } from "@odoo/owl";
|
||||
|
||||
export class TimeOffCalendarFilterPanel extends CalendarFilterPanel {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
this.orm = useService('orm');
|
||||
this.orm = useService("orm");
|
||||
this.getFormattedDateSpan = getFormattedDateSpan;
|
||||
this.leaveState = useState({
|
||||
holidays: [],
|
||||
@@ -30,38 +29,38 @@ export class TimeOffCalendarFilterPanel extends CalendarFilterPanel {
|
||||
|
||||
async updateSpecialDays() {
|
||||
const context = {
|
||||
'employee_id': this.props.employee_id,
|
||||
}
|
||||
employee_id: this.props.employee_id,
|
||||
};
|
||||
const specialDays = await this.orm.call(
|
||||
'hr.employee', 'get_special_days_data', [
|
||||
"hr.employee",
|
||||
"get_special_days_data",
|
||||
[
|
||||
serializeDate(this.props.model.rangeStart, "datetime"),
|
||||
serializeDate(this.props.model.rangeEnd, "datetime"),
|
||||
],
|
||||
{
|
||||
'context': context,
|
||||
},
|
||||
context: context,
|
||||
}
|
||||
);
|
||||
specialDays['bankHolidays'].forEach(bankHoliday => {
|
||||
bankHoliday.start = luxon.DateTime.fromISO(bankHoliday.start)
|
||||
bankHoliday.end = luxon.DateTime.fromISO(bankHoliday.end)
|
||||
specialDays["bankHolidays"].forEach((bankHoliday) => {
|
||||
bankHoliday.start = luxon.DateTime.fromISO(bankHoliday.start);
|
||||
bankHoliday.end = luxon.DateTime.fromISO(bankHoliday.end);
|
||||
});
|
||||
specialDays['mandatoryDays'].forEach(mandatoryDay => {
|
||||
mandatoryDay.start = luxon.DateTime.fromISO(mandatoryDay.start)
|
||||
mandatoryDay.end = luxon.DateTime.fromISO(mandatoryDay.end)
|
||||
specialDays["mandatoryDays"].forEach((mandatoryDay) => {
|
||||
mandatoryDay.start = luxon.DateTime.fromISO(mandatoryDay.start);
|
||||
mandatoryDay.end = luxon.DateTime.fromISO(mandatoryDay.end);
|
||||
});
|
||||
this.leaveState.bankHolidays = specialDays['bankHolidays'];
|
||||
this.leaveState.mandatoryDays = specialDays['mandatoryDays'];
|
||||
this.leaveState.bankHolidays = specialDays["bankHolidays"];
|
||||
this.leaveState.mandatoryDays = specialDays["mandatoryDays"];
|
||||
}
|
||||
|
||||
async loadFilterData() {
|
||||
if(!this.env.isSmall) {
|
||||
if (!this.env.isSmall) {
|
||||
return;
|
||||
}
|
||||
|
||||
const filterData = {};
|
||||
const data = await this.orm.call(
|
||||
'hr.leave.type', 'get_days_all_request', [],
|
||||
);
|
||||
const data = await this.orm.call("hr.leave.type", "get_days_all_request", []);
|
||||
|
||||
data.forEach((leave) => {
|
||||
filterData[leave[3]] = leave;
|
||||
@@ -69,11 +68,11 @@ export class TimeOffCalendarFilterPanel extends CalendarFilterPanel {
|
||||
this.leaveState.holidays = filterData;
|
||||
}
|
||||
}
|
||||
TimeOffCalendarFilterPanel.template = 'hr_holidays.CalendarFilterPanel';
|
||||
TimeOffCalendarFilterPanel.template = "hr_holidays.CalendarFilterPanel";
|
||||
TimeOffCalendarFilterPanel.components = {
|
||||
...TimeOffCalendarFilterPanel.components,
|
||||
TimeOffCardMobile,
|
||||
}
|
||||
};
|
||||
TimeOffCalendarFilterPanel.subTemplates = {
|
||||
filter: "hr_holidays.CalendarFilterPanel.filter",
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { CalendarYearRenderer } from '@web/views/calendar/calendar_year/calendar_year_renderer';
|
||||
import { CalendarYearRenderer } from "@web/views/calendar/calendar_year/calendar_year_renderer";
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { useMandatoryDays } from '../../hooks';
|
||||
import { useCalendarPopover } from '@web/views/calendar/hooks';
|
||||
import { TimeOffCalendarYearPopover } from './calendar_year_popover';
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useMandatoryDays } from "../../hooks";
|
||||
import { useCalendarPopover } from "@web/views/calendar/hooks";
|
||||
import { TimeOffCalendarYearPopover } from "./calendar_year_popover";
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
export class TimeOffCalendarYearRenderer extends CalendarYearRenderer {
|
||||
setup() {
|
||||
@@ -18,49 +17,64 @@ export class TimeOffCalendarYearRenderer extends CalendarYearRenderer {
|
||||
this.mandatoryDaysList = [];
|
||||
this.mandatoryDayPopover = useCalendarPopover(TimeOffCalendarYearPopover);
|
||||
|
||||
useEffect((el) => {
|
||||
for (const week of el) {
|
||||
const row = week.parentElement;
|
||||
useEffect(
|
||||
(el) => {
|
||||
for (const week of el) {
|
||||
const row = week.parentElement;
|
||||
|
||||
// Remove the week number if the week is empty.
|
||||
// FullCalendar always displays 6 weeks even when empty.
|
||||
if (!row.children[1].classList.length &&
|
||||
!row.children[row.children.length - 1].classList.length) {
|
||||
row.remove();
|
||||
// Remove the week number if the week is empty.
|
||||
// FullCalendar always displays 6 weeks even when empty.
|
||||
if (
|
||||
!row.children[1].classList.length &&
|
||||
!row.children[row.children.length - 1].classList.length
|
||||
) {
|
||||
row.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, () => [this.rootRef.el && this.rootRef.el.querySelectorAll('.fc-content-skeleton td.fc-week-number')]);
|
||||
},
|
||||
() => [
|
||||
this.rootRef.el &&
|
||||
this.rootRef.el.querySelectorAll(".fc-content-skeleton td.fc-week-number"),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
get options() {
|
||||
return Object.assign(super.options, {
|
||||
weekNumbers: true,
|
||||
weekNumbersWithinDays: false,
|
||||
weekLabel: _t('Week'),
|
||||
weekLabel: _t("Week"),
|
||||
});
|
||||
}
|
||||
|
||||
/** @override **/
|
||||
async onDateClick(info) {
|
||||
const is_mandatory_day = [...info.dayEl.classList].some(elClass => elClass.startsWith('hr_mandatory_day_'))
|
||||
const is_mandatory_day = [...info.dayEl.classList].some((elClass) =>
|
||||
elClass.startsWith("hr_mandatory_day_")
|
||||
);
|
||||
this.mandatoryDayPopover.close();
|
||||
if (is_mandatory_day && !this.env.isSmall) {
|
||||
this.popover.close();
|
||||
const date = luxon.DateTime.fromISO(info.dateStr);
|
||||
const target = info.dayEl;
|
||||
const mandatory_days_data = await this.orm.call("hr.employee", "get_mandatory_days_data", [date, date]);
|
||||
mandatory_days_data.forEach(mandatory_day_data => {
|
||||
mandatory_day_data['start'] = luxon.DateTime.fromISO(mandatory_day_data['start'])
|
||||
mandatory_day_data['end'] = luxon.DateTime.fromISO(mandatory_day_data['end'])
|
||||
const mandatory_days_data = await this.orm.call(
|
||||
"hr.employee",
|
||||
"get_mandatory_days_data",
|
||||
[date, date]
|
||||
);
|
||||
mandatory_days_data.forEach((mandatory_day_data) => {
|
||||
mandatory_day_data["start"] = luxon.DateTime.fromISO(mandatory_day_data["start"]);
|
||||
mandatory_day_data["end"] = luxon.DateTime.fromISO(mandatory_day_data["end"]);
|
||||
});
|
||||
const records = Object.values(this.props.model.records).filter((r) =>
|
||||
luxon.Interval.fromDateTimes(r.start.startOf("day"), r.end.endOf("day")).contains(date)
|
||||
luxon.Interval.fromDateTimes(r.start.startOf("day"), r.end.endOf("day")).contains(
|
||||
date
|
||||
)
|
||||
);
|
||||
const props = this.getPopoverProps(date, records)
|
||||
props['records'] = mandatory_days_data.concat(props['records'])
|
||||
const props = this.getPopoverProps(date, records);
|
||||
props["records"] = mandatory_days_data.concat(props["records"]);
|
||||
this.mandatoryDayPopover.open(target, props, "o_cw_popover");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
super.onDateClick(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { usePopover } from "@web/core/popover/popover_hook";
|
||||
import { onEmployeeSubRedirect } from './hooks';
|
||||
|
||||
const { Component, onWillStart, onWillRender, useState } = owl;
|
||||
import { Component, onWillStart, onWillRender, useState } from "@odoo/owl";
|
||||
|
||||
class HrOrgChartPopover extends Component {
|
||||
async setup() {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_service/tour_utils";
|
||||
|
||||
const { markup } = owl;
|
||||
import { markup } from "@odoo/owl";
|
||||
|
||||
registry.category("web_tour.tours").add('hr_recruitment_tour',{
|
||||
url: "/web",
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class IAPActionButtonsWidget extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -3,8 +3,7 @@ import { Dialog } from "@web/core/dialog/dialog";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
|
||||
const { Component, onWillStart } = owl;
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
|
||||
class InsufficientCreditDialog extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ColorsResetButton extends Component {
|
||||
onColorsResetButtonClick() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { listView } from "@web/views/list/list_view";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, onWillStart } = owl;
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class LoyaltyActionHelper extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
import { Many2XAutocomplete } from "@web/views/fields/relational_utils";
|
||||
|
||||
const { Component, useState, onWillStart, markup, xml } = owl;
|
||||
import { Component, useState, onWillStart, markup, xml } from "@odoo/owl";
|
||||
|
||||
export class LunchCurrency extends Component {
|
||||
get amount() {
|
||||
|
||||
@@ -4,9 +4,7 @@ import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
import { Domain } from '@web/core/domain';
|
||||
import { SearchModel } from '@web/search/search_model';
|
||||
|
||||
const { useState, onWillStart } = owl;
|
||||
|
||||
import { useState, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class LunchSearchModel extends SearchModel {
|
||||
setup() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* @odoo-module */
|
||||
|
||||
import { useSequential } from "@mail/utils/common/hooks";
|
||||
import { useComponent, useEffect, useState } from "@odoo/owl";
|
||||
import { status, useComponent, useEffect, useState } from "@odoo/owl";
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
@@ -171,7 +171,7 @@ export function useSuggestion() {
|
||||
await suggestionService.fetchSuggestions(self.search, {
|
||||
thread: self.thread,
|
||||
});
|
||||
if (owl.status(comp) === "destroyed") {
|
||||
if (status(comp) === "destroyed") {
|
||||
return;
|
||||
}
|
||||
self.update();
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
/* @odoo-module */
|
||||
import { Component, useState, onMounted, onWillUnmount, useEffect, useRef } from "@odoo/owl";
|
||||
import {
|
||||
Component,
|
||||
useState,
|
||||
onMounted,
|
||||
onWillUnmount,
|
||||
useEffect,
|
||||
useRef,
|
||||
status,
|
||||
} from "@odoo/owl";
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { url } from "@web/core/utils/urls";
|
||||
@@ -282,7 +290,7 @@ export class VoicePlayer extends Component {
|
||||
}
|
||||
|
||||
addOnAudioProcess() {
|
||||
if (owl.status(this) === "destroyed") {
|
||||
if (status(this) === "destroyed") {
|
||||
return;
|
||||
}
|
||||
const time = this.getCurrentTime();
|
||||
|
||||
@@ -5,8 +5,7 @@ import { useDebounced } from "@web/core/utils/timing";
|
||||
import { charField, CharField } from "@web/views/fields/char/char_field";
|
||||
import { textField, TextField } from "@web/views/fields/text/text_field";
|
||||
import { archParseBoolean } from "@web/views/utils";
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Support a key-based onchange in text fields.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
import { MEDIAS_BREAKPOINTS, SIZES, utils } from "@web/core/ui/ui_service";
|
||||
import { patchWithCleanup } from "@web/../tests/helpers/utils";
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Return the width corresponding to the given size. If an upper and lower bound
|
||||
@@ -45,7 +46,7 @@ function getSizeFromWidth(width) {
|
||||
* @param {number} width
|
||||
*/
|
||||
function legacyPatchUiSize(height, width) {
|
||||
const legacyEnv = owl.Component.env;
|
||||
const legacyEnv = Component.env;
|
||||
patchWithCleanup(legacyEnv, {
|
||||
browser: {
|
||||
...legacyEnv.browser,
|
||||
|
||||
@@ -6,8 +6,7 @@ import { registry } from '@web/core/registry';
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { Many2OneField, many2OneField } from '@web/views/fields/many2one/many2one_field';
|
||||
|
||||
const { useState, useEffect } = owl;
|
||||
import { useState, useEffect } from "@odoo/owl";
|
||||
|
||||
export class MailingFilterDropdown extends Dropdown {
|
||||
setup() {
|
||||
|
||||
@@ -3,12 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { formView } from "@web/views/form/form_view";
|
||||
import { useThrottleForAnimation } from "@web/core/utils/timing";
|
||||
|
||||
const {
|
||||
useSubEnv,
|
||||
onMounted,
|
||||
onWillUnmount,
|
||||
} = owl;
|
||||
import { useSubEnv, onMounted, onWillUnmount } from "@odoo/owl";
|
||||
|
||||
export class MassMailingFullWidthViewController extends formView.Controller {
|
||||
setup() {
|
||||
|
||||
@@ -14,8 +14,7 @@ import { MassMailingMobilePreviewDialog } from "./mass_mailing_mobile_preview";
|
||||
import { getRangePosition } from '@web_editor/js/editor/odoo-editor/src/utils/utils';
|
||||
import { MassMailingWysiwyg } from '@mass_mailing/js/mass_mailing_wysiwyg';
|
||||
import { utils as uiUtils } from "@web/core/ui/ui_service";
|
||||
|
||||
const { useSubEnv, status } = owl;
|
||||
import { useSubEnv, status } from "@odoo/owl";
|
||||
|
||||
export class MassMailingHtmlField extends HtmlField {
|
||||
static props = {
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
import { Dialog } from "@web/core/dialog/dialog";
|
||||
import { getBundle } from "@web/core/assets";
|
||||
|
||||
const { useEffect, onWillStart } = owl;
|
||||
|
||||
import { useEffect, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class MassMailingMobilePreviewDialog extends Dialog {
|
||||
setup() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { BomOverviewControlPanel } from "../bom_overview_control_panel/mrp_bom_overview_control_panel";
|
||||
import { BomOverviewTable } from "../bom_overview_table/mrp_bom_overview_table";
|
||||
|
||||
const { Component, EventBus, onWillStart, useSubEnv, useState } = owl;
|
||||
import { Component, EventBus, onWillStart, useSubEnv, useState } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewComponent extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@
|
||||
import { useBus } from "@web/core/utils/hooks";
|
||||
import { BomOverviewLine } from "../bom_overview_line/mrp_bom_overview_line";
|
||||
import { BomOverviewExtraBlock } from "../bom_overview_extra_block/mrp_bom_overview_extra_block";
|
||||
|
||||
const { Component, onWillUnmount, onWillUpdateProps, useState } = owl;
|
||||
import { Component, onWillUnmount, onWillUpdateProps, useState } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewComponentsBlock extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -5,8 +5,7 @@ import { BomOverviewDisplayFilter } from "../bom_overview_display_filter/mrp_bom
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
import { Many2XAutocomplete } from "@web/views/fields/relational_utils";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewControlPanel extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewDisplayFilter extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@
|
||||
import { useBus } from "@web/core/utils/hooks";
|
||||
import { BomOverviewLine } from "../bom_overview_line/mrp_bom_overview_line";
|
||||
import { BomOverviewSpecialLine } from "../bom_overview_special_line/mrp_bom_overview_special_line";
|
||||
|
||||
const { Component, onWillUnmount, onWillUpdateProps, useState } = owl;
|
||||
import { Component, onWillUnmount, onWillUpdateProps, useState } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewExtraBlock extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import { _t } from "@web/core/l10n/translation";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { formatFloatTime, formatMonetary } from "@web/views/fields/formatters";
|
||||
import { formatFloat } from "@web/core/utils/numbers";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewLine extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
|
||||
import { formatFloatTime, formatMonetary } from "@web/views/fields/formatters";
|
||||
import { formatFloat } from "@web/core/utils/numbers";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewSpecialLine extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -5,8 +5,7 @@ import { formatFloat } from "@web/core/utils/numbers";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { BomOverviewLine } from "../bom_overview_line/mrp_bom_overview_line";
|
||||
import { BomOverviewComponentsBlock } from "../bom_overview_components_block/mrp_bom_overview_components_block";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class BomOverviewTable extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
import { ForecastedButtons } from "@stock/stock_forecasted/forecasted_buttons";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
const { onWillStart } = owl;
|
||||
import { onWillStart } from "@odoo/owl";
|
||||
|
||||
patch(ForecastedButtons.prototype, {
|
||||
setup() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import { _t } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { CharField, charField } from "@web/views/fields/char/char_field";
|
||||
|
||||
const { useState } = owl;
|
||||
import { useState } from "@odoo/owl";
|
||||
|
||||
export function getGoogleSlideUrl(value, page) {
|
||||
let url = false;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { KanbanController } from "@web/views/kanban/kanban_controller";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useRef } = owl;
|
||||
import { useRef } from "@odoo/owl";
|
||||
|
||||
export class MrpDocumentsKanbanController extends KanbanController {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { FloatField, floatField } from '@web/views/fields/float/float_field';
|
||||
|
||||
const { useRef, useEffect } = owl;
|
||||
import { useRef, useEffect } from "@odoo/owl";
|
||||
|
||||
export class MrpConsumed extends FloatField {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
import { FloatField, floatField } from "@web/views/fields/float/float_field";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { formatFloat } from "@web/core/utils/numbers";;
|
||||
import { formatFloat } from "@web/core/utils/numbers";
|
||||
import { useRef, onPatched, onMounted, useState } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* This widget is used to display alongside the total quantity to consume of a production order,
|
||||
@@ -12,7 +13,6 @@ import { formatFloat } from "@web/core/utils/numbers";;
|
||||
* The widget will be '3.000 / 5.000'.
|
||||
*/
|
||||
|
||||
const { useRef, onPatched, onMounted, useState } = owl;
|
||||
export class MrpShouldConsumeOwl extends FloatField {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
@@ -5,8 +5,7 @@ import { useService } from "@web/core/utils/hooks";
|
||||
import { parseFloatTime } from "@web/views/fields/parsers";
|
||||
import { useInputField } from "@web/views/fields/input_field_hook";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
|
||||
const { Component, useState, onWillUpdateProps, onWillStart, onWillDestroy } = owl;
|
||||
import { Component, useState, onWillUpdateProps, onWillStart, onWillDestroy } from "@odoo/owl";
|
||||
|
||||
function formatMinutes(value) {
|
||||
if (value === false) {
|
||||
|
||||
@@ -5,8 +5,7 @@ import { ActionContainer } from '@web/webclient/actions/action_container';
|
||||
import { MainComponentsContainer } from "@web/core/main_components_container";
|
||||
import { useOwnDebugContext } from "@web/core/debug/debug_context";
|
||||
import { session } from '@web/session';
|
||||
|
||||
const { Component, useEffect, useExternalListener } = owl;
|
||||
import { Component, useEffect, useExternalListener } from "@odoo/owl";
|
||||
|
||||
export class SubcontractingPortalWebClient extends Component {
|
||||
setup() {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
|
||||
import { Component, useRef, useState, useSubEnv } from "@odoo/owl";
|
||||
import { Component, onMounted, useRef, useState, useSubEnv } from "@odoo/owl";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
export class BaseProductAttribute extends Component {
|
||||
@@ -46,7 +46,7 @@ export class RadioProductAttribute extends BaseProductAttribute {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.root = useRef("root");
|
||||
owl.onMounted(this.onMounted);
|
||||
onMounted(this.onMounted);
|
||||
}
|
||||
onMounted() {
|
||||
// With radio buttons `t-model` selects the default input by searching for inputs with
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
|
||||
import { KanbanController } from "@web/views/kanban/kanban_controller";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useRef } = owl;
|
||||
import { useRef } from "@odoo/owl";
|
||||
|
||||
export class ProductDocumentKanbanController extends KanbanController {
|
||||
setup() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import { _t } from "@web/core/l10n/translation";
|
||||
import { Dialog } from '@web/core/dialog/dialog';
|
||||
import { formatMonetary } from "@web/views/fields/formatters";
|
||||
import { useHotkey } from "@web/core/hotkeys/hotkey_hook";
|
||||
const { Component, onMounted, markup, useRef } = owl;
|
||||
|
||||
import { Component, onMounted, markup, useRef } from "@odoo/owl";
|
||||
|
||||
export class ProductMatrixDialog extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { ControlPanel } from "@web/search/control_panel/control_panel";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { onWillStart } = owl;
|
||||
import { onWillStart } from "@odoo/owl";
|
||||
|
||||
export class ProjectControlPanel extends ControlPanel {
|
||||
setup() {
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@ import { formatDate } from "@web/core/l10n/dates";
|
||||
import { useService } from '@web/core/utils/hooks';
|
||||
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { Component, useState, onWillUpdateProps, status } from "@odoo/owl";
|
||||
|
||||
const { Component, useState, onWillUpdateProps, status } = owl;
|
||||
const { DateTime } = luxon;
|
||||
|
||||
export class ProjectMilestone extends Component {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ProjectProfitability extends Component {
|
||||
get revenues() {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ProjectRightSidePanelSection extends Component { }
|
||||
|
||||
|
||||
+1
-2
@@ -10,8 +10,7 @@ import { ProjectRightSidePanelSection } from './components/project_right_side_pa
|
||||
import { ProjectMilestone } from './components/project_milestone';
|
||||
import { ProjectProfitability } from './components/project_profitability';
|
||||
import { getCurrency } from '@web/core/currency';
|
||||
|
||||
const { Component, onWillStart, useState } = owl;
|
||||
import { Component, onWillStart, useState } from "@odoo/owl";
|
||||
|
||||
export class ProjectRightSidePanel extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -9,8 +9,7 @@ import { useCommand } from "@web/core/commands/command_hook";
|
||||
import { formatSelection } from "@web/views/fields/formatters";
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { useState } = owl;
|
||||
import { useState } from "@odoo/owl";
|
||||
|
||||
export class ProjectTaskStateSelection extends StateSelectionField {
|
||||
setup() {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ChatterAttachmentsViewer extends Component {}
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@ import { ChatterComposer } from "./chatter_composer";
|
||||
import { ChatterMessageCounter } from "./chatter_message_counter";
|
||||
import { ChatterMessages } from "./chatter_messages";
|
||||
import { ChatterPager } from "./chatter_pager";
|
||||
|
||||
const { Component, markup, onWillStart, useState, onWillUpdateProps } = owl;
|
||||
import { Component, markup, onWillStart, useState, onWillUpdateProps } from "@odoo/owl";
|
||||
|
||||
export class ChatterContainer extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ChatterMessageCounter extends Component { }
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
import { ChatterAttachmentsViewer } from "./chatter_attachments_viewer";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ChatterMessages extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
|
||||
const { Component, useState, onWillUpdateProps } = owl;
|
||||
import { Component, useState, onWillUpdateProps } from "@odoo/owl";
|
||||
|
||||
export class ChatterPager extends Component {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { PortalFileInput } from '../portal_file_input/portal_file_input';
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class PortalAttachDocument extends Component {}
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@ import { ActionContainer } from '@web/webclient/actions/action_container';
|
||||
import { MainComponentsContainer } from "@web/core/main_components_container";
|
||||
import { useOwnDebugContext } from "@web/core/debug/debug_context";
|
||||
import { session } from '@web/session';
|
||||
|
||||
const { Component, useEffect, useExternalListener, useState } = owl;
|
||||
import { Component, useEffect, useExternalListener, useState } from "@odoo/owl";
|
||||
|
||||
export class ProjectSharingWebClient extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { evaluateBooleanExpr } from "@web/core/py_js/py";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
|
||||
const { onWillUpdateProps } = owl;
|
||||
import { onWillUpdateProps } from "@odoo/owl";
|
||||
|
||||
export class ProjectSharingListRenderer extends ListRenderer {
|
||||
setup() {
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
|
||||
import { useService } from '@web/core/utils/hooks';
|
||||
import { FormRenderer } from '@web/views/form/form_renderer';
|
||||
|
||||
const { useRef, useEffect } = owl;
|
||||
import { useRef, useEffect } from "@odoo/owl";
|
||||
|
||||
export class FormRendererWithHtmlExpander extends FormRenderer {
|
||||
setup() {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { renderToMarkup } from '@web/core/utils/render';
|
||||
import { markup } from "@odoo/owl";
|
||||
|
||||
const { markup } = owl;
|
||||
const greenBullet = markup(`<span class="o_status d-inline-block o_status_green"></span>`);
|
||||
const orangeBullet = markup(`<span class="o_status d-inline-block text-warning"></span>`);
|
||||
const star = markup(`<a style="color: gold;" class="fa fa-star"></a>`);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module */
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class ButtonWithNotification extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module */
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, onWillStart } = owl;
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class PurchaseDashBoard extends Component {
|
||||
setup() {
|
||||
@@ -9,10 +8,7 @@ export class PurchaseDashBoard extends Component {
|
||||
this.action = useService("action");
|
||||
|
||||
onWillStart(async () => {
|
||||
this.purchaseData = await this.orm.call(
|
||||
"purchase.order",
|
||||
"retrieve_dashboard",
|
||||
);
|
||||
this.purchaseData = await this.orm.call("purchase.order", "retrieve_dashboard");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,14 +17,16 @@ export class PurchaseDashBoard extends Component {
|
||||
* the filters found in `filter_name` attibute from button pressed
|
||||
*/
|
||||
setSearchContext(ev) {
|
||||
let filter_name = ev.currentTarget.getAttribute("filter_name");
|
||||
let filters = filter_name.split(',');
|
||||
let searchItems = this.env.searchModel.getSearchItems((item) => filters.includes(item.name));
|
||||
const filter_name = ev.currentTarget.getAttribute("filter_name");
|
||||
const filters = filter_name.split(",");
|
||||
const searchItems = this.env.searchModel.getSearchItems((item) =>
|
||||
filters.includes(item.name)
|
||||
);
|
||||
this.env.searchModel.query = [];
|
||||
for (const item of searchItems){
|
||||
for (const item of searchItems) {
|
||||
this.env.searchModel.toggleSearchItem(item.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PurchaseDashBoard.template = 'purchase.PurchaseDashboard'
|
||||
PurchaseDashBoard.template = "purchase.PurchaseDashboard";
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
|
||||
const { onWillStart, useState, useSubEnv } = owl;
|
||||
import { onWillStart, useState, useSubEnv } from "@odoo/owl";
|
||||
|
||||
export class PurchaseOrderLineCompareListRenderer extends ListRenderer {
|
||||
setup() {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
export class SectionListRenderer extends ListRenderer {
|
||||
setup() {
|
||||
|
||||
@@ -6,8 +6,7 @@ import {
|
||||
KanbanProgressBarField,
|
||||
kanbanProgressBarField,
|
||||
} from "@web/views/fields/progress_bar/kanban_progress_bar_field";
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* A custom Component for the view of sales teams on the kanban view in the CRM app.
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_service/tour_utils";
|
||||
|
||||
const { markup } = owl;
|
||||
import { markup } from "@odoo/owl";
|
||||
|
||||
registry.category("web_tour.tours").add("sale_tour", {
|
||||
url: "/web",
|
||||
|
||||
@@ -5,8 +5,7 @@ import { localization } from "@web/core/l10n/localization";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { usePopover } from "@web/core/popover/popover_hook";
|
||||
|
||||
const { Component, onWillRender } = owl;
|
||||
import { Component, onWillRender } from "@odoo/owl";
|
||||
|
||||
export class QtyAtDatePopover extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class SendSMSButton extends Component {
|
||||
setup() {
|
||||
@@ -16,25 +15,28 @@ export class SendSMSButton extends Component {
|
||||
}
|
||||
async onClick() {
|
||||
await this.props.record.save();
|
||||
this.action.doAction({
|
||||
type: "ir.actions.act_window",
|
||||
target: "new",
|
||||
name: this.title,
|
||||
res_model: "sms.composer",
|
||||
views: [[false, "form"]],
|
||||
context: {
|
||||
...this.user.context,
|
||||
default_res_model: this.props.record.resModel,
|
||||
default_res_id: this.props.record.resId,
|
||||
default_number_field_name: this.props.name,
|
||||
default_composition_mode: 'comment',
|
||||
}
|
||||
}, {
|
||||
onClose: () => {
|
||||
this.props.record.load();
|
||||
this.action.doAction(
|
||||
{
|
||||
type: "ir.actions.act_window",
|
||||
target: "new",
|
||||
name: this.title,
|
||||
res_model: "sms.composer",
|
||||
views: [[false, "form"]],
|
||||
context: {
|
||||
...this.user.context,
|
||||
default_res_model: this.props.record.resModel,
|
||||
default_res_id: this.props.record.resId,
|
||||
default_number_field_name: this.props.name,
|
||||
default_composition_mode: "comment",
|
||||
},
|
||||
},
|
||||
});
|
||||
{
|
||||
onClose: () => {
|
||||
this.props.record.load();
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
SendSMSButton.template = "sms.SendSMSButton";
|
||||
SendSMSButton.props = ["*"];
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { formatFloat } from "@web/core/utils/numbers";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ReceptionReportLine extends Component {
|
||||
setup() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user