Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5610 Lượt xem

 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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Can i add a commission without  developing a module ?

And how with odoo 8 native

Thanks in advance

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 21
4610
4
thg 10 19
10445
1
thg 1 18
9888
0
thg 1 17
4861
0
thg 12 16
3458