Odoo Help


How to create Salary rules?

on 3/15/13, 3:40 AM 4,041 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 ?

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

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

on 3/18/13, 11:58 PM

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