[FIX] hr_attendance: allow kiosk to use My Attendances
The Check In / Check Out menu would show that the user is not linked to an employee because it was trying to read on `hr.employee` and not `hr.employee.public`. opw-3268217 closes odoo/odoo#118498 X-original-commit: 233a185362f2bc3243187f1f0b740ee5b154f039 Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -20,7 +20,7 @@ export class MyAttendances extends Component {
|
||||
|
||||
async onWillStart() {
|
||||
const result = await this.orm.searchRead(
|
||||
"hr.employee",
|
||||
"hr.employee.public",
|
||||
[["user_id", "=", this.user.userId]],
|
||||
["attendance_state", "name", "hours_today"]
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ QUnit.module("Client Actions", (hooks) => {
|
||||
// serverData = getActionManagerServerData();
|
||||
serverData = {
|
||||
models: {
|
||||
"hr.employee": {
|
||||
"hr.employee.public": {
|
||||
fields: {
|
||||
name: { string: "Name", type: "char" },
|
||||
attendance_state: {
|
||||
@@ -114,7 +114,7 @@ QUnit.module("Client Actions", (hooks) => {
|
||||
const mockRPC = async (route, args) => {
|
||||
if (args.method === "attendance_scan" && args.model === "hr.employee") {
|
||||
rpcCount++;
|
||||
return serverData.models["hr.employee"].records.find((r) => r.id === args.args[0]);
|
||||
return serverData.models["hr.employee.public"].records.find((r) => r.id === args.args[0]);
|
||||
}
|
||||
};
|
||||
const webClient = await createWebClient({ serverData, mockRPC });
|
||||
|
||||
Reference in New Issue
Block a user