odoo/odoo#162357
Created by Matthieu Stockbauer (tsm)
Merged
at 09295d229da8fe3c5bc7e011ec3f688a7989b740
- label
- odoo-dev:17.0-im_livechat-fix_get_less_active_operator-tsm
- head
- aa7acf56477ca54710c6580a7690fcc25fc517b3
- target
- 17.0
- merged
- 1 month ago by Matthieu Stockbauer (tsm)
- forward-ports
- odoo/odoo#162736 targeting master
- odoo/odoo#162732 targeting saas-17.2
- odoo/odoo#162727 targeting saas-17.1
[FIX] im_livechat: fix operator assignation
Before this PR, trying to get an available operator could result in an
error.
When a live chat is created, an operator is selected based on various
criteria such as language, country, number of ongoing chats and
availability for calls. This selection process involves the
`_get_less_active_operator` method, which receives the status of all
operators and a list of operators to choose from.
Prior to this fix, an operator not included in the list of operators
to choose from could still be selected, resulting in errors when
trying to locate them in the operator list.
This PR resolves the issue by ensuring that operators are only
selected from the provided list.
opw-3874872