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

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.

Ảnh đại diện
Huỷ bỏ

Hi shringar,

Please mention the errors you are facing.

Tác giả

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.

Câu trả lời hay nhất

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

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

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'

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 5 24
7213
1
thg 7 23
2314
3
thg 6 23
3236
3
thg 4 22
5539
2
thg 5 21
3834