-
- Downloads
[FIX] sale_timesheet: fix crash in project plan
The Project Plan code is quite new, but does some unconventional stuff. It looks like a form view, but it is actually a client action with a custom search view. The problem fixed by this commit is that when we try to open the project plan from the project kanban view, it crashes. It was caused by a bad interaction between the dashboard search view and the action manager. The dashboard search view trigger a search event, which bubbles up to the action manager. Since the project plan is not loaded yet, the action manager assumed that the search event was for the kanban view instead of the project plan. The fix is to prevent the event from bubbling up, since the project plan already handles the search event anyway. Note that we also set the title in this commit to a default value, to make sure that if we reload the client action, its title is set to a more interesting value than 'Undefined'. We also added a few tests, which could have prevented this mess. Now it should be easy to add more tests whenever needed.
Showing
- addons/sale_timesheet/static/src/js/timesheet_plan.js 4 additions, 1 deletionaddons/sale_timesheet/static/src/js/timesheet_plan.js
- addons/sale_timesheet/static/tests/timesheet_plan_tests.js 94 additions, 0 deletionsaddons/sale_timesheet/static/tests/timesheet_plan_tests.js
- addons/sale_timesheet/views/hr_timesheet_templates.xml 8 additions, 0 deletionsaddons/sale_timesheet/views/hr_timesheet_templates.xml
Please register or sign in to comment