[BOT] post-merge updates
parent
a2b8a40a8f
commit
9e65ad69ce
|
@ -59,7 +59,7 @@ addon | version | maintainers | summary
|
|||
[fetchmail_attach_from_folder](fetchmail_attach_from_folder/) | 16.0.1.5.0 | [](https://github.com/NL66278) | Attach mails in an IMAP folder to existing objects
|
||||
[html_text](html_text/) | 16.0.1.0.1 | | Generate excerpts from any HTML field
|
||||
[iap_alternative_provider](iap_alternative_provider/) | 16.0.1.0.0 | [](https://github.com/sebastienbeau) | Base module for providing alternative provider for iap apps
|
||||
[jsonifier](jsonifier/) | 16.0.0.0.1 | | JSON-ify data for all models
|
||||
[jsonifier](jsonifier/) | 16.0.0.1.0 | | JSON-ify data for all models
|
||||
[letsencrypt](letsencrypt/) | 16.0.1.1.1 | [](https://github.com/hbrunn) | Request SSL certificates from letsencrypt.org
|
||||
[module_analysis](module_analysis/) | 16.0.1.0.3 | [](https://github.com/legalsylvain) | Add analysis tools regarding installed modules to know which installed modules comes from Odoo Core, OCA, or are custom modules
|
||||
[module_auto_update](module_auto_update/) | 16.0.1.0.2 | | Automatically update Odoo modules
|
||||
|
|
|
@ -7,7 +7,7 @@ JSONifier
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:35c533b68310f11e30533abb554ad99c602c67aef7b9ba22b2d88822862cf1f0
|
||||
!! source digest: sha256:b4e38b8c4c0fb183e4fee0005cba8864f90c1da9705d957c0b2dd379a7ce6987
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
|
@ -200,6 +200,38 @@ NOTE: this module was named `base_jsonify` till version 14.0.1.5.0.
|
|||
.. contents::
|
||||
:local:
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
with_fieldname parameter
|
||||
==========================
|
||||
|
||||
The with_fieldname option of jsonify() method, when true, will inject on
|
||||
the same level of the data "_fieldname_$field" keys that will
|
||||
contain the field name, in the language of the current user.
|
||||
|
||||
|
||||
Examples of with_fieldname usage:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# example 1
|
||||
parser = [('name')]
|
||||
a.jsonify(parser=parser)
|
||||
[{'name': 'SO3996'}]
|
||||
>>> a.jsonify(parser=parser, with_fieldname=False)
|
||||
[{'name': 'SO3996'}]
|
||||
>>> a.jsonify(parser=parser, with_fieldname=True)
|
||||
[{'fieldname_name': 'Order Reference', 'name': 'SO3996'}}]
|
||||
|
||||
|
||||
# example 2 - with a subparser-
|
||||
parser=['name', 'create_date', ('order_line', ['id' , 'product_uom', 'is_expense'])]
|
||||
>>> a.jsonify(parser=parser, with_fieldname=False)
|
||||
[{'name': 'SO3996', 'create_date': '2015-06-02T12:18:26.279909+00:00', 'order_line': [{'id': 16649, 'product_uom': 'stuks', 'is_expense': False}, {'id': 16651, 'product_uom': 'stuks', 'is_expense': False}, {'id': 16650, 'product_uom': 'stuks', 'is_expense': False}]}]
|
||||
>>> a.jsonify(parser=parser, with_fieldname=True)
|
||||
[{'fieldname_name': 'Order Reference', 'name': 'SO3996', 'fieldname_create_date': 'Creation Date', 'create_date': '2015-06-02T12:18:26.279909+00:00', 'fieldname_order_line': 'Order Lines', 'order_line': [{'fieldname_id': 'ID', 'id': 16649, 'fieldname_product_uom': 'Unit of Measure', 'product_uom': 'stuks', 'fieldname_is_expense': 'Is expense', 'is_expense': False}]}]
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{
|
||||
"name": "JSONifier",
|
||||
"summary": "JSON-ify data for all models",
|
||||
"version": "16.0.0.0.1",
|
||||
"version": "16.0.0.1.0",
|
||||
"category": "Uncategorized",
|
||||
"website": "https://github.com/OCA/server-tools",
|
||||
"author": "Akretion, ACSONE, Camptocamp, Odoo Community Association (OCA)",
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
: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.
|
||||
|
@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|||
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 }
|
||||
|
@ -300,7 +301,7 @@ span.option {
|
|||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
|
@ -366,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:35c533b68310f11e30533abb554ad99c602c67aef7b9ba22b2d88822862cf1f0
|
||||
!! source digest: sha256:b4e38b8c4c0fb183e4fee0005cba8864f90c1da9705d957c0b2dd379a7ce6987
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/16.0/jsonifier"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-jsonifier"><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/server-tools&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module adds a ‘jsonify’ method to every model of the ORM.
|
||||
|
@ -502,17 +503,48 @@ this is in contrast with full parsers which are designed to be language agnostic
|
|||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
|
||||
<li><a class="reference internal" href="#with-fieldname-parameter" id="toc-entry-2">with_fieldname parameter</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
||||
</div>
|
||||
<div class="section" id="with-fieldname-parameter">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">with_fieldname parameter</a></h1>
|
||||
<p>The with_fieldname option of jsonify() method, when true, will inject on
|
||||
the same level of the data “_fieldname_$field” keys that will
|
||||
contain the field name, in the language of the current user.</p>
|
||||
<blockquote>
|
||||
Examples of with_fieldname usage:</blockquote>
|
||||
<pre class="code python literal-block">
|
||||
<span class="c1"># example 1</span><span class="w">
|
||||
</span><span class="n">parser</span> <span class="o">=</span> <span class="p">[(</span><span class="s1">'name'</span><span class="p">)]</span><span class="w">
|
||||
</span><span class="n">a</span><span class="o">.</span><span class="n">jsonify</span><span class="p">(</span><span class="n">parser</span><span class="o">=</span><span class="n">parser</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">[{</span><span class="s1">'name'</span><span class="p">:</span> <span class="s1">'SO3996'</span><span class="p">}]</span><span class="w">
|
||||
</span><span class="o">>>></span> <span class="n">a</span><span class="o">.</span><span class="n">jsonify</span><span class="p">(</span><span class="n">parser</span><span class="o">=</span><span class="n">parser</span><span class="p">,</span> <span class="n">with_fieldname</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">[{</span><span class="s1">'name'</span><span class="p">:</span> <span class="s1">'SO3996'</span><span class="p">}]</span><span class="w">
|
||||
</span><span class="o">>>></span> <span class="n">a</span><span class="o">.</span><span class="n">jsonify</span><span class="p">(</span><span class="n">parser</span><span class="o">=</span><span class="n">parser</span><span class="p">,</span> <span class="n">with_fieldname</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">[{</span><span class="s1">'fieldname_name'</span><span class="p">:</span> <span class="s1">'Order Reference'</span><span class="p">,</span> <span class="s1">'name'</span><span class="p">:</span> <span class="s1">'SO3996'</span><span class="p">}}]</span><span class="w">
|
||||
|
||||
|
||||
</span><span class="c1"># example 2 - with a subparser-</span><span class="w">
|
||||
</span><span class="n">parser</span><span class="o">=</span><span class="p">[</span><span class="s1">'name'</span><span class="p">,</span> <span class="s1">'create_date'</span><span class="p">,</span> <span class="p">(</span><span class="s1">'order_line'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'id'</span> <span class="p">,</span> <span class="s1">'product_uom'</span><span class="p">,</span> <span class="s1">'is_expense'</span><span class="p">])]</span><span class="w">
|
||||
</span><span class="o">>>></span> <span class="n">a</span><span class="o">.</span><span class="n">jsonify</span><span class="p">(</span><span class="n">parser</span><span class="o">=</span><span class="n">parser</span><span class="p">,</span> <span class="n">with_fieldname</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">[{</span><span class="s1">'name'</span><span class="p">:</span> <span class="s1">'SO3996'</span><span class="p">,</span> <span class="s1">'create_date'</span><span class="p">:</span> <span class="s1">'2015-06-02T12:18:26.279909+00:00'</span><span class="p">,</span> <span class="s1">'order_line'</span><span class="p">:</span> <span class="p">[{</span><span class="s1">'id'</span><span class="p">:</span> <span class="mi">16649</span><span class="p">,</span> <span class="s1">'product_uom'</span><span class="p">:</span> <span class="s1">'stuks'</span><span class="p">,</span> <span class="s1">'is_expense'</span><span class="p">:</span> <span class="kc">False</span><span class="p">},</span> <span class="p">{</span><span class="s1">'id'</span><span class="p">:</span> <span class="mi">16651</span><span class="p">,</span> <span class="s1">'product_uom'</span><span class="p">:</span> <span class="s1">'stuks'</span><span class="p">,</span> <span class="s1">'is_expense'</span><span class="p">:</span> <span class="kc">False</span><span class="p">},</span> <span class="p">{</span><span class="s1">'id'</span><span class="p">:</span> <span class="mi">16650</span><span class="p">,</span> <span class="s1">'product_uom'</span><span class="p">:</span> <span class="s1">'stuks'</span><span class="p">,</span> <span class="s1">'is_expense'</span><span class="p">:</span> <span class="kc">False</span><span class="p">}]}]</span><span class="w">
|
||||
</span><span class="o">>>></span> <span class="n">a</span><span class="o">.</span><span class="n">jsonify</span><span class="p">(</span><span class="n">parser</span><span class="o">=</span><span class="n">parser</span><span class="p">,</span> <span class="n">with_fieldname</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">[{</span><span class="s1">'fieldname_name'</span><span class="p">:</span> <span class="s1">'Order Reference'</span><span class="p">,</span> <span class="s1">'name'</span><span class="p">:</span> <span class="s1">'SO3996'</span><span class="p">,</span> <span class="s1">'fieldname_create_date'</span><span class="p">:</span> <span class="s1">'Creation Date'</span><span class="p">,</span> <span class="s1">'create_date'</span><span class="p">:</span> <span class="s1">'2015-06-02T12:18:26.279909+00:00'</span><span class="p">,</span> <span class="s1">'fieldname_order_line'</span><span class="p">:</span> <span class="s1">'Order Lines'</span><span class="p">,</span> <span class="s1">'order_line'</span><span class="p">:</span> <span class="p">[{</span><span class="s1">'fieldname_id'</span><span class="p">:</span> <span class="s1">'ID'</span><span class="p">,</span> <span class="s1">'id'</span><span class="p">:</span> <span class="mi">16649</span><span class="p">,</span> <span class="s1">'fieldname_product_uom'</span><span class="p">:</span> <span class="s1">'Unit of Measure'</span><span class="p">,</span> <span class="s1">'product_uom'</span><span class="p">:</span> <span class="s1">'stuks'</span><span class="p">,</span> <span class="s1">'fieldname_is_expense'</span><span class="p">:</span> <span class="s1">'Is expense'</span><span class="p">,</span> <span class="s1">'is_expense'</span><span class="p">:</span> <span class="kc">False</span><span class="p">}]}]</span>
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||
<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/server-tools/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
|
||||
|
@ -520,9 +552,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
<li>ACSONE</li>
|
||||
|
@ -530,7 +562,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>BEAU Sébastien <<a class="reference external" href="mailto:sebastien.beau@akretion.com">sebastien.beau@akretion.com</a>></li>
|
||||
<li>Raphaël Reverdy <<a class="reference external" href="mailto:raphael.reverdy@akretion.com">raphael.reverdy@akretion.com</a>></li>
|
||||
|
@ -541,9 +573,11 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
||||
<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>
|
||||
|
|
Loading…
Reference in New Issue