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

How can I import python functions inside the salary rule???

By
agpgbmx
on 4/18/13, 5:34 PM 1,522 views

I need to use this code in a HR salary rule but it won't let me use python functions inside the rule:

from datetime import datetime date_format = "%Y/%m/%d" d1 = datetime.strptime(date_from, date_format) d2 = datetime.strptime(date_to, date_format) result = d2 - d1

I get: "Error Wrong python code defined for salary rule"

How can I import python functions inside the salary rule?

I have researched different forums with no success. Thank you for your prompt response.

0

I have the same problem.

Can somebody helps me??

0
Justin Farmer
On 5/16/13, 5:30 PM

Was this ever answered? I'd like to know as well

0
agpgbmx
On 4/19/13, 5:58 PM

My function is:

from datetime import datetime

date_format = "%Y/%m/%d"

d1 = datetime.strptime(date_from, date_format)

d2 = datetime.strptime(date_to, date_format)

result = d2 - d1

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

1 follower(s)

Stats

Asked: 4/18/13, 5:34 PM
Seen: 1522 times
Last updated: 12/1/15, 4:36 AM