diff --git a/scripts/odoo15_gio_payroll_custom_employee_patch b/scripts/odoo15_gio_payroll_custom_employee_patch new file mode 100755 index 00000000..4a9fc560 --- /dev/null +++ b/scripts/odoo15_gio_payroll_custom_employee_patch @@ -0,0 +1,40 @@ +#!/bin/bash + +# Get script name +SCRIPT=$(basename "$0") + +# First param is docker container +CONTAINER=$1 + +# Default configuration +PACKAGE_PATH="/mnt/addons/" + +# Custom configuration +FILE_PATH="${PACKAGE_PATH}gio_payroll_custom/models/hr_employee.py" +FIND="from odoo import api, fields, models, _" +IFS='' read -r -d '' APPEND << EOM + + +class EmployeePublic(models.Model): + _inherit = 'hr.employee.public' + + gio_children_training = fields.Integer(string="Anzahl Kinder im Studium") +EOM + +# Get filename +FILE=`basename "$FILE_PATH"` + +# Copy from docker +docker cp "$CONTAINER":"$FILE_PATH" . + +LINE=$(grep -n "$FIND" $FILE | cut -f1 -d:) + +# Find and append +awk -v n="$LINE" -v s="$APPEND" 'NR-1 == n {print s} {print}' $FILE > $FILE.tmp && mv $FILE.tmp $FILE + +# Copy back to docker +docker cp $FILE "$CONTAINER":"$FILE_PATH" + +# Register patch installation +echo "Patch $SCRIPT applied." +touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed" diff --git a/snippets/hr_attendance.view_attendance_tree.enable_edit.xml b/snippets/hr_attendance.view_attendance_tree.enable_edit.xml new file mode 100644 index 00000000..f45e5158 --- /dev/null +++ b/snippets/hr_attendance.view_attendance_tree.enable_edit.xml @@ -0,0 +1,8 @@ + + + + + 1 + + +