-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] crm_phonecall_summary_predefined: Migration to 9.0
* Updated views * Updated README [9.0][MIG] crm_phonecall_summary_predefined module
- Loading branch information
1 parent
3ca7a9d
commit 8b06740
Showing
8 changed files
with
72 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
# Copyright 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
# Copyright 2017 Tecnativa - Vicent Cubells | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import models | ||
from .hooks import convert_names_to_many2one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Vicent Cubells <vicent.cubells@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from psycopg2 import IntegrityError | ||
|
||
from openerp import api, SUPERUSER_ID | ||
|
||
|
||
def convert_names_to_many2one(cr, registry): | ||
"""Convert old string names to new Many2one.""" | ||
with api.Environment.manage(): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
summary = env["crm.phonecall.summary"] | ||
phone_call = env["crm.phonecall"] | ||
for s in phone_call.search([("summary_id", "=", False)]): | ||
try: | ||
with env.cr.savepoint(): | ||
s.summary_id = summary.create({ | ||
"name": s.name, | ||
}) | ||
except IntegrityError: | ||
s.summary_id = summary.search([("name", "=", s.name)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
# COpyright 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import crm_phonecall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters