[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:
@@ -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();
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user