Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Some deductions have a yearly limit per employee. Is there away to check these registers within a salary rule to determine if the maximum has been paid?
In Canada we have two limited deductions, one of which is EI (employment Insurance) which deducts 1.88% of the total payslip up to a maximum of $891.12 within the year after which the deduction stops. In order to achieve this I am looking to add a Python Expression under condition that grabs the total contributions over the year period and if it is less then the $891.12 allow the payroll rule to proceed. My issue I am hitting is that I am unsure how to get the total of one register for the year to date within the condition rule.
Okay found this out for myself under the example above, the following conditional statement will work assuming the rule name is EI:
result = payslip.sum('EI','2013-01-01',' 2013-12-31') > -891.12
Still would be nice not to have to change the formula every year. Any ideas?
Bit of a hack but you can use the contract start and end date to define the fiscal year:
result = payslip.sum('EI',contract.date_start,contract.date_end) > -891.12
This issue is solved with module hr_salary_rule_variable on https://github.com/OCA/hr/tree/7.0. Salary rules point on variables that change over the time. The whole salary structure for Canada is implemented and is currently in a PR to OCA: https://github.com/OCA/l10n-canada/pull/43. Reviews would be very appreciated.
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/12/13, 4:07 PM|
|Seen: 2115 times|
|Last updated: 1/9/17, 1:30 AM|