Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4 Replies
5036 Tampilan

I am trying to customise python code in professional tax so that it will be able to calculate tax based on employees salary and gender. I am new to odoo and facing issues in linking various fields of various models.

Avatar
Buang

Hi shringar,

Please mention the errors you are facing.

Penulis

I tried using delegation inheritance and also inheriting models directly. When i am using two models in a list using like _inherit = ['hr.payroll' , 'hr.contract'] , the error is that the class does not exist. and _inherit ='hr.payroll' _inherits = {'hr.contract' : 'wage'} , the error is ALTER TABLE "hr_salary_rule" ALTER COLUMN "wage" SET NOT NULL'

Please explain your business case, provide your code and the traceback.

Jawaban Terbai

Hi just try this on python code section under salary rule definition 

if contract.employee_id.gender = "Male":
result = your logic
else contract.employee_id.gender = "Female"
result = your logic

Avatar
Buang
Jawaban Terbai

I tried using delegation inheritance and also inheriting models directly. When i am using two models in a list using like _inherit = ['hr.payroll' , 'hr.contract'] , the error is that the class does not exist. and _inherit ='hr.payroll' _inherits = {'hr.contract' : 'wage'} , the error is ALTER TABLE "hr_salary_rule" ALTER COLUMN "wage" SET NOT NULL'

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
4
Mei 24
7327
1
Jul 23
2404
3
Jun 23
3294
3
Apr 22
5648
2
Mei 21
3957