Skip to content
Merged
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 @@ -214,7 +214,7 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| iap_mail | Nothing to do | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| 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)
18 changes: 18 additions & 0 deletions openupgrade_scripts/scripts/im_livechat/17.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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")
openupgrade.delete_record_translations(
env.cr,
"im_livechat",
[
"livechat_email_template",
],
)
openupgrade.delete_records_safely_by_xml_id(
env, ["im_livechat.im_livechat_rule_manager_read_all_mail_channel"]
)
26 changes: 26 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,26 @@
# 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 NUMERIC;
""",
)


@openupgrade.migrate()
def migrate(env, version):
_discuss_channel_create_column(env)
# cannot use openupgrade.delete_sql_constraint_safely
openupgrade.logged_query(
env.cr,
"""ALTER TABLE discuss_channel
DROP CONSTRAINT IF EXISTS mail_channel_livechat_operator_id""",
)
openupgrade.delete_records_safely_by_xml_id(
env, ["im_livechat.constraint_mail_channel_livechat_operator_id"]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---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
# NOTHING TO DO

NEW ir.model.constraint: im_livechat.constraint_discuss_channel_livechat_operator_id
DEL ir.model.constraint: im_livechat.constraint_mail_channel_livechat_operator_id
# DONE: pre-migration: deleted safely old constraint (we don't have renaming mechanism)

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)
# NOTHING TO DO

DEL ir.rule: im_livechat.im_livechat_rule_manager_read_all_mail_channel (noupdate)
# DONE: post-migration: deleted safely

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