Skip to content

[19.0][MIG] im_livechat#5642

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

[19.0][MIG] im_livechat#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

@dnplkndll dnplkndll commented May 18, 2026

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). Because the new field has a different name, OpenUpgrade preserves the old column automatically — no pre-migration rename needed.

  • pre-migration.py — direct SQL DELETE of two (noupdate) ir.rule records removed in 19.0 (ir_rule_discuss_channel_group_im_livechat_group_manager, ir_rule_discuss_channel_member_group_im_livechat_group_manager). Standard module update doesn't sweep noupdate records.
  • post-migration.pyUPDATE ... SET chatbot_enabled_condition = 'only_if_no_operator' WHERE chatbot_only_if_no_operator = TRUE. Direct read of the preserved column (no get_legacy_name needed). FALSE rows keep ORM-set default of always.

Test: asserts at least one rule has the new selection set post-migration.

@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
im_livechat / res.users / livechat_channel_ids (many2many): NEW relation: im_livechat.channel
im_livechat / res.users.settings / livechat_expertise_ids (many2many): NEW relation: im_livechat.expertise

# DONE: chatbot_only_if_no_operator (boolean) -> chatbot_enabled_condition (selection) handled by pre-migration rename_columns (preserve legacy) + post-migration UPDATE mapping TRUE->'only_if_no_operator'.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to put DONE comments only next to fields which require a migration script.
Also here you do not need to copy the column, since it will not be deleted by OpenUpgrade so you can reuse directly without legacy name.

The other ones need to be marked NOTHING TO DO

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in bde040f — pre-migration now does only the noupdate ir.rule deletion (no column copy, since the old column is preserved automatically by OpenUpgrade when new field name differs). Post-migration reuses chatbot_only_if_no_operator directly. Work-doc markers per-group, # NOTHING TO DO next to additive lines and # DONE only next to the chatbot pair.

Comment on lines +122 to +123
DEL ir.rule: im_livechat.ir_rule_discuss_channel_group_im_livechat_group_manager (noupdate)
DEL ir.rule: im_livechat.ir_rule_discuss_channel_member_group_im_livechat_group_manager (noupdate)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to manually delete these noupdate rules

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in bde040f — pre-migration deletes both noupdate ir.rule records via direct SQL.

@dnplkndll dnplkndll changed the title [19.0][OU-ADD] im_livechat: chatbot_only_if_no_operator → chatbot_enabled_condition [19.0][OU-ADD] im_livechat: chatbot trigger condition promotion (boolean → selection) May 20, 2026
@dnplkndll dnplkndll force-pushed the 19.0-mig-im-livechat-chatbot-condition branch from dd451c3 to bde040f Compare May 20, 2026 23:27
@dnplkndll
Copy link
Copy Markdown
Author

@remi-filament — addressed both threads in bde040f:

  • Dropped the column copy in pre-migration; post-migration now reads chatbot_only_if_no_operator directly.
  • Pre-migration deletes the two (noupdate) ir.rule records via direct SQL.
  • Work-doc terseness applied throughout (per-group markers, ≤1 line each).

Fork CI green on both seeds. Title + body refreshed to match v2 shape. Ready for re-review.

@dnplkndll dnplkndll changed the title [19.0][OU-ADD] im_livechat: chatbot trigger condition promotion (boolean → selection) [19.0][MIG] im_livechat May 25, 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.

3 participants