diff options
| author | Robot Odoo <xmo+roboto@odoo.com> | 2019-04-01 09:43:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-01 09:43:42 +0200 |
| commit | 1fbafa4e69ee2cc682086a5a9d03435be88920bd (patch) | |
| tree | 8171b1769a0323875cfaa77d85c0236cfd5ba316 /addons/project/data | |
| parent | 92e9e84b63a266b39d556c1db1d336373dc8b303 (diff) | |
| parent | 33f4980b0209ebf95970d6613d48c4ac31c83bd9 (diff) | |
[MERGE][IMP] im_livechat: random assignation of conversation
Purpose
The assignation method should always give the new conversation to the operator who
has the less active conversation.
If two operators have the same amount of active conversation, it should chose one of
them randomly.
We also want the visitor to get the same operator (if available) from its last visit.
Specifications
The method 'get_mail_channel' on the 'im_livechat.channel' model used a simple random.choice in
the available users to select the operator.
It was improved to select the operator that has the lowest number of open livechat sessions. If multiple
operators share the same number (lowest) of open livechat sessions, it selects randomly between those.
For the visitor to get the same operator as during its last visit, we save that information in a cookie (1 week lifetime), and give this optional parameter to the server when asking for the livechat session.
To make the code clearer, some methods were reorganize and convert from `api.model` to `api.multi` (ensure_one) to be more API-compliant.
Task-1919871
closes odoo/odoo#29888
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Diffstat (limited to 'addons/project/data')
0 files changed, 0 insertions, 0 deletions
