[18.0][BUG] web_pivot_computed_measure: unit tests fail and cause another module migration to fail
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, python
- Domain
- frontend, testing-qa
Research direction
Start with web_pivot_computed_measure/tests/test_ui_pivot.py and its browser tour, then inspect the failing PivotModel.addComputedMeasure call shown in the trace. Reproduce the UI test with websocket-client installed and check how the test handles the modal and computed measure. Done means the module's tests pass and the reported missing res_users fields are no longer queried during the migration.
Written by the indexing model from the issue text.
Description
Module
web_pivot_computed_measure
Describe the bug
I am trying to add migration PR #3037 for web_responsive, I got an error that these fields: user_year_born, user_year_now do not exist.
`2024-12-24 18:00:42,135 250 INFO odoo odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot.TestUIPivot.test_ui: waiting for threads: []
2024-12-24 18:00:42,136 250 INFO odoo odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: ======================================================================
2024-12-24 18:00:42,136 250 ERROR odoo odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: FAIL: TestUIPivot.test_ui
Traceback (most recent call last):
File "/__w/web/web/web_pivot_computed_measure/tests/test_ui_pivot.py", line 32, in test_ui
self.start_tour(
File "/opt/odoo/odoo/tests/common.py", line 2076, in start_tour
return self.browser_js(url_path=url_path, code=code, ready=ready, timeout=timeout, success_signal="tour succeeded", **kwargs)
File "/opt/odoo/odoo/tests/common.py", line 2052, in browser_js
self.fail('%s\n\n%s' % (message, error))
AssertionError: The test code "odoo.startTour('web_pivot_computed_measure_tour', {"stepDelay": 100, "keepWatchBrowser": false, "debug": false, "startUrl": "/odoo", "delayToCheckUndeterminisms": 0})" failed
FAILED: [1/18] Tour web_pivot_computed_measure_tour → Step .o_navbar_apps_menu button.
Element has been found.
BUT: It is not allowed to do action on an element that's below a modal.
TIMEOUT: The step failed to complete within 10100 ms.
2024-12-24 18:00:42,197 250 INFO odoo odoo.addons.base.models.ir_attachment: filestore gc 34 checked, 2 removed
2024-12-24 18:00:42,208 250 INFO odoo odoo.addons.web_responsive.tests.test_ir_http: Starting TestIrHttp.test_session_info ...
2024-12-24 18:00:42,213 250 ERROR odoo odoo.sql_db: bad query: b'SELECT "res_users"."id", "res_users"."partner_id", "res_users"."login", "res_users"."signature", "res_users"."active", "res_users"."action_id", "res_users"."share", "res_users"."company_id", "res_users"."create_uid", "res_users"."create_date", "res_users"."write_uid", "res_users"."write_date", "res_users"."tour_enabled", "res_users"."notification_type", "res_users"."odoobot_state", "res_users"."odoobot_failed", "res_users"."apps_menu_search_type", "res_users"."apps_menu_theme", "res_users"."is_redirect_home", "res_users"."user_year_born", "res_users"."user_year_now" FROM "res_users" WHERE ("res_users"."id" IN (2))'
ERROR: column res_users.user_year_born does not exist
LINE 1: ...apps_menu_theme", "res_users"."is_redirect_home", "res_users...`
I suggest reviewing and editing the tests as I tried to fix the issue in this PR #3038.
Unfortunately, this external module was not mentioned in the tests requirements: websocket-client
As a result the tests was not running, and after I installed websocket-client test failed.
`2024-12-25 07:26:39,542 54005 INFO web_responsive_9 odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot.TestUIPivot.test_ui: waiting for threads: []
2024-12-25 07:26:39,544 54005 INFO web_responsive_9 odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: ======================================================================
2024-12-25 07:26:39,544 54005 ERROR web_responsive_9 odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: FAIL: TestUIPivot.test_ui
Traceback (most recent call last):
File "/home/kobros/Workspace/odoo18/web/web_pivot_computed_measure/tests/test_ui_pivot.py", line 62, in test_ui
self.start_tour(
File "/home/kobros/Workspace/odoo18/odoo/odoo/tests/common.py", line 2076, in start_tour
return self.browser_js(url_path=url_path, code=code, ready=ready, timeout=timeout, success_signal="tour succeeded", **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kobros/Workspace/odoo18/odoo/odoo/tests/common.py", line 2052, in browser_js
self.fail('%s\n\n%s' % (message, error))
AssertionError: The test code "odoo.startTour('web_pivot_computed_measure_tour', {"stepDelay": 100, "keepWatchBrowser": false, "debug": false, "startUrl": "/odoo", "delayToCheckUndeterminisms": 0})" failed
UncaughtTypeError: Cannot read properties of undefined (reading '__computed_id')
at PivotModel.addComputedMeasure (http://127.0.0.1:8069/web/assets/06ae128/web.assets_backend_lazy.min.js:375:229)
at DropdownItemCustomMeasure.addMeasure (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:14672:150)
at Object.mainEventHandler (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:1603:77)
at HTMLButtonElement.listener (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:762:15)
at dispatch (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15204:71)
at triggerClick (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15132:94)
at _pointerUp (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15187:24)
at async _click (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15141:456)
at async Object.click (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15197:187)
at async TourHelpers.click (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:14733:72)
at addComputedMeasure (http://127.0.0.1:8069/web/assets/06ae128/web.assets_backend_lazy.min.js:374:228)
at addMeasure (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:14671:149)
at mainEventHandler (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:1602:76)
at listener (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:761:14)
at dispatch (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15203:70)
at triggerClick (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15131:93)
at _pointerUp (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15186:23)
`
To Reproduce
Affected versions:
Steps to reproduce the behavior:
- install web_pivot_computed_measure without websocket-client and tests enabled
- install web_pivot_computed_measure with websocket-client and tests enabled
Expected behavior
In step 1 no eerors arises, just warnings, but in step 2 you get errors
@rvalyi
@zeroheure
@ovnicraft
@azmeuk
@pniederlag
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 30
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OCA/web
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[19.0] web_timeline: ValueError "Invalid field 'date_start:month'" when grouping by a date fieldPossibly taken @stferraro claimed this today. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
[19.0] web_m2x_options: system parameter + m2o options not working properly when no recordsPossibly taken @CristhianAC claimed this 11 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
-
Migration to version 20.0Possibly taken A pull request linked to this issue is open or already merged. Openhelp wanted no stale work in progress
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
Similar issues
-
bug package:workers-shared
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/workers-sdk#16924 · 1 comment ·
Maintainers usually reply within 1 day
-
dashboard
Difficulty 2/5 Half a day Newbie friendliness 78/100
damodharg6/payledger#9 ·
-
parse: child keys like `007`, `1e3`, `0x1f`, `-1` make the parent an empty array and hide the valueOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area/mobile area/ui good first issue
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
natemoo-re/ultrahtml#102 ·