Comments (15)
@nimarosa I have a lot of modules I would like to propose to OCA, the problem is having the time to follow-up 😁
from payroll.
@mtelahun @nimarosa
I see contracts
and contract_ids
many times in hr_payslip.py. When is this useful?
from payroll.
Hi @appstogrow , I haven't had a chance to look at this PR yet, but normally if there are multiple contracts for an employee within the payslip dates each contract gets evaluated against the worked_days, inputs, and salary rules. The values you see in the salary computation tab is the aggregated value of the salary rules computed against all the contracts.
from payroll.
@appstogrow I should clarify that last part: The values you see in the salary computation tab is the aggregated value of the salary rules computed against the worked_days, inputs evaluated for each contract. For example if there are two consecutive contracts in a month there will be a separate WORK100 worked_days line for each contract. Then when the salary rules are evaluated, for each contract the BASIC salary rule is evaluation twice, once using the first WORK100 line for the first contract and a second time using the line for the second contract. The value for the BASIC payslip line in the Salary Computation tab is the sum of both evaluations.
from payroll.
@appstogrow Like @mtelahun said, the payroll module iterates contracts and evaluate for each contract. I never used more than one contract because it's not common in my clients using it.
Henrik, I understand that when you create a second contract for the same employee and you try to drag it to the running state in contracts view you get that error? If you do probably odoo core changed the base contract module to allow only one contract and payroll outdated code still support more than one contract at a time. I will try to replicate and test this and I get back to you. I never used more than one contract.
With that said, if the contracts module don't allow more than one running contract, it makes sense continue supporting this?
I checked in enterprise version of this module and in EE they removed the support for more than one contract.
If we all agree we can remove the multiple contract support since if the base module don't allow to have more than one it makes no sense to continue supporting it.
@mtelahun for the case you are referring both contracts are in running state?
I keep posted to resolve this and I can adapt the PR.
from payroll.
Also I don't think that the calculation line is the aggregated value, seeing the code I understand that module will create a salary rule for each contract. Are you sure it work like that @mtelahun?
from payroll.
@nimarosa There are 2 types of multiple contracts with respect to payroll. Concurrent contracts are when the start/end dates of the contracts overlap. Consecutive contracts are when the start/end dates don't overlap but they are both within the payslip period. I use multiple consecutive contracts all the time. Multiple consecutive contracts are also normally possible in Odoo. For using multiple concurrent contracts I don't know if base Odoo allows that but I believe I have a module with a res.config.setting that does that. An organization might use concurrent contracts when an employee works for two different departments and each department has to be in a separate contract because the source of the money comes from two different funds. I believe this happens more frequently in grant based organizations like Universities, NGOs, etc.
from payroll.
@nimarosa Yes, you're right there is a payslip line for each salary rule per contract
from payroll.
@mtelahun okay but if contract module works like @appstogrow is telling us (I'm not in the computer yet to test) odoo will not allow to have more than one contract in running state for the same employee, so if you are using it you modified by an external module this limitation?
If this is the case we have two paths to choose:
- Create a setting to allow having multiple contracts
- Remove the multiple contract support since odoo base don't support multiple running contracts.
I'm okay with anyone of them because I really don't have cases when this is used but if you use it maybe you want to work in modifying he_contract with a setting allowing multiple running contracts, because without that the feature don't makes sense in payroll.
As I noted earlier, in enterprise it's not supported having payslips for multiple contracts.
@appstogrow what do you think?
from payroll.
@nimarosa I don't know how Odoo Enterprise does it, and to be honest I don't really care. However, please re-read my reply. Even if multiple concurrent contracts are not supported in Odoo. Multiple consecutive contracts are.
from payroll.
Payslip start: 01/08/2022
Payslip end: 31/08/2022
Contract 01 start - end: 25/07/2022 - 15/08/2022
Contract 02 start - end: 16/08/2022 - False
This is a valid configuration in Odoo
from payroll.
@mtelahun Okay I understand now, thanks for the last example!
So if consecutive contracts are supported I think it make sense maintain the contract iteration in payroll.
Maybe in the future you can bring your module for allowing multiple concurrent contracts to this repo, that way we offer users that need this functionality a official
Oca module to support it.
from payroll.
Thank you both for sharing!
So we need to support consecutive contracts.
Concurrent contracts is possible, if we override the error message in hr_contract
. I don't really need it.
Instead of concurrent contracts, I will continue to specify in one contract how the salary should be split between multiple analytic accounts. So I will finish #51 after #62-64 are merged.
from payroll.
@appstogrow i think if we want to support concurrent contracts it has to be another module or a setting, because for me is useful that the system limits only one running contract for a period. If other use cases want to use multiple contracts they can install the module or change the setting.
If anyone of you want to make this module we can host it in this repo. Suggested name hr_concurrent_contracts
from payroll.
I was curious to hear if any of you were using concurrent contracts already, but you are not. And I don't need it. So I will close this issue now.
from payroll.
Related Issues (20)
- Attendance days to hr.payslip HOT 2
- Cant install payroll in odoo 15 HOT 2
- payroll_account with accounting fields as company_dependent fields HOT 2
- [14.0] payroll_account: problem selecting ledger accounts
- Global rule blacklist ban rule for next contacts HOT 2
- Translation is locked in OCA weblate? HOT 4
- 17.0 branch? HOT 3
- Migration to version 17.0 HOT 2
- Wizard view error hr_payslips_by_employee.xml HOT 2
- test error in def test_hr_payslip_no_accounts(self): HOT 1
- [16.0] payroll_account support in hr_payslip.py for multicurrency
- Payslip - Details By Salary Rule Category HOT 15
- Merge of hr_payroll_cancel and hr_payroll_change_state. HOT 14
- 15.0-dev branch for payroll HOT 2
- Documentation HOT 1
- Migration to version 16.0 HOT 6
- About pending migrations HOT 7
- Which payroll features are essential? HOT 2
- Solution for safe_eval security issues HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from payroll.