Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][OU-ADD] im_livechat: Migrate to 17.0 #4652

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsource/modules160-170.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| iap_mail | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| im_livechat | | |
| im_livechat | Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| im_livechat_mail_bot | |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/im_livechat/17.0.1.0/end-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


def _discuss_channel_computation(env):
rating_last_discuss = (
env["discuss.channel"].with_context(active_test=False).search([])
)
rating_last_discuss._compute_rating_last_value()


@openupgrade.migrate()
def migrate(env, version):
_discuss_channel_computation(env)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "im_livechat", "17.0.1.0/noupdate_changes.xml")
17 changes: 17 additions & 0 deletions openupgrade_scripts/scripts/im_livechat/17.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


def _discuss_channel_create_column(env):
openupgrade.logged_query(
env.cr,
"""
ALTER TABLE discuss_channel
ADD COLUMN IF NOT EXISTS rating_last_value FLOAT;
""",
)


@openupgrade.migrate()
def migrate(env, version):
_discuss_channel_create_column(env)
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---Models in module 'im_livechat'---
# NOTHING TO DO

---Fields in module 'im_livechat'---
im_livechat / chatbot.message / discuss_channel_id (many2one) : NEW relation: discuss.channel, required
im_livechat / chatbot.message / mail_channel_id (many2one) : DEL relation: mail.channel, required
im_livechat / discuss.channel / anonymous_name (char) : NEW
im_livechat / discuss.channel / channel_type (False) : NEW selection_keys: ['channel', 'chat', 'group', 'livechat'], mode: modify
im_livechat / discuss.channel / chatbot_current_step_id (many2one): NEW relation: chatbot.script.step
im_livechat / discuss.channel / chatbot_message_ids (one2many): NEW relation: chatbot.message
im_livechat / discuss.channel / country_id (many2one) : NEW relation: res.country
im_livechat / discuss.channel / livechat_active (boolean) : NEW
im_livechat / discuss.channel / livechat_channel_id (many2one): NEW relation: im_livechat.channel
im_livechat / discuss.channel / livechat_operator_id (many2one): NEW relation: res.partner
# NOTHING TO DO

im_livechat / discuss.channel / rating_last_value (float) : NEW isfunction: function, stored
# DONE create column in pre-migration and compute using orm in end-migration

im_livechat / im_livechat.channel / channel_ids (one2many) : relation is now 'discuss.channel' ('mail.channel') [nothing to do]
im_livechat / mail.channel / anonymous_name (char) : DEL
im_livechat / mail.channel / channel_type (False) : DEL selection_keys: ['channel', 'chat', 'group', 'livechat'], mode: modify
im_livechat / mail.channel / chatbot_current_step_id (many2one): DEL relation: chatbot.script.step
im_livechat / mail.channel / chatbot_message_ids (one2many): DEL relation: chatbot.message
im_livechat / mail.channel / country_id (many2one) : DEL relation: res.country
im_livechat / mail.channel / livechat_active (boolean) : DEL
im_livechat / mail.channel / livechat_channel_id (many2one): DEL relation: im_livechat.channel
im_livechat / mail.channel / livechat_operator_id (many2one): DEL relation: res.partner
im_livechat / mail.channel / rating_ids (one2many) : DEL relation: rating.rating
im_livechat / mail.channel / rating_last_value (float) : DEL
im_livechat / res.users / livechat_username (char) : not stored anymore
im_livechat / res.users / livechat_username (char) : now a function
im_livechat / res.users.settings / livechat_lang_ids (many2many) : NEW relation: res.lang
im_livechat / res.users.settings / livechat_username (char) : NEW
# NOTHING TO DO


---XML records in module 'im_livechat'---
NEW ir.actions.act_window: im_livechat.discuss_channel_action
NEW ir.actions.act_window: im_livechat.discuss_channel_action_from_livechat_channel
DEL ir.actions.act_window: im_livechat.im_livechat_canned_response_action
DEL ir.actions.act_window: im_livechat.mail_channel_action
DEL ir.actions.act_window: im_livechat.mail_channel_action_from_livechat_channel
NEW ir.actions.act_window.view: im_livechat.discuss_channel_action_form
NEW ir.actions.act_window.view: im_livechat.discuss_channel_action_livechat_form
NEW ir.actions.act_window.view: im_livechat.discuss_channel_action_livechat_tree
NEW ir.actions.act_window.view: im_livechat.discuss_channel_action_tree
NEW ir.actions.act_window.view: im_livechat.rating_rating_action_livechat_view_tree
DEL ir.actions.act_window.view: im_livechat.mail_channel_action_form
DEL ir.actions.act_window.view: im_livechat.mail_channel_action_livechat_form
DEL ir.actions.act_window.view: im_livechat.mail_channel_action_livechat_tree
DEL ir.actions.act_window.view: im_livechat.mail_channel_action_tree
NEW ir.model.access: im_livechat.access_livechat_channel_employee
NEW ir.model.access: im_livechat.access_livechat_channel_portal
NEW ir.model.access: im_livechat.access_livechat_channel_public
NEW ir.model.access: im_livechat.access_livechat_channel_rule_employee
NEW ir.model.access: im_livechat.access_livechat_channel_rule_portal
NEW ir.model.access: im_livechat.access_livechat_channel_rule_public
DEL ir.model.access: im_livechat.access_chatbot_message_all
DEL ir.model.access: im_livechat.access_chatbot_script
DEL ir.model.access: im_livechat.access_chatbot_script_step
DEL ir.model.access: im_livechat.access_livechat_channel
DEL ir.model.access: im_livechat.access_livechat_channel_rule
NEW ir.model.constraint: im_livechat.constraint_discuss_channel_livechat_operator_id
DEL ir.model.constraint: im_livechat.constraint_mail_channel_livechat_operator_id
NEW ir.rule: im_livechat.ir_rule_discuss_channel_group_im_livechat_group_manager (noupdate)
NEW ir.rule: im_livechat.ir_rule_discuss_channel_member_group_im_livechat_group_manager (noupdate)
DEL ir.rule: im_livechat.im_livechat_rule_manager_read_all_mail_channel (noupdate)
NEW ir.ui.view: im_livechat.discuss_channel_view_form
NEW ir.ui.view: im_livechat.discuss_channel_view_search
NEW ir.ui.view: im_livechat.discuss_channel_view_tree
NEW ir.ui.view: im_livechat.qunit_embed_suite
NEW ir.ui.view: im_livechat.rating_rating_view_kanban
NEW ir.ui.view: im_livechat.rating_rating_view_tree
DEL ir.ui.view: im_livechat.im_livechat_canned_response_view_tree
DEL ir.ui.view: im_livechat.mail_channel_view_form
DEL ir.ui.view: im_livechat.mail_channel_view_search
DEL ir.ui.view: im_livechat.mail_channel_view_tree
# NOTHING TO DO
Loading