Skip to content

[19.0][OU-ADD] im_livechat: chatbot_only_if_no_operator → chatbot_enabled_condition#5642

Open
dnplkndll wants to merge 1 commit into
OCA:19.0from
ledoent:19.0-mig-im-livechat-chatbot-condition
Open

[19.0][OU-ADD] im_livechat: chatbot_only_if_no_operator → chatbot_enabled_condition#5642
dnplkndll wants to merge 1 commit into
OCA:19.0from
ledoent:19.0-mig-im-livechat-chatbot-condition

Conversation

@dnplkndll
Copy link
Copy Markdown

Summary

19.0 replaces the boolean im_livechat.channel.rule.chatbot_only_if_no_operator with a selection field chatbot_enabled_condition (always / only_if_no_operator / only_if_operator).

Migration

  • pre-migration.pyopenupgrade.rename_columns to preserve the legacy boolean column past ORM init.
  • post-migration.pyUPDATE im_livechat_channel_rule SET chatbot_enabled_condition = 'only_if_no_operator' WHERE <legacy column> IS TRUE. FALSE rows keep the ORM-set default of always.
  • Legacy column preserved for database_cleanup to pick up post-migration (per pedrobaeza policy on OpenUpgrade preserving information).

Test coverage

openupgrade_scripts/scripts/im_livechat/19.0.1.0/tests/test_im_livechat_migration.py:

  1. asserts at least one channel.rule has chatbot_enabled_condition='only_if_no_operator' after migration
  2. asserts the legacy column still exists in the schema (so database_cleanup can clear it)

openupgrade_scripts/scripts/im_livechat/tests/data_im_livechat_migration.py — 18.0 demo seed: sets chatbot_only_if_no_operator=True on at least one channel.rule so the post-migration UPDATE has rows to fire on.

What this PR does NOT touch

Per pedrobaeza policy ("OpenUpgrade preserves information; database_cleanup handles residuals"), these 19.0 changes in im_livechat are intentionally left alone:

  • Additive new tracking fields on discuss.channel (auto-populate at ORM init)
  • New models: im_livechat.channel.member.history, conversation.tag, expertise (additive)
  • DEL fields anonymous_name, livechat_active, image_128, input_placeholder — left for database_cleanup

Fork CI

Validated on fork's `Test OpenUpgrade migration` workflow (both base + enriched seeds passed): 2026-05-16T01:58Z.

docsource

docsource/modules180-190.rst updated — `im_livechat` marked Done so OCA CI's `Test OpenUpgrade migration` job includes the module in `$MODULES_NEW`.

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels May 18, 2026
@dnplkndll dnplkndll force-pushed the 19.0-mig-im-livechat-chatbot-condition branch from 080fc41 to cf341e0 Compare May 19, 2026 01:16
@dnplkndll dnplkndll marked this pull request as ready for review May 19, 2026 01:16
@dnplkndll dnplkndll force-pushed the 19.0-mig-im-livechat-chatbot-condition branch from cf341e0 to dd451c3 Compare May 19, 2026 13:52
@dnplkndll dnplkndll changed the title [19.0][MIG] im_livechat: chatbot_only_if_no_operator -> chatbot_enabled_condition [19.0][OU-ADD] im_livechat: chatbot_only_if_no_operator → chatbot_enabled_condition May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants