Skip to content

Commit

Permalink
[MIG] crm_phonecall: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeliconiaSolutions committed Nov 29, 2024
1 parent 7df516b commit f48d973
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 92 deletions.
46 changes: 24 additions & 22 deletions crm_phonecall/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ CRM Phone Calls
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github
:target: https://github.com/OCA/crm/tree/17.0/crm_phonecall
:target: https://github.com/OCA/crm/tree/18.0/crm_phonecall
:alt: OCA/crm
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/crm-17-0/crm-17-0-crm_phonecall
:target: https://translation.odoo-community.org/projects/crm-18-0/crm-18-0-crm_phonecall
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -52,16 +52,16 @@ To use this module, you need to:
Known issues / Roadmap
======================

- Simplify the function schedule_another_phonecall returning always a
recordset
- Simplify the function schedule_another_phonecall returning always a
recordset

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_phonecall%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_phonecall%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -77,26 +77,28 @@ Authors
Contributors
------------

- Odoo S.A.
- `Tecnativa <https://www.tecnativa.com>`__
- Odoo S.A.
- `Tecnativa <https://www.tecnativa.com>`__

- Vicent Cubells
- Jairo Llopis
- David Vidal
- Alexandre Díaz
- Stefan Ungureanu
- Vicent Cubells
- Jairo Llopis
- David Vidal
- Alexandre Díaz
- Stefan Ungureanu

- RIDA YAHLA <mireda2012@gmail.com>
- Anand Kansagra <kansagraanand@hotmail.com>
- `Druidoo <https://www.druidoo.io>`__
- RIDA YAHLA <mireda2012@gmail.com>
- Anand Kansagra <kansagraanand@hotmail.com>
- `Druidoo <https://www.druidoo.io>`__

- Iván Todorovich <ivan.todorovich@druidoo.io>
- Manuel Marquez <manuel.marquez@druidoo.io>
- Iván Todorovich <ivan.todorovich@druidoo.io>
- Manuel Marquez <manuel.marquez@druidoo.io>

- Ruchir Shukla <ruchir@bizzappdev.com>
- `APSL-Nagarro <https://apsl.tech>`__:
- Ruchir Shukla <ruchir@bizzappdev.com>
- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <amarroig@apsl.net>
- Antoni Marroig <amarroig@apsl.net>

- Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>

Maintainers
-----------
Expand All @@ -111,6 +113,6 @@ 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.

