mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-26 14:32:03 +02:00
Initial commit: Hr packages
This commit is contained in:
commit
62531cd146
2820 changed files with 1432848 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import { CharField } from "@web/views/fields/char/char_field";
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
export class ApplicantCharField extends CharField {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
this.action = useService("action");
|
||||
}
|
||||
|
||||
onClick() {
|
||||
const record = this.props.record.data;
|
||||
if (record.res_id !== undefined && record.res_model == 'hr.applicant') {
|
||||
this.action.doAction({
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'hr.applicant',
|
||||
res_id: record.res_id,
|
||||
views: [[false, "form"]],
|
||||
view_mode: "form",
|
||||
target: "current",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
ApplicantCharField.template = "hr_recruitment.ApplicantCharField";
|
||||
registry.category("fields").add("applicant_char", ApplicantCharField);
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
.o_field_applicant_char {
|
||||
color: $link-color;
|
||||
|
||||
&:hover {
|
||||
color: $link-hover-color;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-name="hr_recruitment.ApplicantCharField" t-inherit="web.CharField" t-inherit-mode="primary" owl="1">
|
||||
<xpath expr="//span[@t-esc='formattedValue']" position="attributes">
|
||||
<attribute name="t-on-click.prevent.stop">onClick</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
Loading…
Add table
Add a link
Reference in a new issue