chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="l10n_be_hr_payroll.PayRunCard" t-inherit="hr_payroll.PayRunCard" t-inherit-mode="extension">
<t t-set-slot="paid_prio" position="after">
<t t-set-slot="eco_voucher" isVisible="payrun.l10n_be_display_eco_voucher_button">
<ViewButton className="'btn btn-secondary'"
clickParams="{type: 'object', name: 'action_l10n_be_eco_vouchers'}"
record="props.record"
string.translate="Eco-Vouchers"/>
</t>
</t>
</t>
</templates>
@@ -0,0 +1,70 @@
import { Component } from "@odoo/owl";
import { FormViewDialog } from "@web/views/view_dialogs/form_view_dialog";
import { registry } from "@web/core/registry";
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
import { useService } from "@web/core/utils/hooks";
import { _t } from "@web/core/l10n/translation";
export class PayslipsInternalLinkComponent extends Component {
static template = "l10n_be_hr_payroll.PayslipsInternalLinkComponent";
static props = {
...standardWidgetProps,
payslipsYear: { type: String, optional: true },
};
setup() {
super.setup();
this.dialog = useService("dialog");
}
async openNPayslips() {
await this.props.record.save()
this.dialog.add(FormViewDialog, {
resId: this.props.record.resId,
resModel: "hr.payslip.employee.depature.holiday.attests",
size: "lg",
title: _t("Current Year Payslips"),
canExpand: false,
onRecordSaved: async () => {
await this.props.record.load();
},
context: {
...this.props.context,
form_view_ref: "l10n_be_hr_payroll.view_hr_payroll_employee_departure_holiday_attests_n_payslips",
},
});
}
async openN1Payslips() {
await this.props.record.save()
this.dialog.add(FormViewDialog, {
resId: this.props.record.resId,
resModel: "hr.payslip.employee.depature.holiday.attests",
size: "lg",
title: _t("Previous Year Payslips"),
canExpand: false,
onRecordSaved: async () => {
await this.props.record.load();
},
context: {
...this.props.context,
form_view_ref: "l10n_be_hr_payroll.view_hr_payroll_employee_departure_holiday_attests_n1_payslips",
},
});
}
}
export const payslipsInternalLinkComponent = {
component: PayslipsInternalLinkComponent,
extractProps: ({ attrs }) => {
return {
payslipsYear: attrs.payslips_year,
};
},
fieldDependencies: [
{ name: "number_n_payslips_description", type: "char" },
{ name: "number_n1_payslips_description", type: "char" },
],
};
registry.category("view_widgets").add('payslips_internal_link', payslipsInternalLinkComponent);
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<div t-name="l10n_be_hr_payroll.PayslipsInternalLinkComponent">
<t t-if="props?.payslipsYear === 'n'" >
<button class="btn btn-link p-0 pb-1" t-on-click="openNPayslips">
<t t-esc="this.props.record.data.number_n_payslips_description"/>
</button>
</t>
<t t-else="">
<button class="btn btn-link p-0 pb-1" t-on-click="openN1Payslips">
<t t-esc="this.props.record.data.number_n1_payslips_description"/>
</button>
</t>
</div>
</templates>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -0,0 +1,29 @@
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { BinaryField, binaryField } from "@web/views/fields/binary/binary_field";
export class BinaryFieldComission extends BinaryField {
setup() {
super.setup();
this.orm = useService("orm");
this.actionService = useService("action");
}
async update(changes) {
const res = super.update(changes);
if (changes.data) {
await this.props.record.save();
const recordID = this.props.record.resId;
const action = await this.orm.call('hr.payroll.generate.warrant.payslips', 'import_employee_file', [[recordID]]);
await this.actionService.doAction(action);
}
return res;
}
}
export const binaryFieldComission = {
...binaryField,
component: BinaryFieldComission,
};
registry.category("fields").add('binary_commission', binaryFieldComission);
@@ -0,0 +1,44 @@
import { download } from "@web/core/network/download";
import { formView } from "@web/views/form/form_view";
import { FormController } from "@web/views/form/form_controller";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
export class GenerateCommissionPayslipsFormController extends FormController {
setup(){
super.setup();
this.orm = useService("orm");
}
/**
* @override
*/
async beforeExecuteActionButton(clickParams) {
if (clickParams.name === 'export_warrant_payslips') {
if (this.props.saveRecord) {
await this.props.saveRecord(this.model.root, { stayInEdit: true });
} else {
await this.model.root.save({ stayInEdit: true });
}
await this.downloadExportedCSV();
return false;
}
return super.beforeExecuteActionButton(...arguments);
}
async downloadExportedCSV() {
const recordId = this.model.root.resId;
await download({
url: `/export/warrant_payslips/${recordId}`,
data: {}
});
await this.model.root.load();
this.model.notify();
await this.model.root.switchMode("edit");
}
}
registry.category("views").add('generate_warrant_payslips', {
...formView,
Controller: GenerateCommissionPayslipsFormController
})
@@ -0,0 +1,56 @@
import { Component } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
import { registry } from "@web/core/registry";
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
async function _isBelgianCompany({ searchModel, model }) {
if (searchModel.resModel !== "hr.employee" || !model?.root?.resId) {
return false;
}
const currentCompanyId = searchModel.context.allowed_company_ids?.[0];
if (!currentCompanyId) {
return false;
}
const currentCompany = (
await searchModel.orm.read(
"res.company",
[currentCompanyId],
["country_code"]
)
)[0];
return currentCompany?.country_code === "BE";
}
export class WorkingScheduleEmployeeMenu extends Component {
static template = "l10n_be_hr_payroll.WorkingScheduleEmployeeMenu";
static components = { DropdownItem };
static props = {};
setup() {
this.actionService = useService("action");
}
async onClick() {
const resId = this.env.model.root.resId;
await this.actionService.doAction(
"l10n_be_hr_payroll.action_employee_working_schedule_change_request",
{
additionalContext: {
active_id: resId,
active_ids: [resId],
active_model: 'hr.employee',
},
}
);
}
}
registry.category("cogMenu").add(
"working-schedule-employee-cog",
{
Component: WorkingScheduleEmployeeMenu,
groupNumber: 40,
isDisplayed: _isBelgianCompany,
},
{ sequence: 2 }
);
@@ -0,0 +1,7 @@
<templates id="working_schedule_templates" xml:space="preserve">
<t t-name="l10n_be_hr_payroll.WorkingScheduleEmployeeMenu">
<DropdownItem onSelected.bind="onClick">
Working Schedule Change
</DropdownItem>
</t>
</templates>
@@ -0,0 +1,19 @@
.o_dmfa_info {
border: 0px solid black;
width:100%;
tr {
th, td {
padding: 4px;
}
}
}
.o_dmfa_table {
border: 1px solid black;
width:100%;
tr {
th, td {
border: 1px solid black; padding: 4px;
}
}
}