[IMP] hr_contract: hr_contract_history_list to owl
taskID 2957257 closes odoo/odoo#98397 Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -36,6 +36,7 @@ You can assign several contracts per employee.
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'hr_contract/static/src/scss/*',
|
||||
'hr_contract/static/src/js/*',
|
||||
],
|
||||
'web.assets_qweb': [
|
||||
'hr_contract/static/src/xml/*',
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import ListController from "web.ListController";
|
||||
import { _lt } from 'web.core';
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { ListController } from "@web/views/list/list_controller";
|
||||
|
||||
export const HrContractHistoryListController = ListController.extend({
|
||||
export class HrContractHistoryListController extends ListController {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.actionService = useService('action');
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
_onCreateRecord(ev) {
|
||||
if (ev) {
|
||||
ev.stopPropagation();
|
||||
}
|
||||
this.do_action({
|
||||
name: _lt('New Employee'),
|
||||
async createRecord({ group } = {}) {
|
||||
this.actionService.doAction({
|
||||
name: this.env._t('New Employee'),
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'hr.employee',
|
||||
views: [[false, 'form']],
|
||||
view_mode: 'form',
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import ListView from "web.ListView";
|
||||
import viewRegistry from 'web.view_registry';
|
||||
import { registry } from "@web/core/registry";
|
||||
import { listView } from "@web/views/list/list_view";
|
||||
import { HrContractHistoryListController } from "./hr_contract_history_list_controller";
|
||||
|
||||
export const HrContractHistoryView = ListView.extend({
|
||||
config: _.extend({}, ListView.prototype.config, {
|
||||
Controller: HrContractHistoryListController,
|
||||
}),
|
||||
});
|
||||
export const HrContractHistoryView = {
|
||||
...listView,
|
||||
Controller: HrContractHistoryListController,
|
||||
}
|
||||
|
||||
viewRegistry.add('hr_contract_history_list', HrContractHistoryView);
|
||||
registry.category("views").add('hr_contract_history_list', HrContractHistoryView);
|
||||
|
||||
Reference in New Issue
Block a user