Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test error in def test_hr_payslip_no_accounts(self): #164

Open
hitrosol opened this issue Jul 13, 2024 · 1 comment
Open

test error in def test_hr_payslip_no_accounts(self): #164

hitrosol opened this issue Jul 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hitrosol
Copy link

Module

payroll_account

Describe the bug

There is and error when running the --test-enable in payroll_account

To Reproduce

Affected versions:
V14
Steps to reproduce the behavior:

  1. run odoo service by adding --test-enable -i payroll_account
  2. There is an error shown :

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.

@mtelahun @nimarosa @norlinhenrik

@hitrosol hitrosol added the bug Something isn't working label Jul 13, 2024
@norlinhenrik
Copy link
Contributor

Hi @hitrosol
I just (1) pulled the latest code for OCA/payroll 14.0, (2) installed payroll_account into a new database and (3) run odoo with --test-enable --test-tags=/payroll_account with no errors. I always install first and then test, since I have experienced that installing and testing in the same operation sometimes may cause errors.

2024-07-23 09:25:30,541 3700 INFO o14-0723 odoo.modules.loading: loading 42 modules...
2024-07-23 09:25:30,762 3700 INFO ? odoo.service.server: HTTP service (werkzeug) running on T470-20201029:14005
2024-07-23 09:25:31,010 3700 WARNING o14-0723 py.warnings: C:\Users\Henrik Norlin\AppData\Local\Programs\Python\Python37\lib\site-packages\jinja2\sandbox.py:82: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
  from collections import MutableSet, MutableMapping, MutableSequence

2024-07-23 09:25:33,819 3700 INFO o14-0723 odoo.addons.payroll_account.tests.test_payroll_account: Starting TestPayrollAccount.test_00_hr_payslip ...
2024-07-23 09:25:35,502 3700 INFO o14-0723 odoo.models.unlink: User #1 deleted hr.payslip.line records with IDs: [1, 2, 3, 4, 5, 6, 7, 8, 9]
2024-07-23 09:25:36,446 3700 INFO o14-0723 odoo.addons.payroll_account.tests.test_payroll_account: Starting TestPayrollAccount.test_hr_payslip_no_accounts ...
2024-07-23 09:25:37,580 3700 INFO o14-0723 odoo.models.unlink: User #1 deleted hr.payslip.line records with IDs: [19, 20, 21, 22, 23, 24, 25, 26, 27]
2024-07-23 09:25:37,704 3700 WARNING o14-0723 odoo.addons.payroll_account.models.hr_payslip: Payslip SLIP/002 did not generate any account move lines
2024-07-23 09:25:38,750 3700 INFO o14-0723 odoo.modules.loading: 42 modules loaded in 8.21s, 17 queries (+768 extra)
2024-07-23 09:25:39,125 3700 INFO o14-0723 odoo.modules.loading: Modules loaded.
2024-07-23 09:25:39,142 3700 INFO o14-0723 odoo.service.server: Starting post tests
2024-07-23 09:25:39,421 3700 INFO o14-0723 odoo.service.server: 0 post-tests in 0.28s, 0 queries
2024-07-23 09:25:39,421 3700 INFO o14-0723 odoo.tests.runner: 0 failed, 0 error(s) of 2 tests when loading database 'o14-0723'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants