Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

hr_payroll: salary rule computation BUG ?

By
Med Said BARA
on 11/25/14, 11:09 AM 1,562 views

I've created a salary rule (IRG) depending on another rule (SALIMPARND) as follow:

if SALIMPARND <= 15000:

    resutlt = 0

elif 15000 < SALIMPARND and SALIMPARND <= 22500:

    result = (SALIMPARND - 15000) * 0.2

elif 22500 < SALIMPARND and SALIMPARND <= 28750:

    result = (SALIMPARND - 22500) * 0.12 + 1500

elif 28750 < SALIMPARND and SALIMPARND <= 30000:

    result = (SALIMPARND - 29000) * 0.2 + 2300

elif 30000 < SALIMPARND and SALIMPARND <= 120000:

    result = (SALIMPARND - 30000) * 0.3 + 2500

else:

    result = (SALIMPARND - 120000) * 0.35 + 29500

 

All working fine, and the payslips are calculated accurately, except for the first condition (when SALIMPARND <= 15000) the given result for the rule IRG is equal to 1 instead of 0.

After some search i've found this good description of the BUG (reported on 2012-09-01 thanks to Robajz.info)   (https://bugs.launchpad.net/openobject-addons/+bug/1044611), but infortunately the fix didn't work for me.

Why this old issue is not fixed till today?

Is the error related to the method compute_rule or to safe_eval ?

Any idea on how to fix this issue ?

NB: using OpenERP V7.0, but i think that this issue is reproducible under other Odoo versions.

 

1

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 12/20/14, 6:28 PM

Syntax in resutlt ?

if SALIMPARND <= 15000:

resutlt = 0

replace by

if SALIMPARND <= 15000:

result = 0

0
lyes
On 12/23/14, 6:49 AM

Bonjour 

Comment peut ont mettre 2 bulletin de paie sur une fauille A4 pour 2 employers ,

 

 

 

0

Med Said BARA

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
Med Said BARA
On 12/21/14, 3:45 AM

Thank you  Blue Eyes, that's it !!!

This reveals another BUG: Why no "SyntaxError"  or "TypeError" raised

Thank you zbik.

Yes, issue should be reported.

zbik
on 12/21/14, 3:43 PM

Thank''s zbik

Med Said BARA
on 12/21/14, 5:32 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/25/14, 11:09 AM
Seen: 1562 times
Last updated: 3/16/15, 8:10 AM