تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
4922 أدوات العرض

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
مايو 24
7169
1
يوليو 23
2306
3
يونيو 23
3202
3
أبريل 22
5496
2
مايو 21
3803