简体   繁体   中英

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:

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).

However, when the check_out event is reported, Odoo is returning:

[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.

Any ideas what I am missing here?

check_in and check_out should be on the same record. First, you are creating a check_in record, and then you are probably trying to create a second record for check_out . Instead, you should try to find the last open record and update the check_out .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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