This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/17.0/crm_phonecall>`_ project on GitHub.
This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/18.0/crm_phonecall>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion crm_phonecall/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "CRM Phone Calls",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Customer Relationship Management",
"author": "Odoo S.A., Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/crm",
Expand Down
1 change: 1 addition & 0 deletions crm_phonecall/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
- Ruchir Shukla \<<ruchir@bizzappdev.com>\>
- [APSL-Nagarro](https://apsl.tech):
- Antoni Marroig \<<amarroig@apsl.net>\>
- Heliconia Solutions Pvt. Ltd. \<<https://www.heliconia.io>\>
6 changes: 3 additions & 3 deletions crm_phonecall/report/crm_phonecall_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class CrmPhonecallReport(models.Model):
string="Delay to close",
digits=(16, 2),
readonly=True,
group_operator="avg",
aggregator="avg",
help="Number of Days to close the case",
)
duration = fields.Float(digits=(16, 2), readonly=True, group_operator="avg")
duration = fields.Float(digits=(16, 2), readonly=True, aggregator="avg")
delay_open = fields.Float(
string="Delay to open",
digits=(16, 2),
readonly=True,
group_operator="avg",
aggregator="avg",
help="Number of Days to open the case",
)
partner_id = fields.Many2one(
Expand Down
7 changes: 4 additions & 3 deletions crm_phonecall/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">CRM Phone Calls</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:77200b8ed63c074c39a2d3a2b9d9a6dbc097dc9183965355d04f29afbbc1975f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/crm/tree/17.0/crm_phonecall"><img alt="OCA/crm" src="https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/crm-17-0/crm-17-0-crm_phonecall"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/crm&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/crm/tree/18.0/crm_phonecall"><img alt="OCA/crm" src="https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/crm-18-0/crm-18-0-crm_phonecall"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/crm&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to manage phone calls in order to analyze them.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -411,7 +411,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/crm/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/crm/issues/new?body=module:%20crm_phonecall%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/crm/issues/new?body=module:%20crm_phonecall%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -447,6 +447,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
<li>Heliconia Solutions Pvt. Ltd. &lt;<a class="reference external" href="https://www.heliconia.io">https://www.heliconia.io</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -458,7 +459,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<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>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/crm/tree/17.0/crm_phonecall">OCA/crm</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/crm/tree/18.0/crm_phonecall">OCA/crm</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
110 changes: 62 additions & 48 deletions crm_phonecall/tests/test_crm_phonecall.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,77 @@ def setUpClass(cls):
super().setUpClass()
cls.company = cls.env.ref("base.main_company")
partner_obj = cls.env["res.partner"]
cls.campaign1 = cls.env["utm.campaign"].create({"name": "campaign 1"})
cls.source1 = cls.env["utm.source"].create({"name": "source 1"})
cls.medium1 = cls.env["utm.medium"].create({"name": "medium 1"})
cls.campaign1 = cls.env["utm.campaign"].create([{"name": "campaign 1"}])
cls.source1 = cls.env["utm.source"].create([{"name": "source 1"}])
cls.medium1 = cls.env["utm.medium"].create([{"name": "medium 1"}])
cls.partner1 = partner_obj.create(
{
"name": "Partner1",
"phone": "123 456 789",
"mobile": "123 456 789",
"type": "contact",
}
[
{
"name": "Partner1",
"phone": "123 456 789",
"mobile": "123 456 789",
"type": "contact",
}
]
)
cls.partner2 = partner_obj.create(
{"name": "Partner2", "phone": "789 654 321", "mobile": "789 654 321"}
[{"name": "Partner2", "phone": "789 654 321", "mobile": "789 654 321"}]
)
cls.phonecall1 = cls.env["crm.phonecall"].create(
{
"name": "Call #1 for test",
"partner_id": cls.partner1.id,
"campaign_id": cls.campaign1.id,
"source_id": cls.source1.id,
"medium_id": cls.medium1.id,
}
[
{
"name": "Call #1 for test",
"partner_id": cls.partner1.id,
"campaign_id": cls.campaign1.id,
"source_id": cls.source1.id,
"medium_id": cls.medium1.id,
}
]
)
cls.phonecall2 = cls.env["crm.phonecall"].create(
{
"name": "Call #2 for test",
"partner_phone": "123 456 789",
"partner_mobile": "987 654 321",
"campaign_id": cls.campaign1.id,
"source_id": cls.source1.id,
"medium_id": cls.medium1.id,
}
[
{
"name": "Call #2 for test",
"partner_phone": "123 456 789",
"partner_mobile": "987 654 321",
"campaign_id": cls.campaign1.id,
"source_id": cls.source1.id,
"medium_id": cls.medium1.id,
}
]
)
cls.opportunity1 = cls.env["crm.lead"].create(
{
"name": "Opportunity #1",
"phone": "111 111 111",
"mobile": "222 222 222",
"partner_id": cls.partner1.id,
}
[
{
"name": "Opportunity #1",
"phone": "111 111 111",
"mobile": "222 222 222",
"partner_id": cls.partner1.id,
}
]
)
cls.opportunity2 = cls.env["crm.lead"].create(
{
"name": "Opportunity #2",
"phone": "222 222 222",
"mobile": "333 333 333",
"partner_id": cls.partner2.id,
}
[
{
"name": "Opportunity #2",
"phone": "222 222 222",
"mobile": "333 333 333",
"partner_id": cls.partner2.id,
}
]
)
cls.tag = cls.env.ref("sales_team.categ_oppor1")

def test_compute_phonecall_count_partner(self):
partner = self.env["res.partner"].create(
{"name": "Partner3", "phone": "123 654 007", "mobile": "123 654 007"}
[{"name": "Partner3", "phone": "123 654 007", "mobile": "123 654 007"}]
)
phonecall = self.env["crm.phonecall"].create(
{
"name": "Call #2 for test",
}
[
{
"name": "Call #2 for test",
}
]
)
phonecall_form = Form(phonecall)
phonecall_form.partner_id = partner
Expand All @@ -80,14 +92,16 @@ def test_compute_phonecall_count_partner(self):

def test_compute_duration(self):
partner = self.env["res.partner"].create(
{"name": "Partner4", "phone": "123 456 007", "mobile": "123 456 007"}
[{"name": "Partner4", "phone": "123 456 007", "mobile": "123 456 007"}]
)
phonecall = self.env["crm.phonecall"].create(
{
"name": "Call #3 for test",
"partner_id": partner.id,
"duration": 1,
}
[
{
"name": "Call #3 for test",
"partner_id": partner.id,
"duration": 1,
}
]
)
phonecall.compute_duration()
self.assertEqual(phonecall.duration, 0.0)
Expand Down Expand Up @@ -168,7 +182,7 @@ def test_wizard(self):
wizard = (
self.env["crm.phonecall2phonecall"]
.with_context(active_ids=self.phonecall1.ids, active_id=self.phonecall1.id)
.create({})
.create([{}])
)
result = wizard.action_schedule()
search_view_id = self.env.ref(
Expand Down
Loading

0 comments on commit f48d973

Please sign in to comment.