diff --git a/crm_phonecall_result/README.rst b/crm_phonecall_result/README.rst new file mode 100644 index 00000000000..1fcdc4c9e49 --- /dev/null +++ b/crm_phonecall_result/README.rst @@ -0,0 +1,91 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +==================== +Crm Phonecall Result +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a785005a087b4de18fdd407e656e124277d77b37e64addbe44759cb2d990aeb6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :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/19.0/crm_phonecall_result + :alt: OCA/crm +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/crm-19-0/crm-19-0-crm_phonecall_result + :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=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds a field to set the result of CRM phone calls, allows creating new +result options, and enables filtering and grouping by call result. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. In CRM > Configuration > Calls, you can define new phone call + results. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Contributors +------------ + +- `Sygel `__: + + - Ángel Rivas + - Valentín Vinagre + +- CIT-Services <> + + - Prayag + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/crm_phonecall_result/__init__.py b/crm_phonecall_result/__init__.py new file mode 100644 index 00000000000..91fd52a41ba --- /dev/null +++ b/crm_phonecall_result/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models +from . import report diff --git a/crm_phonecall_result/__manifest__.py b/crm_phonecall_result/__manifest__.py new file mode 100644 index 00000000000..6ccb1b15e95 --- /dev/null +++ b/crm_phonecall_result/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2025 Ángel Rivas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Crm Phonecall Result", + "summary": "Adds phone call result tracking and reporting to CRM phonecalls", + "version": "19.0.1.0.0", + "category": "Partner Management", + "website": "https://github.com/OCA/crm", + "author": "Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["crm_phonecall", "sales_team"], + "data": [ + "security/ir.model.access.csv", + "data/crm_phonecall_result_data.xml", + "views/crm_phonecall_result_views.xml", + "views/crm_phonecall_views.xml", + ], +} diff --git a/crm_phonecall_result/data/crm_phonecall_result_data.xml b/crm_phonecall_result/data/crm_phonecall_result_data.xml new file mode 100644 index 00000000000..c6db92e9c50 --- /dev/null +++ b/crm_phonecall_result/data/crm_phonecall_result_data.xml @@ -0,0 +1,11 @@ + + + Positive + + + Negative + + + Wrong number + + diff --git a/crm_phonecall_result/i18n/ca.po b/crm_phonecall_result/i18n/ca.po new file mode 100644 index 00000000000..3b91ba782d0 --- /dev/null +++ b/crm_phonecall_result/i18n/ca.po @@ -0,0 +1,131 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_phonecall_result +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-07-25 08:21+0000\n" +"PO-Revision-Date: 2026-02-13 10:09+0000\n" +"Last-Translator: Javier Iza Ca \n" +"Language-Team: \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/tests/test_crm_phonecall_result.py:0 +msgid "%s (Copy)" +msgstr "%s (Còpia)" + +#. module: crm_phonecall_result +#: model_terms:ir.ui.view,arch_db:crm_phonecall_result.view_crm_phonecall_search_inherit_result +msgid "Call result" +msgstr "Resultat de la trucada" + +#. module: crm_phonecall_result +#: model:ir.actions.act_window,name:crm_phonecall_result.action_crm_phonecall_result +#: model:ir.ui.menu,name:crm_phonecall_result.menu_crm_phonecall_result +msgid "Call results" +msgstr "Resultats de la trucada" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_uid +msgid "Created by" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_date +msgid "Created on" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__description +msgid "Description" +msgstr "Descripció" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__id +msgid "ID" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_date +msgid "Last Updated on" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__name +msgid "Name" +msgstr "Nom" + +#. module: crm_phonecall_result +#: model:ir.model.constraint,message:crm_phonecall_result.constraint_crm_phonecall_result_name_uniq +msgid "Name must be unique" +msgstr "El nom ha de ser únic" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_negative +msgid "Negative" +msgstr "Negatiu" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_report__phone_result_id +msgid "Phone Result" +msgstr "Resultat del telèfon" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_report +msgid "Phone calls by user" +msgstr "Trucades per usuari/ària" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall +msgid "Phonecall" +msgstr "Trucada" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_result +msgid "Phonecall Result" +msgstr "Resultat de la trucada" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_positive +msgid "Positive" +msgstr "Positiu" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__priority +msgid "Priority" +msgstr "prioritat" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall__phone_result_id +msgid "Result call" +msgstr "Resultat de la trucada" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_wrong_number +msgid "Wrong number" +msgstr "Número incorrecte" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/models/crm_phonecall_result.py:0 +msgid "{} (Copy)" +msgstr "{} (Còpia)" diff --git a/crm_phonecall_result/i18n/crm_phonecall_result.pot b/crm_phonecall_result/i18n/crm_phonecall_result.pot new file mode 100644 index 00000000000..99909ede3f3 --- /dev/null +++ b/crm_phonecall_result/i18n/crm_phonecall_result.pot @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_phonecall_result +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/tests/test_crm_phonecall_result.py:0 +msgid "%s (Copy)" +msgstr "" + +#. module: crm_phonecall_result +#: model_terms:ir.ui.view,arch_db:crm_phonecall_result.view_crm_phonecall_search_inherit_result +msgid "Call result" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.actions.act_window,name:crm_phonecall_result.action_crm_phonecall_result +#: model:ir.ui.menu,name:crm_phonecall_result.menu_crm_phonecall_result +msgid "Call results" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_uid +msgid "Created by" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_date +msgid "Created on" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__description +msgid "Description" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__id +msgid "ID" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_date +msgid "Last Updated on" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__name +msgid "Name" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.constraint,message:crm_phonecall_result.constraint_crm_phonecall_result_name_uniq +msgid "Name must be unique" +msgstr "" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_negative +msgid "Negative" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_report__phone_result_id +msgid "Phone Result" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_report +msgid "Phone calls by user" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall +msgid "Phonecall" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_result +msgid "Phonecall Result" +msgstr "" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_positive +msgid "Positive" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__priority +msgid "Priority" +msgstr "" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall__phone_result_id +msgid "Result call" +msgstr "" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_wrong_number +msgid "Wrong number" +msgstr "" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/models/crm_phonecall_result.py:0 +msgid "{} (Copy)" +msgstr "" diff --git a/crm_phonecall_result/i18n/es.po b/crm_phonecall_result/i18n/es.po new file mode 100644 index 00000000000..df18f80fb39 --- /dev/null +++ b/crm_phonecall_result/i18n/es.po @@ -0,0 +1,131 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_phonecall_result +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-07-24 06:13+0000\n" +"PO-Revision-Date: 2026-05-10 09:51+0000\n" +"Last-Translator: Ed-Spain \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/tests/test_crm_phonecall_result.py:0 +msgid "%s (Copy)" +msgstr "%s (Copia)" + +#. module: crm_phonecall_result +#: model_terms:ir.ui.view,arch_db:crm_phonecall_result.view_crm_phonecall_search_inherit_result +msgid "Call result" +msgstr "Resultado de la llamada" + +#. module: crm_phonecall_result +#: model:ir.actions.act_window,name:crm_phonecall_result.action_crm_phonecall_result +#: model:ir.ui.menu,name:crm_phonecall_result.menu_crm_phonecall_result +msgid "Call results" +msgstr "Resultados de la llamada" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__description +msgid "Description" +msgstr "Descripción" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__display_name +msgid "Display Name" +msgstr "Mostrar nombre" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__id +msgid "ID" +msgstr "ID" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__name +msgid "Name" +msgstr "Nombre" + +#. module: crm_phonecall_result +#: model:ir.model.constraint,message:crm_phonecall_result.constraint_crm_phonecall_result_name_uniq +msgid "Name must be unique" +msgstr "El nombre debe ser único" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_negative +msgid "Negative" +msgstr "Negativo" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_report__phone_result_id +msgid "Phone Result" +msgstr "Resultado del teléfono" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_report +msgid "Phone calls by user" +msgstr "Llamadas por usuario" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall +msgid "Phonecall" +msgstr "Llamada telefónica" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_result +msgid "Phonecall Result" +msgstr "Resultado de la llamada telefónica" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_positive +msgid "Positive" +msgstr "Positivo" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__priority +msgid "Priority" +msgstr "Prioridad" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall__phone_result_id +msgid "Result call" +msgstr "Resultado de la llamada" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_wrong_number +msgid "Wrong number" +msgstr "Número erróneo" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/models/crm_phonecall_result.py:0 +msgid "{} (Copy)" +msgstr "{} (Copiar)" diff --git a/crm_phonecall_result/i18n/it.po b/crm_phonecall_result/i18n/it.po new file mode 100644 index 00000000000..10a8d3e1cd9 --- /dev/null +++ b/crm_phonecall_result/i18n/it.po @@ -0,0 +1,130 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_phonecall_result +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-09-09 11:43+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/tests/test_crm_phonecall_result.py:0 +msgid "%s (Copy)" +msgstr "%s (copia)" + +#. module: crm_phonecall_result +#: model_terms:ir.ui.view,arch_db:crm_phonecall_result.view_crm_phonecall_search_inherit_result +msgid "Call result" +msgstr "Risultato chiamata" + +#. module: crm_phonecall_result +#: model:ir.actions.act_window,name:crm_phonecall_result.action_crm_phonecall_result +#: model:ir.ui.menu,name:crm_phonecall_result.menu_crm_phonecall_result +msgid "Call results" +msgstr "Risultati chiamata" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__description +msgid "Description" +msgstr "Descrizione" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__id +msgid "ID" +msgstr "ID" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__name +msgid "Name" +msgstr "Nome" + +#. module: crm_phonecall_result +#: model:ir.model.constraint,message:crm_phonecall_result.constraint_crm_phonecall_result_name_uniq +msgid "Name must be unique" +msgstr "Il nome deve essere univoco" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_negative +msgid "Negative" +msgstr "Negativo" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_report__phone_result_id +msgid "Phone Result" +msgstr "Risultato telefono" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_report +msgid "Phone calls by user" +msgstr "Telefonate per utente" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall +msgid "Phonecall" +msgstr "Chiamata telefonica" + +#. module: crm_phonecall_result +#: model:ir.model,name:crm_phonecall_result.model_crm_phonecall_result +msgid "Phonecall Result" +msgstr "Risultato chiamata telefonica" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_positive +msgid "Positive" +msgstr "Positivo" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall_result__priority +msgid "Priority" +msgstr "Priorità" + +#. module: crm_phonecall_result +#: model:ir.model.fields,field_description:crm_phonecall_result.field_crm_phonecall__phone_result_id +msgid "Result call" +msgstr "Chiamata risultato" + +#. module: crm_phonecall_result +#: model:crm.phonecall.result,name:crm_phonecall_result.phonecall_result_wrong_number +msgid "Wrong number" +msgstr "Numero errato" + +#. module: crm_phonecall_result +#. odoo-python +#: code:addons/crm_phonecall_result/models/crm_phonecall_result.py:0 +msgid "{} (Copy)" +msgstr "{} (copia)" diff --git a/crm_phonecall_result/models/__init__.py b/crm_phonecall_result/models/__init__.py new file mode 100644 index 00000000000..c8a97aedbde --- /dev/null +++ b/crm_phonecall_result/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import crm_phonecall +from . import crm_phonecall_result diff --git a/crm_phonecall_result/models/crm_phonecall.py b/crm_phonecall_result/models/crm_phonecall.py new file mode 100644 index 00000000000..2e16b2c4f83 --- /dev/null +++ b/crm_phonecall_result/models/crm_phonecall.py @@ -0,0 +1,13 @@ +# Copyright 2025 Ángel Rivas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class CRMPhonecall(models.Model): + _inherit = "crm.phonecall" + + phone_result_id = fields.Many2one( + comodel_name="crm.phonecall.result", + string="Result call", + ) diff --git a/crm_phonecall_result/models/crm_phonecall_result.py b/crm_phonecall_result/models/crm_phonecall_result.py new file mode 100644 index 00000000000..9f8379485d2 --- /dev/null +++ b/crm_phonecall_result/models/crm_phonecall_result.py @@ -0,0 +1,25 @@ +# Copyright 2025 Ángel Rivas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class CrmPhonecallResult(models.Model): + _name = "crm.phonecall.result" + _description = "Phonecall Result" + _order = "priority" + + name = fields.Char(required=True, translate=True) + description = fields.Text() + priority = fields.Integer(default=10) + + _name_uniq = models.Constraint( + "unique (name)", + "Name must be unique", + ) + + def copy(self, default=None): + default = dict(default or {}) + if "name" not in default: + default["name"] = self.env._("%s (Copy)", self.name) + return super().copy(default=default) diff --git a/crm_phonecall_result/pyproject.toml b/crm_phonecall_result/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/crm_phonecall_result/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_phonecall_result/readme/CONTRIBUTORS.md b/crm_phonecall_result/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..e199032714b --- /dev/null +++ b/crm_phonecall_result/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- [Sygel](https://www.sygel.es): + - Ángel Rivas + - Valentín Vinagre +- CIT-Services \<\> + - Prayag \<\> diff --git a/crm_phonecall_result/readme/DESCRIPTION.md b/crm_phonecall_result/readme/DESCRIPTION.md new file mode 100644 index 00000000000..cd962102745 --- /dev/null +++ b/crm_phonecall_result/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Adds a field to set the result of CRM phone calls, allows creating new result options, and enables filtering and grouping by call result. diff --git a/crm_phonecall_result/readme/USAGE.md b/crm_phonecall_result/readme/USAGE.md new file mode 100644 index 00000000000..ac9ed587e79 --- /dev/null +++ b/crm_phonecall_result/readme/USAGE.md @@ -0,0 +1,3 @@ +To use this module, you need to: + +1. In CRM > Configuration > Calls, you can define new phone call results. diff --git a/crm_phonecall_result/report/__init__.py b/crm_phonecall_result/report/__init__.py new file mode 100644 index 00000000000..7c4f5c429bd --- /dev/null +++ b/crm_phonecall_result/report/__init__.py @@ -0,0 +1 @@ +from . import crm_phonecall_report diff --git a/crm_phonecall_result/report/crm_phonecall_report.py b/crm_phonecall_result/report/crm_phonecall_report.py new file mode 100644 index 00000000000..57531964680 --- /dev/null +++ b/crm_phonecall_result/report/crm_phonecall_report.py @@ -0,0 +1,13 @@ +# Copyright 2025 Ángel Rivas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class CrmPhonecallReport(models.Model): + _inherit = "crm.phonecall.report" + + phone_result_id = fields.Many2one("crm.phonecall.result") + + def _select(self): + return super()._select() + ", c.phone_result_id" diff --git a/crm_phonecall_result/security/ir.model.access.csv b/crm_phonecall_result/security/ir.model.access.csv new file mode 100644 index 00000000000..2c5cd1ea972 --- /dev/null +++ b/crm_phonecall_result/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_phonecall_result_partner_manager,phonecall_result_partner_manager,model_crm_phonecall_result,base.group_partner_manager,1,0,0,0 +access_phonecall_result_salesman,phonecall_result_salesman,model_crm_phonecall_result,sales_team.group_sale_salesman,1,0,0,0 +access_phonecall_result_sales_manager,phonecall_result_sales_manager,model_crm_phonecall_result,sales_team.group_sale_manager,1,1,1,1 diff --git a/crm_phonecall_result/static/description/icon.png b/crm_phonecall_result/static/description/icon.png new file mode 100755 index 00000000000..207fb7ad553 Binary files /dev/null and b/crm_phonecall_result/static/description/icon.png differ diff --git a/crm_phonecall_result/static/description/index.html b/crm_phonecall_result/static/description/index.html new file mode 100644 index 00000000000..beb30fc80d1 --- /dev/null +++ b/crm_phonecall_result/static/description/index.html @@ -0,0 +1,440 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Crm Phonecall Result

