跳至內容
選單
此問題已被標幟
807 瀏覽次數

I am trying to change the behave of check in/out button in hr_attendance module, the button configured with javascript code:

/** @odoo-module **/


import { Component } from "@odoo/owl";

import { useService } from "@web/core/utils/hooks";

import { useDebounced } from "@web/core/utils/timing";


export class CheckInOut extends Component {

    static template = "hr_attendance.CheckInOut";

    static props = {

        checkedIn: Boolean,

        employeeId: Number,

        nextAction: String,

    };


    setup() {

        this.actionService = useService("action");

        this.orm = useService("orm");

        this.notification = useService("notification");


        this.onClickSignInOut = useDebounced(this.signInOut, 200, { immediate: true });

    }


    async signInOut() {

        navigator.geolocation.getCurrentPosition(

            ({coords: {latitude, longitude}}) => {

                this.orm.call("hr.employee", "update_last_position", [

                    [this.props.employeeId],

                    latitude,

                    longitude

                ])

            },

            err => {

                this.orm.call("hr.employee", "update_last_position", [

                    [this.props.employeeId],

                    false,

                    false

                ])

            })

        const result = await this.orm.call("hr.employee", "attendance_manual", [

            [this.props.employeeId],

            this.props.nextAction,

        ]);

        if (result.action) {

            this.actionService.doAction(result.action);

        } else if (result.warning) {

            this.notification.add(result.warning, {type: "danger"});

        }

    }

}



this code calls attendance_manual method that i want to override and should be in hr.employee model but i can't find its path.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
5月 25
1120
6
1月 23
16982
2
12月 22
4921
0
12月 17
3757
6
6月 17
11025