コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
4924 ビュー

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'

アバター
破棄
関連投稿 返信 ビュー 活動
4
5月 24
7170
1
7月 23
2306
3
6月 23
3203
3
4月 22
5497
2
5月 21
3803