Commit f6e9034
committed
[FIX] pos_hr: initialize employeeBuffer before super call to avoid error
Steps to reproduce:
===================
- Enable Login with Employee in POS settings
- Open POS and log in with employee
- Turn off the internet connection
- Reload the POS page
Issue:
======
- POS crashes with the following error:
TypeError: Cannot read properties of undefined (reading push)
- At that point, employeeBuffer is still undefined
Cause:
======
- The method set_cashier() is triggered during the parent setup()
- employeeBuffer was only initialized after super.setup()
- In offline mode, this sequence still executes, leading to an exception
when trying to .push() into an undefined buffer
Fix:
====
- Moved the initialization of employeeBuffer to the beginning of the
setup() method
Task: 4850543
Runbot Error: 227777
closes odoo#216843
Signed-off-by: David Monnom (moda) <moda@odoo.com>1 parent d985f8f commit f6e9034
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments