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.

2

How to create Salary rules?

By
priyankahdp
on 3/15/13, 3:40 AM 3,028 views

How to create q salary rule when worker works in holiday (1st of may,25 december) and we need to pay salary x 1.5?

WE also need to pay bonus when he worked preceding 3months with more than 75% attendance.

Can we create such rules or do we need to write method in Python ?

1
Mario Arias Badila
On 3/16/13, 12:44 PM

You need to go with a new module.

One way to do this is inherit from hr.payslip, and patch the method get_inputs so that you go over employees attendance, check if worked on holidays and his attendance records and create inputs for them.

class hr_payslip(osv.osv):
    '''
    Pay Slip
    '''
    _inherit = 'hr.payslip'

    def get_inputs(self, cr, uid, contract_ids, date_from, date_to, context=None):
        res = super(hr_payslip, self).get_inputs(cr, uid, contract_ids, date_from, date_to, context=context)
        contract_obj = self.pool.get('hr.contract')

        for contract in contract_obj.browse(cr, uid, contract_ids, context=context):

            """
               Your code here to find out if emplooyee has more than 75% attendance.
               Suppose you set a flag called 'good_attendance'
            """
            input = {
                 'name': 'Attendance over 75 percent',
                 'code': 'ATTENDANCE_OVER_75',
                 'contract_id': contract.id,
                 'amount': good_attendance,
            }
            res += [input]

        return res

Then you create a rule that checks for ATTENDANCE_OVER_75 input and adds a bonus if true...

Similar will be for checking if employee worked on holidays...

daily attendace how to entered.?seems no modules to capture employee;'s come or not.!

i got only leave management views

priyankahdp
on 3/18/13, 7:26 AM

Check http://doc.openerp.com/v6.1/book/4/4_11_HR/4_11_HR_timesheet.html It explains time sheets and attendance management

Mario Arias Badila
on 3/18/13, 9:04 PM

Thanks Mario

priyankahdp
on 3/18/13, 11:58 PM

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: 3/15/13, 3:40 AM
Seen: 3028 times
Last updated: 3/16/15, 8:10 AM