+ +

Beta License: AGPL-3 OCA/crm Translate me on Weblate Try me on Runboat

+

Adds a field to set the result of CRM phone calls, allows creating new +result options, and enables filtering and grouping by call result.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. In CRM > Configuration > Calls, you can define new phone call +results.
  2. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/crm_phonecall_result/tests/__init__.py b/crm_phonecall_result/tests/__init__.py new file mode 100644 index 00000000000..bf37fafbce9 --- /dev/null +++ b/crm_phonecall_result/tests/__init__.py @@ -0,0 +1 @@ +from . import test_crm_phonecall_result diff --git a/crm_phonecall_result/tests/test_crm_phonecall_result.py b/crm_phonecall_result/tests/test_crm_phonecall_result.py new file mode 100644 index 00000000000..26694c4db7b --- /dev/null +++ b/crm_phonecall_result/tests/test_crm_phonecall_result.py @@ -0,0 +1,215 @@ +# Copyright 2025 Ángel Rivas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from psycopg2 import IntegrityError + +from odoo.exceptions import AccessError +from odoo.tests import Form, tagged +from odoo.tests.common import TransactionCase +from odoo.tools import mute_logger + + +@tagged("post_install", "-at_install") +class TestCrmPhonecallResult(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.ReportModel = cls.env["crm.phonecall.report"] + cls.test_result = cls.env["crm.phonecall.result"].create( + { + "name": "Test result", + "description": "Test result description", + "priority": 5, + } + ) + + cls.user_salesman = cls.env["res.users"].create( + { + "name": "Test Salesman", + "login": "test_salesman_phone_result", + "email": "salesman_phone_result@example.com", + "group_ids": [ + (6, 0, [cls.env.ref("sales_team.group_sale_salesman").id]) + ], + } + ) + cls.user_manager = cls.env["res.users"].create( + { + "name": "Test Sales Manager", + "login": "test_salesmanager_phone_result", + "email": "salesmanager_phone_result@example.com", + "group_ids": [ + (6, 0, [cls.env.ref("sales_team.group_sale_manager").id]) + ], + } + ) + + def test_create_result(self): + self.assertEqual(self.test_result.name, "Test result") + self.assertEqual(self.test_result.description, "Test result description") + self.assertEqual(self.test_result.priority, 5) + + def test_name_unique_constraint(self): + """Ensure duplicate names raise an IntegrityError per models.Constraint.""" + with self.assertRaises(IntegrityError), mute_logger("odoo.sql_db"): + self.env["crm.phonecall.result"].create({"name": self.test_result.name}) + + def test_copy(self): + copied_record = self.test_result.copy() + self.assertNotEqual(copied_record.name, self.test_result.name) + self.assertEqual( + copied_record.name, self.env._("%s (Copy)", self.test_result.name) + ) + + # Test copying with explicit name in default dict + custom_copy = self.test_result.copy(default={"name": "Explicit Name"}) + self.assertEqual(custom_copy.name, "Explicit Name") + + def test_priority_order(self): + """Test that phonecall results search order respects priority.""" + res_low = self.env["crm.phonecall.result"].create( + {"name": "Low Priority Result", "priority": 1} + ) + res_high = self.env["crm.phonecall.result"].create( + {"name": "High Priority Result", "priority": 99} + ) + results = self.env["crm.phonecall.result"].search( + [("id", "in", [res_low.id, res_high.id])] + ) + self.assertEqual(results[0], res_low) + self.assertEqual(results[1], res_high) + + def test_default_data_records(self): + """Ensure default records created via XML data files exist.""" + positive = self.env.ref( + "crm_phonecall_result.phonecall_result_positive", raise_if_not_found=False + ) + negative = self.env.ref( + "crm_phonecall_result.phonecall_result_negative", raise_if_not_found=False + ) + wrong_num = self.env.ref( + "crm_phonecall_result.phonecall_result_wrong_number", + raise_if_not_found=False, + ) + + if positive: + self.assertEqual(positive.name, "Positive") + if negative: + self.assertEqual(negative.name, "Negative") + if wrong_num: + self.assertEqual(wrong_num.name, "Wrong number") + + def test_access_rights_salesman(self): + """Salesman can read call results but cannot create, modify or delete them.""" + result_as_salesman = self.test_result.with_user(self.user_salesman) + # Read permission granted + self.assertEqual(result_as_salesman.name, "Test result") + + # Create forbidden + with self.assertRaises(AccessError): + self.env["crm.phonecall.result"].with_user(self.user_salesman).create( + {"name": "Forbidden Result"} + ) + + # Write forbidden + with self.assertRaises(AccessError): + result_as_salesman.write({"name": "New Name"}) + + # Unlink forbidden + with self.assertRaises(AccessError): + result_as_salesman.unlink() + + def test_access_rights_manager(self): + """Sales Manager has full access to crm.phonecall.result.""" + res_mgr = ( + self.env["crm.phonecall.result"] + .with_user(self.user_manager) + .create({"name": "Manager Created Result"}) + ) + self.assertEqual(res_mgr.name, "Manager Created Result") + + res_mgr.write({"name": "Manager Updated Result"}) + self.assertEqual(res_mgr.name, "Manager Updated Result") + + res_mgr.unlink() + self.assertFalse(res_mgr.exists()) + + def test_report_view_exists(self): + """Ensure the report view loads without error and _select query is executed.""" + select_clause = self.ReportModel._select() + self.assertIn("c.phone_result_id", select_clause) + + records = self.ReportModel.search([], limit=1) + self.assertIsNotNone(records) + + def test_field_phone_result_id_exists(self): + """Ensure the custom field phone_result_id is present in the model.""" + fields = self.ReportModel.fields_get() + self.assertIn("phone_result_id", fields) + + def test_phonecall_assignment_and_report(self): + """Test creating a phone call with phone_result_id and querying report.""" + call = self.env["crm.phonecall"].create( + { + "name": "Test Workflow Phone Call", + "phone_result_id": self.test_result.id, + } + ) + self.assertEqual(call.phone_result_id, self.test_result) + + report_records = self.ReportModel.search( + [("phone_result_id", "=", self.test_result.id)] + ) + self.assertIsNotNone(report_records) + + def test_phonecall_form_view(self): + """Test assigning phone_result_id via Form view on crm.phonecall.""" + phonecall_form = Form(self.env["crm.phonecall"]) + phonecall_form.name = "Form Test Call" + phonecall_form.phone_result_id = self.test_result + call = phonecall_form.save() + + self.assertEqual(call.name, "Form Test Call") + self.assertEqual(call.phone_result_id, self.test_result) + + def test_phonecall_search_and_groupby(self): + """Test filtering and grouping phone calls by phone_result_id.""" + call1 = self.env["crm.phonecall"].create( + { + "name": "Call with result", + "phone_result_id": self.test_result.id, + } + ) + call2 = self.env["crm.phonecall"].create( + { + "name": "Call without result", + } + ) + calls_with_result = self.env["crm.phonecall"].search( + [("phone_result_id", "!=", False)] + ) + self.assertIn(call1, calls_with_result) + self.assertNotIn(call2, calls_with_result) + + grouped = self.env["crm.phonecall"]._read_group( + [("id", "in", [call1.id, call2.id])], + groupby=["phone_result_id"], + ) + grouped_result_records = [g[0] for g in grouped] + self.assertIn(self.test_result, grouped_result_records) + + def test_report_read_group(self): + """Test reporting _read_group with phone_result_id.""" + self.env["crm.phonecall"].create( + { + "name": "Report Group Test Call", + "phone_result_id": self.test_result.id, + } + ) + grouped_report = self.ReportModel._read_group( + [("phone_result_id", "=", self.test_result.id)], + groupby=["phone_result_id"], + ) + self.assertTrue(grouped_report) + self.assertEqual(grouped_report[0][0], self.test_result) diff --git a/crm_phonecall_result/views/crm_phonecall_result_views.xml b/crm_phonecall_result/views/crm_phonecall_result_views.xml new file mode 100644 index 00000000000..6cd036c4056 --- /dev/null +++ b/crm_phonecall_result/views/crm_phonecall_result_views.xml @@ -0,0 +1,44 @@ + + + crm.phonecall.result.list + crm.phonecall.result + + + + + + + + + + crm.phonecall.result.form + crm.phonecall.result + +
+ + +

+ +

+
+ + + +
+
+
+
+ + Call results + crm.phonecall.result + list,form + + + +
diff --git a/crm_phonecall_result/views/crm_phonecall_views.xml b/crm_phonecall_result/views/crm_phonecall_views.xml new file mode 100644 index 00000000000..c16ec29b101 --- /dev/null +++ b/crm_phonecall_result/views/crm_phonecall_views.xml @@ -0,0 +1,57 @@ + + + + crm.phonecall.form.inherit.result + crm.phonecall + + + + + + + + + crm.phonecall.list.inherit.result + crm.phonecall + + + + + + + + + crm.phonecall.search.inherit.result + crm.phonecall + + + + + + + + + + + + + + + crm.phonecall.pivot.inherit.result + crm.phonecall.report + + + + + + + +