Skip to content
Merged
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
106 changes: 106 additions & 0 deletions endpoint_jsonifier/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
==================
Endpoint JSONifier
==================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb--api-lightgray.png?logo=github
:target: https://github.com/OCA/web-api/tree/18.0/endpoint_jsonifier
:alt: OCA/web-api
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-endpoint_jsonifier
: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/web-api&target_branch=18.0
:alt: Try me on Runboat

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

This addon allows configuring an exporter for endpoints to be used in
code snippets.

**Table of contents**

.. contents::
:local:

Usage
=====

This module by itself contains no business logic, but its configuration
can be used to manage endpoints' data export.

For example:

.. code:: python

parser = endpoint.export_id.get_json_parser()
prod_domain = [("sale_ok", "=", True)]
prod_data = env["product.product"].search(prod_domain).jsonify(parser)
resp = Response(json.dumps(prod_data), content_type="application/json", status=200)
result = dict(response=resp)

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web-api/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/web-api/issues/new?body=module:%20endpoint_jsonifier%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.

Credits
=======

Authors
-------

* Camptocamp

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

- `Camptocamp SA <https://camptocamp.com>`__:

- Silvio Gregorini <silvio.gregorini@camptocamp.com>

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-SilvioC2C| image:: https://github.com/SilvioC2C.png?size=40px
:target: https://github.com/SilvioC2C
:alt: SilvioC2C
.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px
:target: https://github.com/simahawk
:alt: simahawk

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

|maintainer-SilvioC2C| |maintainer-simahawk|

This module is part of the `OCA/web-api <https://github.com/OCA/web-api/tree/18.0/endpoint_jsonifier>`_ 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 endpoint_jsonifier/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions endpoint_jsonifier/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Camptocamp (http://camptocamp.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
"name": "Endpoint JSONifier",
"summary": "Allow to configure jsonifier parsers on endpoints",
"version": "18.0.1.0.0",
"category": "Uncategorized",
"website": "https://github.com/OCA/web-api",
"author": "Camptocamp, Odoo Community Association (OCA)",
"maintainers": ["SilvioC2C", "simahawk"],
"license": "LGPL-3",
"installable": True,
"depends": ["endpoint", "jsonifier"],
"data": [
"views/endpoint_endpoint.xml",
],
}
45 changes: 45 additions & 0 deletions endpoint_jsonifier/i18n/endpoint_jsonifier.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * endpoint_jsonifier
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin__display_name
msgid "Display Name"
msgstr ""

#. module: endpoint_jsonifier
#: model:ir.model,name:endpoint_jsonifier.model_endpoint_mixin
msgid "Endpoint mixin"
msgstr ""

#. module: endpoint_jsonifier
#: model_terms:ir.ui.view,arch_db:endpoint_jsonifier.endpoint_mixin_form_view
msgid "Export"
msgstr ""

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_endpoint__exporter_id
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin__exporter_id
msgid "Exporter"
msgstr ""

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin__id
msgid "ID"
msgstr ""

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin____last_update
msgid "Last Modified on"
msgstr ""
48 changes: 48 additions & 0 deletions endpoint_jsonifier/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * endpoint_jsonifier
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-01-20 11:06+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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.6.2\n"

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: endpoint_jsonifier
#: model:ir.model,name:endpoint_jsonifier.model_endpoint_mixin
msgid "Endpoint mixin"
msgstr "Mixin endpoint"

#. module: endpoint_jsonifier
#: model_terms:ir.ui.view,arch_db:endpoint_jsonifier.endpoint_mixin_form_view
msgid "Export"
msgstr "Esporta"

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_endpoint__exporter_id
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin__exporter_id
msgid "Exporter"
msgstr "Esportatore"

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin__id
msgid "ID"
msgstr "ID"

#. module: endpoint_jsonifier
#: model:ir.model.fields,field_description:endpoint_jsonifier.field_endpoint_mixin____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
1 change: 1 addition & 0 deletions endpoint_jsonifier/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import endpoint_mixin
10 changes: 10 additions & 0 deletions endpoint_jsonifier/models/endpoint_mixin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import fields, models


class EndpointMixin(models.AbstractModel):
_inherit = "endpoint.mixin"

exporter_id = fields.Many2one("ir.exports")
3 changes: 3 additions & 0 deletions endpoint_jsonifier/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions endpoint_jsonifier/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Camptocamp SA](https://camptocamp.com):
- Silvio Gregorini \<<silvio.gregorini@camptocamp.com>\>
2 changes: 2 additions & 0 deletions endpoint_jsonifier/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This addon allows configuring an exporter for endpoints to be used in
code snippets.
12 changes: 12 additions & 0 deletions endpoint_jsonifier/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This module by itself contains no business logic, but its configuration
can be used to manage endpoints' data export.

For example:

``` python
parser = endpoint.export_id.get_json_parser()
prod_domain = [("sale_ok", "=", True)]
prod_data = env["product.product"].search(prod_domain).jsonify(parser)
resp = Response(json.dumps(prod_data), content_type="application/json", status=200)
result = dict(response=resp)
```
Binary file added endpoint_jsonifier/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