Odoo Help

Welcome!

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.

0

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

By
praveen
on 4/3/14, 5:01 AM 788 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):
    res={}
    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
    res[id]=temp 
    return res

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

esteem_payslip()

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

0 follower(s)

Stats

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