Initial commit: Hr packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 62531cd146
2820 changed files with 1432848 additions and 0 deletions

View file

@ -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);

View file

@ -0,0 +1,7 @@
.o_field_applicant_char {
color: $link-color;
&:hover {
color: $link-hover-color;
}
}

View file

@ -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>