Salary Rule Python Library
Extend the library python in salary rules such as get_week_of_month, timedelta
Salary Rule Python Library
Extend the library python in salary rules such as get_week_of_month, timedelta
STORY BEHIND THE FEATURES
ODOO BEHAVIOR
CLUEDOO BEHAVIOR
MODULE +
CLUEDOO RECOMMENDATIONS
Install on 100% of the database.
HOW TO USE THIS MODULE?
1Go to Salary Rule Categories > Create a new Salary Rule Categories EX: Fill in 2 fields: - Name: Rule Category Test - Code: Category Test | |
2Go to Salary Structures > Create a new Salary Structure | |
3Go to Salary Rules > Create a new Rule EX: Fill in 3 fields: - Rule Name: Rule 1 - Category: Select the above generated category (Rule Category Test) - Code: Rule 1 - Salary Structure: Select the above generated salary structure (Salary Test) - Active: Make sure the Active checkbox is checked > In the General Tab, Select Amount Type: Python Code > There will be a box to input python code EX: Input: result = datetime.now().isoweekday() This code means that it will return the day of the week based on the current date and time + If today is Monday, result will be 1 + If today is Tuesday, result will be 2 | |
4Go to Payslips to Pay > Create a new Payslip To Pay or Choosing an existing one > Select the Structure field: Salary Test which we have just created > Click on Compute Sheet button > Move to Salary Computation Tab > Can see the result (Because today is Tuesday so the result is 2) | |
5If we change the code to result = datetime.now().isoweekday() + 5 which will returns the current weekday number plus 5 > Today is Tuesday, the second day of the week so the result will be 2 + 5 = 7 |