admin管理员组文章数量:1279017
I am trying to change the behave of check in/out button in the hr_attendance
module. The button is configured with JavaScript and its path is addons\hr_attendance\static\src\components\check_in_out
. Here is the code:
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 the attendance_manual
method that I want to override and should be in the hr.employee
model, but I can't find the path of this method.
本文标签: javascriptMethod attendancemanual not found in odoo v18Stack Overflow
版权声明:本文标题:javascript - Method attendance_manual not found in odoo v18 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741269845a2369074.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论