Python Forum

Full Version: Issue with code for auto checkout
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have code for auto checkout in Odoo server:

model.cron_set_attedance_checkout()
class hr_attendace(models.Model):

    _inherit = 'hr.attendance'

    @api.model

    def cron_set_attedance_checkout(self):
         records = self.search([('check_out', '=', False), ('check_in', '!=', False)]):

         for record in records:

            record.check_out = record.check_in
I received an error:
SyntaxError : invalid syntax at line 9
records = self.search([('check_out', '=', False), ('check_in', '!=', False)]):
Huh

Please help!

Thank you!
can you post the full traceback verbatim, in error tags
and your code has incorrect indentation (different levels with 3, 4, and 5 spaces)
Also check the line before that one - the problem might be there, e.g. missing colon)
(Oct-31-2019, 08:55 AM)buran Wrote: [ -> ]can you post the full traceback verbatim, in error tags
and your code has incorrect indentation (different levels with 3, 4, and 5 spaces)
Also check the line before that one - the problem might be there, e.g. missing colon)

I'm setting an auto checkout in Attendance module of Odoo:
[Image: DSp6yR.png]

And I receied this error:
[Image: ONvDB7.png]

I tried to fix the incorrect indentation. But still got the above Error.