Thursday, February 27, 2025
4 changes · saas-18.1
Resolved issues and error corrections
Fixes an issue where changing the chatbot during an active live chat could cause lead creation and forwarding to fail. This helps sales teams avoid interrupted conversations and ensures live chat leads can continue being routed correctly.
Original PR description
This error occurs when attempting to create a lead and forward it from the live chat. Traceback : --- ``` StopIteration: null File "odoo/http.py", line 2420, in __call__ response =…
This error occurs when attempting to create a lead and forward it from the live chat.
Traceback :
---
```
StopIteration: null
File "odoo/http.py", line 2420, in __call__
response = request._serve_db()
File "odoo/http.py", line 1946, in _serve_db
return self._transactioning(
File "odoo/http.py", line 2010, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 137, in retrying
result = func()
File "odoo/http.py", line 1977, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2228, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 335, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 741, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/mail/models/discuss/mail_guest.py", line 38, in wrapper
return func(self, *args, **kwargs)
File "addons/im_livechat/controllers/chatbot.py", line 69, in chatbot_trigger_step
posted_message = next_step._process_step(discuss_channel)
File "addons/crm_livechat/models/chatbot_script_step.py", line 42, in _process_step
return self._process_step_create_lead_and_forward(discuss_channel)
File "addons/crm_livechat/models/chatbot_script_step.py", line 107, in _process_step_create_lead_and_forward
user = next(user for user in users if user.partner_id == operator_partner)
```
The error occurs at [1] because both `users` and `teams` are empty. As a result, `next()` attempts to retrieve an item from an empty iterator, leading to a `StopIteration` exception.
This issue arises when the bot assigned in the script is changed during an active session. Consequently, `operator_partner` refers to the old bot (the one configured at the start of the session) rather than the new one. This discrepancy causes the condition to be evaluated as True, leading to the error.
This commit resolves the error by saving the value of `operator_partner` before calling `_process_step_forward_operator`. This ensures that `operator_partner` remains the same until the end of the session.
[1]- https://github.com/odoo/odoo/blob/db62ec3b72b30b01ff04b067cf2c235bd9a8411e/addons/crm_livechat/models/chatbot_script_step.py#L101-L109
sentry-6296911936
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prOpening a new Restaurant point-of-sale session no longer fails if all preset configurations were deleted. This prevents an error screen during setup and helps restaurants start sessions reliably even after configuration cleanup.
Original PR description
Currently, a traceback occurs when the user deletes the presets and try to open a new restaurant session. To reproduce this issue: 1) Install `Restaurant` without demo 2) Delete all the `presets`…
Currently, a traceback occurs when the user deletes the presets and try to open a new restaurant session. To reproduce this issue: 1) Install `Restaurant` without demo 2) Delete all the `presets` data from the POS/Configuration 3) Now open the `Restaurant` from the POS Dashboard Error:- ``` IndexError: list index out of range ``` When the user tries to open a new `Restaurant` from the Dashboard, the `load_onboarding_restaurant_scenario` method triggers. In that method, we try to assign the `default_preset_id` value from presets[0]. We get presets as an empty list because the user deleted all the `presets` data. https://github.com/odoo/odoo/blob/4aa3f035f9e633ee50e8538abf0bffc5a246e643/addons/pos_restaurant/models/pos_config.py#L116-L120 https://github.com/odoo/odoo/blob/4aa3f035f9e633ee50e8538abf0bffc5a246e643/addons/pos_restaurant/models/pos_config.py#L131 This leads to the above traceback when accessing the first index from presets. **Note:-** When resolving the above issue we get the `ParseError`, This will also resolved in this PR. sentry-6327697722,6329224724,6328865117
Point of Sale search now checks barcodes assigned to individual product variants, so staff can find the correct item when entering or scanning a variant barcode. This helps avoid missed products at checkout and improves sales flow for variant-based catalogs.
Original PR description
**Problem**: When searching for a product variant using its barcode, the product does not appear in the results. **Solution**: Ensure that the barcode of product variants is checked when matching products during the search. **Steps to Reproduce**: 1. Create a product with variants. 2. Assign a barcode to a variant product. 3. Start a PoS session (ensure the variant can be sold here). 4. Use the search bar to look up the variant's barcode. - **Issue**: No results are found. opw-4561663 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix ensures live chat bot step data is sent with the correct identifiers. It helps prevent inconsistent chatbot behavior and supports more reliable customer conversations.
Original PR description
Before this PR, chat bot data was sent with incorrecet ids. This can lead to inconsistencies. This PR fixes the issue. part of task-4607689