Code Monkey home page Code Monkey logo

Comments (15)

mtelahun avatar mtelahun commented on August 15, 2024 1

@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.

 avatar commented on August 15, 2024

@mtelahun @nimarosa
I see contracts and contract_ids many times in hr_payslip.py. When is this useful?

from payroll.

mtelahun avatar mtelahun commented on August 15, 2024

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.

mtelahun avatar mtelahun commented on August 15, 2024

@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.

nimarosa avatar nimarosa commented on August 15, 2024

@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.

nimarosa avatar nimarosa commented on August 15, 2024

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.

mtelahun avatar mtelahun commented on August 15, 2024

@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.

mtelahun avatar mtelahun commented on August 15, 2024

@nimarosa Yes, you're right there is a payslip line for each salary rule per contract

from payroll.

nimarosa avatar nimarosa commented on August 15, 2024

@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:

  1. Create a setting to allow having multiple contracts
  2. 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.

mtelahun avatar mtelahun commented on August 15, 2024

@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.

mtelahun avatar mtelahun commented on August 15, 2024

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.

nimarosa avatar nimarosa commented on August 15, 2024

@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.

 avatar commented on August 15, 2024

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.

nimarosa avatar nimarosa commented on August 15, 2024

@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.

 avatar commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.