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

[16.0] [OU-ADD] crm #3765

Merged
merged 1 commit into from
Jul 6, 2023
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/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |del| coupon | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| crm | | |
| crm | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| crm_iap_enrich | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
32 changes: 32 additions & 0 deletions openupgrade_scripts/scripts/crm/16.0.1.8/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

_field_renames = [("crm.lead", "crm_lead", "lost_reason", "lost_reason_id")]


def res_partner_compute_team_id(env):
openupgrade.logged_query(
env.cr,
"""
UPDATE res_partner as p
SET team_id = res.parent_team_id
FROM(
SELECT p.id, parent.team_id
FROM res_partner p
JOIN res_partner parent
ON p.parent_id = parent.id
WHERE p.team_id IS NULL
AND p.is_company='f'
AND parent.team_id IS NOT NULL
) as res(partner_id, parent_team_id)
WHERE p.id = res.partner_id
""",
)


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_fields(env, _field_renames)
res_partner_compute_team_id(env)
19 changes: 19 additions & 0 deletions openupgrade_scripts/scripts/crm/16.0.1.8/upgrade_analysis_work.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---Models in module 'crm'---
---Fields in module 'crm'---
crm / crm.lead / lead_properties (properties) : NEW hasdefault: compute
# NOTHING TO DO: new feature

crm / crm.lead / lost_reason (many2one) : DEL relation: crm.lost.reason
crm / crm.lead / lost_reason_id (many2one) : NEW relation: crm.lost.reason
# DONE: pre-migration: rename column

crm / crm.team / lead_properties_definition (properties_definition): NEW
# NOTHING TO DO: new feature

crm / res.partner / team_id (False) : NEW mode: modify, hasdefault: compute
# DONE: pre-migration: compute value in DB

---XML records in module 'crm'---
NEW ir.ui.view: crm.crm_lead_merge_summary
NEW ir.ui.view: crm.crm_lead_view_tree_reporting
# NOTHING TO DO