Odoo Help


How to count Number of days particular employee present in the office from hr.attendance in openerp

on 4/3/14, 5:01 AM 919 views

from osv import fields,osv

add fields res_partner model

class esteem_payslip(osv.osv):
_inherit = 'hr.payslip'

def prasent_days(self, cr, uid, fields, args, employee_id, context=None):
    obj= self.pool.get("hr.attendance").browse(cr,uid,employee_id)  
    test = self.browse(cr, uid, id, context=None)
    temp = 0      
    for slip in obj:
        temp = temp + 1.0
    return res

_columns = {
       'es_present':fields.function(prasent_days,  relation="hr.attendance", String= "No.of Present Days"),           


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 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

0 follower(s)


Asked: 4/3/14, 5:01 AM
Seen: 919 times
Last updated: 3/16/15, 8:10 AM