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

hi,

i created some salary rule in payroll module no it ruturn error  like "Wrong python code defined" in odoo salary rule

can you please define how we define sequence value in salary rule 

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

Hi,

I think issue is with the way you entered python code for amount calculation in that rule. Sequence is just an integer that determines the position of salary rule appearing in the payslip. So if you enter it as 0, that rule will appear first on payslip salary lines. The error shows wrong python code defined.

check this:


In the above image, the Amount type determine the way to calculate amount for this rule and if python code selected, you need to enter the python expression on Python code field. When you try to create a new rule, it shows the default set of #Available variables. So you need to write the expression based on that. You should write like result = **your python expression here**

For eg:

result = (payslip.company_id.dearness_allowance and - ((contract.wage + DA) * 0.10) or - (contract.wage * 0.10))

Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

in python code is like : result = contract.wage + PB + TBNS + S_BNS + OT_HR when i change the sequence number so it cause error in next salary rule

Tác giả

i refer following linkhttp://bloopark.de/en_US/blog/the-bloopark-times-english-2/post/human-resource-in-odoo-10-part-4-payroll-277

and set sequence as per instruction but what for our custom category in salary rule category

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 19
3814
2
thg 8 17
7492
0
thg 11 16
4804
7
thg 5 20
3811
1
thg 6 18
5475