Skip to content

Commit

Permalink
[MIG] crm_phonecall_summary_predefined: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinafernandez-tecnativa authored and pedrobaeza committed Jul 11, 2024
1 parent 504e480 commit 247c834
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
4 changes: 2 additions & 2 deletions crm_phonecall_summary_predefined/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ Configuration
To configure the possible summary options:

1. Activate the developer mode
2. Go to *CRM > Configuration > Leads & Opportunities > Phone Calls >
Summaries*.
2. Go to *CRM > Configuration > Phone Calls > Summaries*.
3. Add or modify types there.

Usage
Expand Down Expand Up @@ -81,6 +80,7 @@ Contributors
- Vicent Cubells
- Cristina Martín
- Víctor Martínez
- Carolina Fernandez

- Anand Kansagra <[email protected]>

Expand Down
3 changes: 2 additions & 1 deletion crm_phonecall_summary_predefined/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright 2016 Antiun Ingeniería S.L. - Jairo Llopis
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Restricted Summary for Phone Calls",
"summary": "Allows to choose from a defined summary list",
"version": "15.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Customer Relationship Management",
"website": "https://github.com/OCA/crm",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
23 changes: 10 additions & 13 deletions crm_phonecall_summary_predefined/hooks.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# Copyright 2017 Vicent Cubells <[email protected]>
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from psycopg2 import IntegrityError

from odoo import SUPERUSER_ID, api


def convert_names_to_many2one(cr, registry): # pragma: no cover
def convert_names_to_many2one(env): # pragma: no cover
"""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)])
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)])
2 changes: 1 addition & 1 deletion crm_phonecall_summary_predefined/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
To configure the possible summary options:

1. Activate the developer mode
2. Go to *CRM \> Configuration \> Leads & Opportunities \> Phone Calls
2. Go to *CRM \> Configuration \> Phone Calls
\> Summaries*.
3. Add or modify types there.
1 change: 1 addition & 0 deletions crm_phonecall_summary_predefined/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
- Vicent Cubells
- Cristina Martín
- Víctor Martínez
- Carolina Fernandez
- Anand Kansagra \<<[email protected]>\>
15 changes: 9 additions & 6 deletions crm_phonecall_summary_predefined/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -391,8 +392,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>To configure the possible summary options:</p>
<ol class="arabic simple">
<li>Activate the developer mode</li>
<li>Go to <em>CRM &gt; Configuration &gt; Leads &amp; Opportunities &gt; Phone Calls &gt;
Summaries</em>.</li>
<li>Go to <em>CRM &gt; Configuration &gt; Phone Calls &gt; Summaries</em>.</li>
<li>Add or modify types there.</li>
</ol>
</div>
Expand Down Expand Up @@ -428,6 +428,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Vicent Cubells</li>
<li>Cristina Martín</li>
<li>Víctor Martínez</li>
<li>Carolina Fernandez</li>
</ul>
</li>
<li>Anand Kansagra &lt;<a class="reference external" href="mailto:kansagraanand&#64;hotmail.com">kansagraanand&#64;hotmail.com</a>&gt;</li>
Expand All @@ -436,7 +437,9 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 Antiun Ingeniería S.L. - Jairo Llopis
Copyright 2017 Tecnativa - Vicent Cubells
Copyright 2024 Tecnativa - Carolina Fernandez
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -->
<odoo>
<record id="crm_case_inbound_phone_tree_view" model="ir.ui.view">
Expand All @@ -9,7 +10,7 @@
<field name="inherit_id" ref="crm_phonecall.crm_case_inbound_phone_tree_view" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="invisible">True</attribute>
<attribute name="column_invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="after">
<field name="summary_id" />
Expand Down

0 comments on commit 247c834

Please sign in to comment.