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][ADD] phone_query: Add a new module #1973

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
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
95 changes: 95 additions & 0 deletions phone_query/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
===========
Phone Query
===========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:94df2a7f4f2426677373a51e28bd29aecba9f832bb97c1a75ca7ac4ed75379e3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/licence-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%2Fpartner--contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner-contact/tree/16.0/phone_query
:alt: OCA/partner-contact
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-phone_query
: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/partner-contact&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to search and list partners through their phone
numbers from the url input in browser

**Table of contents**

.. contents::
:local:

Usage
=====

You can type &phone_number=123456789 in the url of odoo webclient

Example:
http://localhost:8069/web#action=330&cids=1&menu_id=224&phone_number=588

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/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/partner-contact/issues/new?body=module:%20phone_query%0Aversion:%2016.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.

Credits
=======

Authors
-------

* Kencove

Contributors
------------

- `Kencove <https://www.kencove.com>`__:

- Mohamed Alkobrosli

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.

.. |maintainer-Kencove| image:: https://github.com/Kencove.png?size=40px
:target: https://github.com/Kencove
:alt: Kencove

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Kencove|

This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/16.0/phone_query>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions phone_query/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import controllers
27 changes: 27 additions & 0 deletions phone_query/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2025 Kencove - Mohamed Alkobrosli - (https://www.kencove.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Phone Query",
"version": "16.0.1.0.0",
"category": "Customer Relationship Management",
"summary": """
Enable the internal user of querying the partner number in browser""",
"author": "Kencove, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
"license": "AGPL-3",
"maintainers": ["Kencove"],
"depends": ["phone_validation"],
"data": [
"views/query_phone_number.xml",
],
"assets": {
"web.assets_backend": [
"phone_query/static/src/phone_query_service.esm.js",
"phone_query/static/src/template.xml",
"phone_query/static/src/phone_query.esm.js",
],
},
"installable": True,
"auto_install": False,
}
1 change: 1 addition & 0 deletions phone_query/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
20 changes: 20 additions & 0 deletions phone_query/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 Kencove - Mohamed Alkobrosli
# (<http://www.savoirfairelinux.com>).

from odoo import http
from odoo.http import request


class DashboardController(http.Controller):
@http.route("/queries/<string:number>", type="json", auth="user")
def get_dashboard_data(self, number, **kw):
if kw["model"] and kw["operator"] and number:
partner = request.env[kw["model"]]
domain = partner._search_phone_mobile_search(

Check warning on line 13 in phone_query/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

phone_query/controllers/main.py#L12-L13

Added lines #L12 - L13 were not covered by tests
operator=kw["operator"], value=number
)
return {

Check warning on line 16 in phone_query/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

phone_query/controllers/main.py#L16

Added line #L16 was not covered by tests
"domain": domain,
}
else:
return [(1, "=", 0)]

Check warning on line 20 in phone_query/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

phone_query/controllers/main.py#L20

Added line #L20 was not covered by tests
2 changes: 2 additions & 0 deletions phone_query/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Kencove](https://www.kencove.com):
- Mohamed Alkobrosli
1 change: 1 addition & 0 deletions phone_query/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to search and list partners through their phone numbers from the url input in browser
3 changes: 3 additions & 0 deletions phone_query/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You can type &phone_number=123456789 in the url of odoo webclient

Example: http://localhost:8069/web#action=330&cids=1&menu_id=224&phone_number=588
Binary file added phone_query/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading