Salary Rule Python Library
by CLuedoo https://www.cluedoo.com/shop/lic-clu-set-psl-0006-salary-rule-python-library-6185$ 100.57
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Payroll (hr_payroll)
• Discuss (mail) • Employees (hr) • Employee Contracts (hr_contract) |
| Lines of code | 41 |
| Technical Name |
fal_salary_rule_python_library |
| License | OPL-1 |
| Website | https://www.cluedoo.com/shop/lic-clu-set-psl-0006-salary-rule-python-library-6185 |
| Versions | 18.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Payroll (hr_payroll)
• Discuss (mail) • Employees (hr) • Employee Contracts (hr_contract) |
| Lines of code | 41 |
| Technical Name |
fal_salary_rule_python_library |
| License | OPL-1 |
| Website | https://www.cluedoo.com/shop/lic-clu-set-psl-0006-salary-rule-python-library-6185 |
| Versions | 18.0 |
ODOO'S FUNCTION
Odoo provides a solid foundation for managing employee salaries, including salary rules, structures, and payslip generation. However, Odoo lacks advanced customization options, such as dynamic, code-driven salary calculations or the ability to create highly tailored salary rule categories and structures with Python-based logic
CLUEDOO'S FUNCTION
With Cluedoo, users can create custom salary rule categories , define flexible salary structures , and implement Python code for dynamic computations (e.g., calculating values based on the current weekday). These improvements extend Odoo’s payroll functionality, enabling highly customizable, code-driven salary rules and seamless payslip generation, significantly enhancing flexibility and precision in payroll management.
|
1. Go to Payroll > Salary Rule Categories > Create a new Salary Rule Categories EX: Fill in 2 fields: - Name: Rule Category Test- Code: Category Test |
|
|
2. Go to
Salary Structures
> Create a new Salary Structure
|
|
|
3. Go 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) > 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
|
|
|
4. Go to
Payslips to Pay
> Create a new Payslip To Pay or Choose 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)
|
|
|
5. If we change the code to
result = datetime.now().isoweekday() + 5
which will return
the current weekday number plus 5
> Today is Tuesday, the second day of the week so the result will be 2 + 5 = 7 |
|
STORY BEHIND THE FEATURES
ODOO BEHAVIOR
Odoo provides a solid foundation for managing employee salaries, including salary rules, structures, and payslip generation. However, Odoo lacks advanced customization options, such as dynamic, code-driven salary calculations or the ability to create highly tailored salary rule categories and structures with Python-based logic
CLUEDOO BEHAVIOR
CLUEDOO RECOMMENDATIONS
Install on 100% of the database.
HOW TO USE THIS MODULE?
1
Go to
Payroll
>
Salary Rule Categories
> Create a new Salary Rule Categories
EX: Fill in 2 fields: - Name: Rule Category Test - Code: Category Test |
|
2
|
|
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 Choose 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 return the current weekday number plus 5 > Today is Tuesday, the second day of the week so the result will be 2 + 5 = 7 |
|
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module