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

Employee commission in salary rules

By
mohamed
on 6/17/15, 10:33 AM 551 views

 i want to add commission to an employee (ie: doctors) by efficiency.

such as : 

employee name : Alex     ; job title : Doctors

date_from : 06/01/2015  ; date_to : 06/302015

servies : consultation (from account.invoice) :

consultation number : 100   ; unit price : 100 $

total amount : 10000 $

doctors commission : 1%   100 $  added to allowance

i develop a method but i can't add it to salary rules as python code or use inputs.


def getEarn(self,,doctor_id,date_from,date_to):

total = 0.000

if doctor_id: 

meeting_obj = self.pool.get('meeting')

clause = []

clause_inti = ['&',('date', '<=', date_to),('date','>=', date_from)]

clause_final = [('doctor_id', '=', employee.id),'|','|'] + clause_init

meeting_ids = meeting_obj.search(cr, uid, clause_final, context=context)

total = sum(line.invoice_id.amount_total for line in meeting_ids)

return total


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

2 follower(s)

Stats

Asked: 6/17/15, 10:33 AM
Seen: 551 times
Last updated: 6/17/15, 10:46 AM