Odoo Help


How to run sigout forgotten Module (hr_sign_out_forgotten) in odoo 8

on 2/17/15, 8:10 AM 736 views

How to run this code?

.py file===============================

from openerp.osv import fields, osv

class hr_attendance(osv.osv):
    _name = "hr.attendance"
    _description = "Attendance"
    _inherit = "hr.attendance"

    def hr_sign_out_forgotten_solve(self, cr, uid, context = None):
        print "ets%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5"
            SELECT hra1.employee_id
            FROM hr_attendance AS hra1
                INNER JOIN (SELECT employee_id as e_id,
                                MAX(name) as last_sign
                            FROM hr_attendance
                            GROUP BY employee_id) AS hra2
                    ON hra1.employee_id=hra2.e_id
                        AND hra1.name=hra2.last_sign
            WHERE hra1.action = 'sign_in'
        for e_id in [x for (x,) in cr.fetchall()]:
            self.create(cr, uid, {'employee_id': e_id,
                                  'action': 'sign_out',})


<?xml version="1.0" encoding="UTF-8"?>
    <data >
        <record id="ir_cron_hr_sign_out_forgotten" model="ir.cron">
            <field name="name">HR sign Out Forgotten</field>
            <field name="interval_number">24</field>
            <field name="interval_type">hours</field>
            <field name="numbercall">-1</field>
            <field eval="False" name="doall"/>
            <field name="nextcall">2015-02-17 05:31:00</field>
            <field eval="'hr.attendance'" name="model"/>
            <field eval="'hr_sign_out_forgotten_solve'" name="function"/>
            <field eval="'()'" name="args"/>


    'name': 'Attendance, sign out forgotten',
    'version': '1.1',
    'category': 'Generic Modules/Human Resources',
    'description': """
    This module creates sign out for the employees than
     they forgotten his own sign out.
    'author': 'Author',
    'depends': ['hr_attendance'],
    'update_xml': [
    'demo_xml': [],
    'test': [],
    'installable': True,
    'active': False,



import hr_attendance

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/17/15, 8:10 AM
Seen: 736 times
Last updated: 3/16/15, 8:10 AM