oca / payroll Goto Github PK
View Code? Open in Web Editor NEWOdoo modules for payroll management
License: GNU Affero General Public License v3.0
Odoo modules for payroll management
License: GNU Affero General Public License v3.0
Hi friends,
What is the purpose of the contribution.register?
Modules hr_payroll_cancel and hr_payroll_change_state.
Should we merge this modules logic into payroll module itself? Or maybe just provide this functionality in the base payroll module so we don't need that modules?
I don't think the point of maintaining more two modules whose purpose is to add the functionality of mass change states and cancelation. We can just plug-in this functionality to the base module.
What do you think?
Currently accounting fields in salary rules are not company_dependent. The accounting in Salary rules should behave as Product, Product Categories, Partner, ...
Odoo (v11) has actually fixed this: odoo/odoo#28675
Related issue: odoo/odoo#23814
hr.payslip has two fields with one2many relationship to hr.payslip.line:
details_by_salary_rule_category
is found only seven times in the code. Can we remove this field and replace with line_ids?
Why is there a separate page "Details By Salary Rule Category" in the payslip? All the info is also in "Salary Computation", right?
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
In general, I think that payroll
should have essential features only. I am not using:
@nimarosa @mtelahun @pedrobaeza @percevaq
Are you using all of these features?
Is there any other payroll
feature that you are not using?
Do you think that anything should move to another module, or be enabled with a setting?
Please write short answers!
In https://github.com/oca/edi many module names end with "_oca" to show that it is the OCA alternative to another module with the same name. I think this is a nice convention, so I suggest to rename "payroll" to "hr_payroll_oca", and "payroll_account" to "hr_payroll_account_oca". Then in the list of modules, all payroll modules will be grouped together, starting with "hr_payroll".
What do you think?
payroll/payroll/models/hr_payslip.py
Line 353 in b88a195
Please change to:
"code": holiday.holiday_status_id.code or "GLOBAL",
payroll_account
There is and error when running the --test-enable in payroll_account
Affected versions:
V14
Steps to reproduce the behavior:
2024-07-13 15:18:54,069 3952 INFO payroll odoo.modules.loading: loading payroll_account/demo/hr_payroll_account_demo.xml
2024-07-13 15:18:54,245 3952 INFO payroll odoo.models.unlink: User #1 deleted mail.followers records with IDs: [2553]
2024-07-13 15:18:54,488 3952 INFO payroll odoo.addons.payroll_account.tests.test_payroll_account: Starting TestPayrollAccount.test_00_hr_payslip ...
2024-07-13 15:18:56,685 3952 INFO payroll odoo.addons.payroll_account.tests.test_payroll_account: Starting TestPayrollAccount.test_hr_payslip_no_accounts ...
2024-07-13 15:18:57,657 3952 INFO payroll odoo.addons.payroll_account.tests.test_payroll_account: ======================================================================
2024-07-13 15:18:57,657 3952 ERROR payroll odoo.addons.payroll_account.tests.test_payroll_account: FAIL: TestPayrollAccount.test_hr_payslip_no_accounts
Traceback (most recent call last):
File "/Users/panca/Documents/OpenObject/odoo14/odoo/odoo/modules/registry.py", line 63, in __new__
return cls.registries[db_name]
KeyError: 'payroll'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/panca/Documents/OpenObject/odoo14/OCA/payroll/payroll_account/tests/test_payroll_account.py", line 211, in test_hr_payslip_no_accounts
self.assertFalse(self.hr_payslip.move_id, "Accounting Entries has been created")
AssertionError: account.move(40,) is not false : Accounting Entries has been created
2024-07-13 15:18:57,736 3952 INFO payroll odoo.modules.loading: Module payroll_account loaded in 6.79s (incl. 3.17s test), 231 queries (+611 test)
2024-07-13 15:18:57,738 3952 ERROR payroll odoo.modules.loading: Module payroll_account: 1 failures, 0 errors of 2 tests
2024-07-13 15:18:57,930 3952 INFO payroll odoo.modules.loading: 52 modules loaded in 8.63s, 246 queries (+611 extra)
2024-07-13 15:18:58,449 3952 ERROR payroll odoo.modules.loading: At least one test failed when loading the modules.
2024-07-13 15:18:58,457 3952 INFO payroll odoo.addons.base.models.ir_http: Generating routing map for key None
2024-07-13 15:18:58,848 3952 INFO payroll werkzeug: 127.0.0.1 - - [13/Jul/2024 15:18:58] "POST /longpolling/im_stat
Expected behavior
There is no error shown as it will impact to further development / improvement of this module.
We are proposing the improvement to make journal entry batch at #163 but found difficulty because this error.
When trying to install, i get a server error and a traceback with this message at the bottom
ImportError: cannot import name 'hr_salary_rule' from partially initialized module 'odoo.addons.payroll.models' (most likely due to a circular import) (/mnt/extra-addons/payroll/models/__init__.py)
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
Hello, I would like to know if there is documentation to deploy these modules in the system.
payroll
view to add employees is not complete in payroll processing
In payroll, enter the payroll processing, create a new one and use the button to add employees
Affected versions: 16.0
Steps to reproduce the behavior:
Expected behavior
Additional context
I'm glad to see this repo is actively maintained by OCA. It's kind of loss since V13 it was moved to EE.
This repo is become more complete and hopefully there will new other features coming soon.
One of my feature I think I can't find right now is to get the attendance days to be imported to worked_days. As default it shows the WORKS.100 but, it's good to calculate the total days from the attendance to payslip. Having overview about the attendance and the time off will help user to get rid the conflict between the scheduled.
The second, it would be good as well if we can compensate the receivable / payable that was created from Expense Module to be factored in payslip. Currently, we can use Inputs and fill the amount manually, but if we can import it automatically from the approved expense, that will be great. One of the use case I found is about deduct the payroll by the staff loan instalment.
Thanks for considering items for the next round.
Should I make an empty branch?
hr_payslip.py
def _get_payslip_lines(self, contract_ids, payslip_id):
I see that there is support for multiple contracts for the same payslip of an employee. So I just tried to create 2 contracts for the same employee. The second contract could not get the state running
- I got an error "An employee can only have one contract at the same time. (Excluding Draft and Cancelled contracts)" So how can multiple contracts be passed to _get_payslip_lines()? What is the use case?
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-14.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
payroll
Adding a manual value into "Salary Computation" doesn't recalculate other lines.
Affected versions: tested on Odoo 13.0 and 14.0
Steps to reproduce the behavior:
Expected behavior
While "Bonus" has code than BASIC, I expected to have all other lines computed, like GROSS which is supposed to be categories.BASIC + categories.ALW.
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
Hello oca/payroll users and contributors.
This thread is to discuss migrations to v15 and v16. As you can see, the new v16 branch is now live and we still in the v14.
Since we are using v14.0 to do improvements and changes to the modules, I suggest we continue doing so until we think it's time to migrate to v15.0 and then to v16.0.
My approach here will be maintain the tree versions because i have clients that will continue with v14.0 for a while, but i think we should start with v15.0 migration soon.
From my end, i have some PRs that i wish to merge first in v14.0 before we start the migration so we can have this changes in following versions. I will try to include all this changes this week or the following.
If someone has something new or improvements that wish to include in the module, i suggest to do it as fast as possible.
So i think we can schedule deadline for starting migrations to other versions on 20/10/2022.
As i said, i will continue maintaining v14.0 version but also after migration, I will port any change in any branch to the other ones, so it will be good for all of us to include any changes you wish to include before this date, so we reduce the workload of backporting versions.
Any doubt or suggestion about migrations can also be addressed in this thread.
Kind regards to everyone.
Hi everybody how are you?
What do you think or what is suggested to be done if the payroll has to be generated not in base currency?
Currently in the action_payslip_done method the value of the currency is obtained in this way:
currency = (
slip.company_id.currency_id or slip.journal_id.company_id.currency_id
)
Reference:
currency = (
slip.currency_id or slip.journal_id.currency_id
)
Of course, for this it would be necessary to have the following module installed, which is still under review in version 17.0: hr_contract_currency
On the other hand, the values โโof currency_id and amount_currency would have to be loaded into the debit and credit lines and then perform the corresponding reconciliation.
I am not an expert programmer or accountant but I have carried out some tests in a local development environment (in version 16.0) also using two old modules in version 8.0 of Odoo developed by ClearCorp that I migrated to version 16.0 and thus be able to contemplate this multi-currency scenario:
hr_payroll_multicurrency
This module was written to extend the functionality of payroll to support multi-currency
hr_payroll_account_multicurrency
This module was written to extend the functionality of payroll to create journal items in multi-currency
Basically I would like to know from the main people in charge of this repository if there are intentions to incorporate multi-currency support for payrolls and if not, receive an option on the path I am following to know if it is worth contributing to what I am doing. and that others can collaborate so that this functionality is present in version 16 and later
From already thank you very much
Hello, motivated by the chat we were having in #87 I open this issue to discuss possible solutions to safe_eval lack of security so we can stop exposing all python environment in a salary rule.
The main issue here is: safe_eval is not safe at all. It exposes real environment python objects and allows the user to run almost everything from a salary rule.
So I come up with 3 ideas that I think if we apply at least one of them it will improve security in the module rules:
We should write more standard options of calculations, so we can move the python mode to another module to be used only when necessary.
We modify safe_eval to not allowing write access to the ORM. Actually don't know how difficult this can be, but I think is an option.
We create a new salary rule coding language. It would involve a whole module change, but for me, is the more promising one, and I have some resources you can check to get an idea:
In python we have some libraries and derivates projects called "Python String Parsers" that in resume provide a whole package that parse strings and convert them to encapsulated python code (so it didn't expose the environment) and return the result of the operation. This packages will solve the problem since we will not write python code in the rule, we will be writing strings and functions from the parser library and the the package will take care of interpreting and processing the sting code, not exposing in any way the python environment.
For you to read I leave you some resources about it:
Also I leave some interesting article about eval safety issues. That is a problem with eval and safe_eval so that's what we should attack. Eval is really dangerous
So in resume I think we should take a look to all options. Also, and in a way of providing temporary security I will work in @norlinhenrik approach of locking the salary rule form from only a few cases or maybe a setting. So only trusted odoo users can edit rules.
Also I think #87 should be merged with the new payslip object fix, because adding it don't increment current security issues of salary rules, it's just another object and since we have access to all env in rules, I think we can tolerate this change. We should attack security issues from the root, which is python safe_eval not the objects.
Leave this thread to discuss with you @appstogrow @mtelahun , I can also create a new branch to work in this if you are willing to help me with this, since it's a big change and I don't have time to do it alone, I have the ideas so I think we can make a good team.. Let me know what you think and I can create a 14.0-new-rule-language branch and we can work in there until everything is ready.
Dear all,
Translation of this project has been locked in OCA Weblate for a long time. This causes many problems for us (end users). Would you check and open it?
I appreciate this active payroll community! For version 15.0 I would like to explore ways to make the payroll easier to use, both for small and big companies. Possible tools for this could be a 15.0-dev branch and Google document/spreadsheet/survey/meeting.
My PR #51 could be a contribution to a 15.0-dev branch. It should not be merged with 14.0 since it is adding a new payroll dependency on the analytic module. As discussed in #31 it is not good to add new dependencies for the current users of the module.
To avoid maintaining two branches more than necessary, we can wait with this for a couple of weeks, to finish important improvements for 14.0.
CC'ing developers involved in change
@nimarosa @pedrobaeza @apps2grow
payroll
Hi guys, this change happened a few months ago but I only noticed it now when I updated my upstream sources and my unit tests started to fail.
PR #27 changed the sign of calculated hours and days of leaves to be negative. This is causing unit tests in my custom modules to fail.
I don't think the previous behavior was a bug, and even if it was I believe it's a bit late in the 14.0 life-cycle to be changing expected behavior now. Basically, this gratuitously changes previous behavior of the module without any tangible benefits to the wider community.
Expected behavior
That the module continues to function as it has before.
Global rule blacklist ban rule for next contacts
payroll
Rules can not appear in Paysplips depends on contract computing order.
Affected versions: 13-16
Steps to reproduce the behavior:
Expected behavior
Payslip lines will have C rule in any cases.
But if Odoo will compute contract with wage = 1 firstly, Payslip will not contain C rule at all.
This happens cause if condition is negative Odoo adds rule to global blacklist and second contract ignores C rule at all.
IMHO We must create blacklist for every contract.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.