简体   繁体   English

Odoo 不喜欢我向 hr.attendance 报告的时间

[英]Odoo doesn't like the times I report to hr.attendance

I am reporting check_in and check_out events to the hr.attendance model via xmlrpc, and I think I am reporting correct times, for example:我正在通过 xmlrpc 向 hr.attendance 模型报告 check_in 和 check_out 事件,并且我认为我正在报告正确的时间,例如:

ID: 75 Scan Type: check_in   Scan Time: 2022-06-22 14:14:57
ID: 75 Scan Type: check_out  Scan Time: 2022-06-22 22:55:12

Those times are in UTC, and when I look at the first attendance record (which gets accepted), it shows the correct local time (which in my case is 7:14am).这些时间是 UTC,当我查看第一个出勤记录(被接受)时,它显示了正确的本地时间(在我的例子中是上午 7:14)。

However, when the check_out event is reported, Odoo is returning:然而,当 check_out 事件被报告时,Odoo 正在返回:

[faultCode] => 2
[faultString] => "Check Out" time cannot be earlier than "Check In" time.

It's definitely around ~8 hours later, from 14:14:57 to 22:55:12.肯定是大约 8 小时后,从 14:14:57 到 22:55:12。

Any ideas what I am missing here?有什么想法我在这里想念的吗?

check_in and check_out should be on the same record. check_incheck_out应该在同一记录中。 First, you are creating a check_in record, and then you are probably trying to create a second record for check_out .首先,您正在创建一个check_in记录,然后您可能正在尝试为check_out创建第二条记录。 Instead, you should try to find the last open record and update the check_out .相反,您应该尝试查找最后打开的记录并更新check_out

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM