Python Forum
Issue with code for auto checkout
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with code for auto checkout
#1
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!
Reply
#2
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)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Updating Code And Having Issue With Keys Xileron 8 1,088 May-25-2023, 11:14 PM
Last Post: DigiGod
  how to make bot that sends instagram auto password reset code kraixx 2 1,283 Mar-04-2023, 09:59 PM
Last Post: jefsummers
  NameError issue with daughter's newb code MrGonk 2 1,408 Sep-16-2021, 01:29 PM
Last Post: BashBedlam
  Calculator code issue using list kirt6405 4 2,211 Jun-11-2021, 10:13 PM
Last Post: topfox
  code issue sandy 1 1,735 Mar-14-2019, 07:16 PM
Last Post: micseydel
  Visual Studio Code - PEP8 Lambda Issue Qui_Ten 1 2,702 Jan-28-2019, 08:17 AM
Last Post: buran
  Wine / liquor dispenser project code issue onlinegill 0 2,125 Nov-20-2018, 10:41 PM
Last Post: onlinegill
  Issue using cv2.cv in code Huzefa95s 7 6,776 Oct-28-2018, 06:11 AM
Last Post: Huzefa95s
  Issue in my multiprocessing Python code? PrateekG 7 4,169 Jul-19-2018, 06:47 PM
Last Post: gontajones
  Setting up python with visual studio code. Having one issue. xringo 2 3,691 May-21-2018, 12:09 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020