Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
4 Vastaukset
4890 Näkymät

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
Hylkää

Hi shringar,

Please mention the errors you are facing.

Tekijä

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.

Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
toukok. 24
7142
1
heinäk. 23
2294
3
kesäk. 23
3182
3
huhtik. 22
5467
2
toukok. 21
3785