Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to implement automatically signout in odoo 8 or openerp 7 human resource module , if the PC is idle(or sleep) condition

Subscribe

Get notified when there's activity on this post

This question has been flagged
8 Replies
9912 Views
Avatar
ABU K

Hi all,

I want to implement automatically signout feature from HR module in odoo 8 or openerp 7 version.

Currently the attendance system shows last sign in message and click for signout and sign in alert .But I want to do signout steps automatically ,if the user is in idle(sleep ,based on our PC) condition for a particular time period.How can I achievee this task? 

0
Avatar
Discard
Avatar
Simplify it!
Best Answer

You can install the community addon: Idle Logout

0
Avatar
Discard
ABU K
Author

Hi..Appreciate for your response.But actual requirement is related to HR Employees ,not for users in odoo.. I can easily customize users Logout by http.py file.But my question is related to hr employees sign out if the PC is idle some time...Please replay for this question..

Avatar
Mukundayi Mpapa T.
Best Answer


the same function is available in odoo 8. The only difference is that the http.py file is located at the root of odoo directory and not in addons/web . One more thing. If you server doesnt have a heavy request, it could be better for you to increase the top limit of the random value : for example

if random.random() < 0.1:

This is valid for session timeout from the server and not from HR module

To automaticaly sign out of HR attendance, this is one of the steps you can do:

1. Create a module that depends on hr.attendance

2. inherit the hr.employee class

3. define a function that you can call in an action. this function is in the new hr_employe class you created

4. Inside the function, for each employee (hr.employee) define a routine to check if the session is active for the user (res.user) related to the employee (it can be similar to the function in http.py session_gc(session_store) without the random ). dont forget to import packages like os, sys

5. When the user has no active session, if employee.state=='present', call attendance_action_change(cr, employee.id, [], context=None) . This function is already defined in the hr.employee under hr.attendance module

6. Create an action that you can call, lets say every 5 min. Bind it on the hr.employee object with the function you created on step 3



0
Avatar
Discard
ABU K
Author

Then how to implement this in odoo 8,Can you explain step by step

Mukundayi Mpapa T.

You mean for the HR attendance Signout? If yes then one of the things to to could be 1. Create a module that depends on hr.attendance 2. inherit the hr.employee class 3. define a function that you can call in an action. this function is in the new hr_employe class you created 4. Inside the function, for each employe define a routine to check if the session is active for a user (it can be similar to the function in http.py session_gc(session_store) without the random ) 5. When the session is not active, if employee.state=='present', call attendance_action_change(cr, employee.id, [], context=None) . This function is defined in the hr.employee under hr.attendance module 6. Create an action that you can call, lets say every 5 min. Bind it on the hr.employee object with the function you created on step 3

Avatar
Med Said BARA
Best Answer

Signout or Logout, a little bit confused: login (logon) and logout (logoff) or sign in sign out ...... OpenERP Session or HR Time and Attendance !!! ???

In your question you are talking about 2 different things: OpenERP automatic Logout from session (based on timeout) and  HR Attendance Signout.

For the first case, if you just want to log out user (ending his session): edit the file ../addons/web/http.py at line 450 (last_week = time.time() - 60*60*24*7), and replace 60*60*24*24*7 by the value you want (Idle Time = Timeout - in seconds )  (e.g for 15 minutes = 60*15, for one day = 60*60*24, for 2 days = 60*60*24*2 ...). And restart the server if needed.

For the second case, just post another question, describing what you really want.

And if you want to implement an automatic sign out solution for Time tracking in HR Attendance (an employee forgot to sign out ...)  just take a look to the code in this module (or use it as it is).

Important Remark: When a user is Login out from his session this not mean that he Signed out for the Day in Attendance.

Very complicated solution, you are putting the bar very high !!!

In fact you need a mix of the both cases, maybe this can simply done by executing the hr_sign_out_forgotten_solve when removing session (i mean calling the function hr_sign_out_forgotten_solve ​in the removed_sessions) BUT HOW ???And this implies that the employee is already in Sign in State.

0
Avatar
Discard
ABU K
Author

Yes I need the second case HR Attendance Signout(should automatically signout if the system is idle after some time ,not about session expiring),I dont want to openerp session time out .

Med Said BARA

Very complicated solution, you are putting the bar very high !!!

Med Said BARA

It's a "Google" translation from French "Mettre la barre très haut", which means the question is reaching a High Level of difficulties and need more skills (Nothing bad)

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now