odoo/industry#2180
Created by fw-bot
- label
- odoo-dev:master-saas-19.1-bowling-fix-type-error-dhgoy-527302-fw
- head
- 9d80308ffc4c2aacffc962fc051da64c3b2cd0cb
- merged
- 5 days ago by Industry, Vallaeys Valentin (vava)
| odoo/industry | |
|---|---|
| saas-19.1 | #2168 |
| saas-19.2 | #2175 |
| saas-19.3 | #2178 |
| master | #2180 |
[FIX] *: prevent an error while opening POS session
*= ['bowling', 'food_trucks', 'micro_brewery', 'sports_club']
Currently, an error occurs while opening the restaurant session.
Step to reproduce:
- Install the bowling module.
- Open the Restaurant POS session.
TypeError: 'str' object is not a mapping
The issue occurs because floor_plan_layout values are defined as strings in XML
data. During floor plan computation, the value is later unpacked as a
dictionary [1], which causes the traceback
link [1]: https://github.com/odoo/odoo/blob/76e179f24807612f2d864f14f1a0a1a5661585b0/addons/pos_restaurant/models/pos_config.py#L186
To fix this issue, define floor_plan_layout values using eval="{}" in the XML
data, so they are stored as dictionaries instead of strings.
The same issue also exists in food_trucks, micro_brewery, and sports_club, but
no traceback occurs because module_pos_restaurant(Is a Bar/Restaurant) is
disabled (False), which skips the restaurant floor plan computation. If
that is enabled (True), the same error will occur.
Task ID-6193639