Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
4868 มุมมอง

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.

อวตาร
ละทิ้ง

Hi shringar,

Please mention the errors you are facing.

ผู้เขียน

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.

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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'

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 24
7137
1
ก.ค. 23
2293
3
มิ.ย. 23
3181
3
เม.ย. 22
5462
2
พ.ค. 21
3781