Odoo Help


This community 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.


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

on 2/17/15, 8:10 AM 492 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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