odoo/industry#2168

Created by Dharmil Goyani (dhgoy)
Merged at d442610935aa38adcf7b735cdd6e0dab1154c746

Statuses:

label
odoo-dev:saas-19.1-bowling-fix-type-error-dhgoy
head
49e84219c57018fafc2da4feca523662e7815677
merged
1 week 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