Replace base_jsonify w/ jsonifier
Rationale: 1. the name reflects better what it does as this is not _just_ a base module 2. solves publication issue on odoo apps store due to an old module registered w/ the same name that even if un-published blocks publishing the module for all versions. This in turn, blocks the publication of ALL modules that depend on base_jsonify.pull/2418/head
parent
95954250f0
commit
47306c8143
|
@ -1,238 +0,0 @@
|
|||
============
|
||||
Base JSONify
|
||||
============
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |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%2Fserver--tools-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/server-tools/tree/14.0/base_jsonify
|
||||
:alt: OCA/server-tools
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_jsonify
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/149/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module adds a 'jsonify' method to every model of the ORM.
|
||||
It works on the current recordset and requires a single argument 'parser'
|
||||
that specify the field to extract.
|
||||
|
||||
Example of a simple parser:
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
parser = [
|
||||
'name',
|
||||
'number',
|
||||
'create_date',
|
||||
('partner_id', ['id', 'display_name', 'ref'])
|
||||
('line_id', ['id', ('product_id', ['name']), 'price_unit'])
|
||||
]
|
||||
|
||||
In order to be consistent with the Odoo API the jsonify method always
|
||||
returns a list of objects even if there is only one element in the recordset.
|
||||
|
||||
By default the key into the JSON is the name of the field extracted
|
||||
from the model. If you need to specify an alternate name to use as key, you
|
||||
can define your mapping as follow into the parser definition:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
parser = [
|
||||
'field_name:json_key'
|
||||
]
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
||||
parser = [
|
||||
'name',
|
||||
'number',
|
||||
'create_date:creationDate',
|
||||
('partner_id:partners', ['id', 'display_name', 'ref'])
|
||||
('line_id:lines', ['id', ('product_id', ['name']), 'price_unit'])
|
||||
]
|
||||
|
||||
If you need to parse the value of a field in a custom way,
|
||||
you can pass a callable or the name of a method on the model:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
parser = [
|
||||
('name', "jsonify_name") # method name
|
||||
('number', lambda rec, field_name: rec[field_name] * 2)) # callable
|
||||
]
|
||||
|
||||
Also the module provide a method "get_json_parser" on the ir.exports object
|
||||
that generate a parser from an ir.exports configuration.
|
||||
|
||||
Further features are available for advanced uses.
|
||||
It defines a simple "resolver" model that has a "python_code" field and a resolve
|
||||
function so that arbitrary functions can be configured to transform fields,
|
||||
or process the resulting dictionary.
|
||||
It is also to specify a lang to extract the translation of any given field.
|
||||
|
||||
To use these features, a full parser follows the following structure:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
parser = {
|
||||
"resolver": 3,
|
||||
"language_agnostic": True,
|
||||
"langs": {
|
||||
False: [
|
||||
{'name': 'description'},
|
||||
{'name': 'number', 'resolver': 5},
|
||||
({'name': 'partner_id', 'target': 'partner'}, [{'name': 'display_name'}])
|
||||
],
|
||||
'fr_FR': [
|
||||
{'name': 'description', 'target': 'descriptions_fr'},
|
||||
({'name': 'partner_id', 'target': 'partner'}, [{'name': 'description', 'target': 'description_fr'}])
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
One would get a result having this structure (note that the translated fields are merged in the same dictionary):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
exported_json == {
|
||||
"description": "English description",
|
||||
"description_fr": "French description, voilà",
|
||||
"number": 42,
|
||||
"partner": {
|
||||
"display_name": "partner name",
|
||||
"description_fr": "French description of that partner",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Note that a resolver can be passed either as a recordset or as an id, so as to be fully serializable.
|
||||
A slightly simpler version in case the translation of fields is not needed,
|
||||
but other features like custom resolvers are:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
parser = {
|
||||
"resolver": 3,
|
||||
"fields": [
|
||||
{'name': 'description'},
|
||||
{'name': 'number', 'resolver': 5},
|
||||
({'name': 'partner_id', 'target': 'partners'}, [{'name': 'display_name'}]),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
By passing the `fields` key instead of `langs`, we have essentially the same behaviour as simple parsers,
|
||||
with the added benefit of being able to use resolvers.
|
||||
|
||||
Standard use-cases of resolvers are:
|
||||
- give field-specific defaults (e.g. `""` instead of `None`)
|
||||
- cast a field type (e.g. `int()`)
|
||||
- alias a particular field for a specific export
|
||||
- ...
|
||||
|
||||
A simple parser is simply translated into a full parser at export.
|
||||
|
||||
If the global resolver is given, then the json_dict goes through:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
resolver.resolve(dict, record)
|
||||
|
||||
Which allows to add external data from the context or transform the dictionary
|
||||
if necessary. Similarly if given for a field the resolver evaluates the result.
|
||||
|
||||
It is possible for a target to have a marshaller by ending the target with '=list':
|
||||
in that case the result is put into a list.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
parser = {
|
||||
fields: [
|
||||
{'name': 'name'},
|
||||
{'name': 'field_1', 'target': 'customTags=list'},
|
||||
{'name': 'field_2', 'target': 'customTags=list'},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Would result in the following JSON structure:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
{
|
||||
'name': 'record_name',
|
||||
'customTags': ['field_1_value', 'field_2_value'],
|
||||
}
|
||||
|
||||
The intended use-case is to be compatible with APIs that require all translated
|
||||
parameters to be exported simultaneously, and ask for custom properties to be
|
||||
put in a sub-dictionary.
|
||||
Since it is often the case that some of these requirements are optional,
|
||||
new requirements could be met without needing to add field or change any code.
|
||||
|
||||
Note that the export values with the simple parser depends on the record's lang;
|
||||
this is in contrast with full parsers which are designed to be language agnostic.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_jsonify%0Aversion:%2014.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
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* BEAU Sébastien <sebastien.beau@akretion.com>
|
||||
* Raphaël Reverdy <raphael.reverdy@akretion.com>
|
||||
* Laurent Mignon <laurent.mignon@acsone.eu>
|
||||
* Nans Lefebvre <nans.lefebvre@acsone.eu>
|
||||
|
||||
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/server-tools <https://github.com/OCA/server-tools/tree/14.0/base_jsonify>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@ -1 +0,0 @@
|
|||
from . import models
|
|
@ -1,26 +0,0 @@
|
|||
# Copyright 2017-2018 Akretion (http://www.akretion.com)
|
||||
# Sébastien BEAU <sebastien.beau@akretion.com>
|
||||
# Raphaël Reverdy <raphael.reverdy@akretion.com>
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "Base JSONify",
|
||||
"summary": "Base module that provide the jsonify method on all models",
|
||||
"version": "14.0.1.5.0",
|
||||
"category": "Uncategorized",
|
||||
"website": "https://github.com/OCA/server-tools",
|
||||
"author": "Akretion, Odoo Community Association (OCA)",
|
||||
"license": "LGPL-3",
|
||||
"installable": True,
|
||||
"depends": ["base"],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"views/ir_exports_view.xml",
|
||||
"views/ir_exports_resolver_view.xml",
|
||||
],
|
||||
"demo": [
|
||||
"demo/resolver_demo.xml",
|
||||
"demo/export_demo.xml",
|
||||
"demo/ir.exports.line.csv",
|
||||
],
|
||||
}
|
|
@ -1,228 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_jsonify
|
||||
#
|
||||
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: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__instance_method_name
|
||||
msgid "A method defined on the model that takes a record and a field_name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__active
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_resolver__python_code
|
||||
msgid ""
|
||||
"Compute the result from 'value' by setting the variable 'result'.\n"
|
||||
"For fields resolvers:\n"
|
||||
":param name: name of the field\n"
|
||||
":param value: value of the field\n"
|
||||
":param field_type: type of the field\n"
|
||||
"For global resolvers:\n"
|
||||
":param value: JSON dict\n"
|
||||
":param record: the record"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model_terms:ir.ui.view,arch_db:base_jsonify.view_ir_exports
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.actions.act_window,name:base_jsonify.act_ui_exports_resolver_view
|
||||
#: model:ir.ui.menu,name:base_jsonify.ui_exports_resolvers
|
||||
msgid "Custom Export Resolvers"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__global_resolver_id
|
||||
msgid "Custom global resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__resolver_id
|
||||
msgid "Custom resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__display_name
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__display_name
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Either set a function or a resolver, not both."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.actions.act_window,name:base_jsonify.act_ui_exports_view
|
||||
#: model:ir.ui.menu,name:base_jsonify.ui_exports
|
||||
msgid "Export Fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports_resolver
|
||||
msgid "Export Resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports
|
||||
msgid "Exports"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports_line
|
||||
msgid "Exports Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields.selection,name:base_jsonify.selection__ir_exports_resolver__type__field
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__instance_method_name
|
||||
msgid "Function"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields.selection,name:base_jsonify.selection__ir_exports_resolver__type__global
|
||||
msgid "Global"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__id
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__id
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__lang_id
|
||||
msgid "If set, the language in which the field is exported"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports__global_resolver_id
|
||||
msgid "If set, will apply the global resolver to the result"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__resolver_id
|
||||
msgid "If set, will apply the resolver on the field value"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports__language_agnostic
|
||||
msgid ""
|
||||
"If set, will set the lang to False when exporting lines without lang, "
|
||||
"otherwise it uses the lang in the given context to export these fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model_terms:ir.ui.view,arch_db:base_jsonify.view_ir_exports
|
||||
msgid "Index"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__lang_id
|
||||
msgid "Language"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__language_agnostic
|
||||
msgid "Language Agnostic"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports____last_update
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line____last_update
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Name and Target must have the same hierarchy depth"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__python_code
|
||||
msgid "Python Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__target
|
||||
msgid "Target"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__target
|
||||
msgid ""
|
||||
"The complete path to the field where you can specify a target on the step as"
|
||||
" field:target"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "The target must reference the same field as in name '%s' not in '%s'"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/models.py:0
|
||||
#, python-format
|
||||
msgid "Wrong parser configuration for field: `%s`"
|
||||
msgstr ""
|
|
@ -1,229 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_jsonify
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: ca\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"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__instance_method_name
|
||||
msgid "A method defined on the model that takes a record and a field_name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__active
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_resolver__python_code
|
||||
msgid ""
|
||||
"Compute the result from 'value' by setting the variable 'result'.\n"
|
||||
"For fields resolvers:\n"
|
||||
":param name: name of the field\n"
|
||||
":param value: value of the field\n"
|
||||
":param field_type: type of the field\n"
|
||||
"For global resolvers:\n"
|
||||
":param value: JSON dict\n"
|
||||
":param record: the record"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model_terms:ir.ui.view,arch_db:base_jsonify.view_ir_exports
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.actions.act_window,name:base_jsonify.act_ui_exports_resolver_view
|
||||
#: model:ir.ui.menu,name:base_jsonify.ui_exports_resolvers
|
||||
msgid "Custom Export Resolvers"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__global_resolver_id
|
||||
msgid "Custom global resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__resolver_id
|
||||
msgid "Custom resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__display_name
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__display_name
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Either set a function or a resolver, not both."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.actions.act_window,name:base_jsonify.act_ui_exports_view
|
||||
#: model:ir.ui.menu,name:base_jsonify.ui_exports
|
||||
msgid "Export Fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports_resolver
|
||||
msgid "Export Resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports
|
||||
msgid "Exports"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports_line
|
||||
msgid "Exports Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields.selection,name:base_jsonify.selection__ir_exports_resolver__type__field
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__instance_method_name
|
||||
msgid "Function"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields.selection,name:base_jsonify.selection__ir_exports_resolver__type__global
|
||||
msgid "Global"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__id
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__id
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__lang_id
|
||||
msgid "If set, the language in which the field is exported"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports__global_resolver_id
|
||||
msgid "If set, will apply the global resolver to the result"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__resolver_id
|
||||
msgid "If set, will apply the resolver on the field value"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports__language_agnostic
|
||||
msgid ""
|
||||
"If set, will set the lang to False when exporting lines without lang, "
|
||||
"otherwise it uses the lang in the given context to export these fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model_terms:ir.ui.view,arch_db:base_jsonify.view_ir_exports
|
||||
msgid "Index"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__lang_id
|
||||
msgid "Language"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__language_agnostic
|
||||
msgid "Language Agnostic"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports____last_update
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line____last_update
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Name and Target must have the same hierarchy depth"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__python_code
|
||||
msgid "Python Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__target
|
||||
msgid "Target"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__target
|
||||
msgid ""
|
||||
"The complete path to the field where you can specify a target on the step as"
|
||||
" field:target"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "The target must reference the same field as in name '%s' not in '%s'"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/models.py:0
|
||||
#, python-format
|
||||
msgid "Wrong parser configuration for field: `%s`"
|
||||
msgstr ""
|
|
@ -1,231 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_jsonify
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2019-08-31 04:35+0000\n"
|
||||
"Last-Translator: 黎伟杰 <674416404@qq.com>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 3.8\n"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__instance_method_name
|
||||
msgid "A method defined on the model that takes a record and a field_name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__active
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_base
|
||||
msgid "Base"
|
||||
msgstr "基础"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_resolver__python_code
|
||||
msgid ""
|
||||
"Compute the result from 'value' by setting the variable 'result'.\n"
|
||||
"For fields resolvers:\n"
|
||||
":param name: name of the field\n"
|
||||
":param value: value of the field\n"
|
||||
":param field_type: type of the field\n"
|
||||
"For global resolvers:\n"
|
||||
":param value: JSON dict\n"
|
||||
":param record: the record"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model_terms:ir.ui.view,arch_db:base_jsonify.view_ir_exports
|
||||
msgid "Configuration"
|
||||
msgstr "配置"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.actions.act_window,name:base_jsonify.act_ui_exports_resolver_view
|
||||
#: model:ir.ui.menu,name:base_jsonify.ui_exports_resolvers
|
||||
msgid "Custom Export Resolvers"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__global_resolver_id
|
||||
msgid "Custom global resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__resolver_id
|
||||
msgid "Custom resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__display_name
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__display_name
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Either set a function or a resolver, not both."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.actions.act_window,name:base_jsonify.act_ui_exports_view
|
||||
#: model:ir.ui.menu,name:base_jsonify.ui_exports
|
||||
msgid "Export Fields"
|
||||
msgstr "导出字段"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports_resolver
|
||||
msgid "Export Resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports
|
||||
msgid "Exports"
|
||||
msgstr "导出"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model,name:base_jsonify.model_ir_exports_line
|
||||
msgid "Exports Line"
|
||||
msgstr "导出行"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields.selection,name:base_jsonify.selection__ir_exports_resolver__type__field
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__instance_method_name
|
||||
msgid "Function"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields.selection,name:base_jsonify.selection__ir_exports_resolver__type__global
|
||||
msgid "Global"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__id
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__id
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__lang_id
|
||||
msgid "If set, the language in which the field is exported"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports__global_resolver_id
|
||||
msgid "If set, will apply the global resolver to the result"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__resolver_id
|
||||
msgid "If set, will apply the resolver on the field value"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports__language_agnostic
|
||||
msgid ""
|
||||
"If set, will set the lang to False when exporting lines without lang, "
|
||||
"otherwise it uses the lang in the given context to export these fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model_terms:ir.ui.view,arch_db:base_jsonify.view_ir_exports
|
||||
msgid "Index"
|
||||
msgstr "索引"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__lang_id
|
||||
msgid "Language"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports__language_agnostic
|
||||
msgid "Language Agnostic"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports____last_update
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line____last_update
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Name and Target must have the same hierarchy depth"
|
||||
msgstr "名称和别名必须具有相同的层次结构深度"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__python_code
|
||||
msgid "Python Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_line__target
|
||||
msgid "Target"
|
||||
msgstr "别名"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,help:base_jsonify.field_ir_exports_line__target
|
||||
msgid ""
|
||||
"The complete path to the field where you can specify a target on the step as "
|
||||
"field:target"
|
||||
msgstr "字段的完整路径,您可以在其中指定步骤作为字段的别名:别名"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "The target must reference the same field as in name '%s' not in '%s'"
|
||||
msgstr "别名必须引用与名称相同的字段'%s'不在'%s'"
|
||||
|
||||
#. module: base_jsonify
|
||||
#: model:ir.model.fields,field_description:base_jsonify.field_ir_exports_resolver__type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_jsonify
|
||||
#: code:addons/base_jsonify/models/models.py:0
|
||||
#, fuzzy, python-format
|
||||
msgid "Wrong parser configuration for field: `%s`"
|
||||
msgstr "错误的解析器配置"
|
Binary file not shown.
Before Width: | Height: | Size: 9.2 KiB |
|
@ -1,3 +1 @@
|
|||
This module is meant to replace `base_jsonify`.
|
||||
Once is confirmed that it can be published on the apps store
|
||||
the switch will be made.
|
||||
wait for the bot ;)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from . import models
|
|
@ -5,12 +5,22 @@
|
|||
|
||||
{
|
||||
"name": "JSONifier",
|
||||
"summary": "JSON-ify data for all models - SKELETON",
|
||||
"version": "14.0.0.1.0",
|
||||
"summary": "JSON-ify data for all models",
|
||||
"version": "14.0.1.0.0",
|
||||
"category": "Uncategorized",
|
||||
"website": "https://github.com/OCA/server-tools",
|
||||
"author": "Akretion, ACSONE, Camptocamp, Odoo Community Association (OCA)",
|
||||
"license": "LGPL-3",
|
||||
"installable": True,
|
||||
"depends": ["base"],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"views/ir_exports_view.xml",
|
||||
"views/ir_exports_resolver_view.xml",
|
||||
],
|
||||
"demo": [
|
||||
"demo/resolver_demo.xml",
|
||||
"demo/export_demo.xml",
|
||||
"demo/ir.exports.line.csv",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * jsonifier
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: ca\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"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__instance_method_name
|
||||
msgid "A method defined on the model that takes a record and a field_name"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__active
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_resolver__python_code
|
||||
msgid ""
|
||||
"Compute the result from 'value' by setting the variable 'result'.\n"
|
||||
"For fields resolvers:\n"
|
||||
":param name: name of the field\n"
|
||||
":param value: value of the field\n"
|
||||
":param field_type: type of the field\n"
|
||||
"For global resolvers:\n"
|
||||
":param value: JSON dict\n"
|
||||
":param record: the record"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model_terms:ir.ui.view,arch_db:jsonifier.view_ir_exports
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.actions.act_window,name:jsonifier.act_ui_exports_resolver_view
|
||||
#: model:ir.ui.menu,name:jsonifier.ui_exports_resolvers
|
||||
msgid "Custom Export Resolvers"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__global_resolver_id
|
||||
msgid "Custom global resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__resolver_id
|
||||
msgid "Custom resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__display_name
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__display_name
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Either set a function or a resolver, not both."
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.actions.act_window,name:jsonifier.act_ui_exports_view
|
||||
#: model:ir.ui.menu,name:jsonifier.ui_exports
|
||||
msgid "Export Fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_ir_exports_resolver
|
||||
msgid "Export Resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_ir_exports
|
||||
msgid "Exports"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_ir_exports_line
|
||||
msgid "Exports Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields.selection,name:jsonifier.selection__ir_exports_resolver__type__field
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__instance_method_name
|
||||
msgid "Function"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields.selection,name:jsonifier.selection__ir_exports_resolver__type__global
|
||||
msgid "Global"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__id
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__id
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__lang_id
|
||||
msgid "If set, the language in which the field is exported"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports__global_resolver_id
|
||||
msgid "If set, will apply the global resolver to the result"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__resolver_id
|
||||
msgid "If set, will apply the resolver on the field value"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports__language_agnostic
|
||||
msgid ""
|
||||
"If set, will set the lang to False when exporting lines without lang, "
|
||||
"otherwise it uses the lang in the given context to export these fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model_terms:ir.ui.view,arch_db:jsonifier.view_ir_exports
|
||||
msgid "Index"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__lang_id
|
||||
msgid "Language"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__language_agnostic
|
||||
msgid "Language Agnostic"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports____last_update
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line____last_update
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Name and Target must have the same hierarchy depth"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__python_code
|
||||
msgid "Python Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__target
|
||||
msgid "Target"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__target
|
||||
msgid ""
|
||||
"The complete path to the field where you can specify a target on the step as"
|
||||
" field:target"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "The target must reference the same field as in name '%s' not in '%s'"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/models.py:0
|
||||
#, python-format
|
||||
msgid "Wrong parser configuration for field: `%s`"
|
||||
msgstr ""
|
|
@ -0,0 +1,231 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * jsonifier
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2019-08-31 04:35+0000\n"
|
||||
"Last-Translator: 黎伟杰 <674416404@qq.com>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 3.8\n"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__instance_method_name
|
||||
msgid "A method defined on the model that takes a record and a field_name"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__active
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_base
|
||||
msgid "Base"
|
||||
msgstr "基础"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_resolver__python_code
|
||||
msgid ""
|
||||
"Compute the result from 'value' by setting the variable 'result'.\n"
|
||||
"For fields resolvers:\n"
|
||||
":param name: name of the field\n"
|
||||
":param value: value of the field\n"
|
||||
":param field_type: type of the field\n"
|
||||
"For global resolvers:\n"
|
||||
":param value: JSON dict\n"
|
||||
":param record: the record"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model_terms:ir.ui.view,arch_db:jsonifier.view_ir_exports
|
||||
msgid "Configuration"
|
||||
msgstr "配置"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.actions.act_window,name:jsonifier.act_ui_exports_resolver_view
|
||||
#: model:ir.ui.menu,name:jsonifier.ui_exports_resolvers
|
||||
msgid "Custom Export Resolvers"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__global_resolver_id
|
||||
msgid "Custom global resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__resolver_id
|
||||
msgid "Custom resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__display_name
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__display_name
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Either set a function or a resolver, not both."
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.actions.act_window,name:jsonifier.act_ui_exports_view
|
||||
#: model:ir.ui.menu,name:jsonifier.ui_exports
|
||||
msgid "Export Fields"
|
||||
msgstr "导出字段"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_ir_exports_resolver
|
||||
msgid "Export Resolver"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_ir_exports
|
||||
msgid "Exports"
|
||||
msgstr "导出"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model,name:jsonifier.model_ir_exports_line
|
||||
msgid "Exports Line"
|
||||
msgstr "导出行"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields.selection,name:jsonifier.selection__ir_exports_resolver__type__field
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__instance_method_name
|
||||
msgid "Function"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields.selection,name:jsonifier.selection__ir_exports_resolver__type__global
|
||||
msgid "Global"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__id
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__id
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__lang_id
|
||||
msgid "If set, the language in which the field is exported"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports__global_resolver_id
|
||||
msgid "If set, will apply the global resolver to the result"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__resolver_id
|
||||
msgid "If set, will apply the resolver on the field value"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports__language_agnostic
|
||||
msgid ""
|
||||
"If set, will set the lang to False when exporting lines without lang, "
|
||||
"otherwise it uses the lang in the given context to export these fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model_terms:ir.ui.view,arch_db:jsonifier.view_ir_exports
|
||||
msgid "Index"
|
||||
msgstr "索引"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__lang_id
|
||||
msgid "Language"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports__language_agnostic
|
||||
msgid "Language Agnostic"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports____last_update
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line____last_update
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "Name and Target must have the same hierarchy depth"
|
||||
msgstr "名称和别名必须具有相同的层次结构深度"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__python_code
|
||||
msgid "Python Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_line__target
|
||||
msgid "Target"
|
||||
msgstr "别名"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,help:jsonifier.field_ir_exports_line__target
|
||||
msgid ""
|
||||
"The complete path to the field where you can specify a target on the step as "
|
||||
"field:target"
|
||||
msgstr "字段的完整路径,您可以在其中指定步骤作为字段的别名:别名"
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/ir_exports_line.py:0
|
||||
#, python-format
|
||||
msgid "The target must reference the same field as in name '%s' not in '%s'"
|
||||
msgstr "别名必须引用与名称相同的字段'%s'不在'%s'"
|
||||
|
||||
#. module: jsonifier
|
||||
#: model:ir.model.fields,field_description:jsonifier.field_ir_exports_resolver__type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: jsonifier
|
||||
#: code:addons/jsonifier/models/models.py:0
|
||||
#, fuzzy, python-format
|
||||
msgid "Wrong parser configuration for field: `%s`"
|
||||
msgstr "错误的解析器配置"
|
|
@ -2,3 +2,5 @@
|
|||
* Raphaël Reverdy <raphael.reverdy@akretion.com>
|
||||
* Laurent Mignon <laurent.mignon@acsone.eu>
|
||||
* Nans Lefebvre <nans.lefebvre@acsone.eu>
|
||||
* Simone Orsi <simone.orsi@camptocamp.com>
|
||||
* Iván Todorovich <ivan.todorovich@camptocamp.com>
|
|
@ -161,3 +161,6 @@ new requirements could be met without needing to add field or change any code.
|
|||
|
||||
Note that the export values with the simple parser depends on the record's lang;
|
||||
this is in contrast with full parsers which are designed to be language agnostic.
|
||||
|
||||
|
||||
NOTE: this module was named `base_jsonify` till version 14.0.1.5.0.
|
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/server-tools/tree/14.0/base_jsonify"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_jsonify"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/149/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/server-tools/tree/14.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" href="https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-jsonifier"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/149/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module adds a ‘jsonify’ method to every model of the ORM.
|
||||
It works on the current recordset and requires a single argument ‘parser’
|
||||
that specify the field to extract.</p>
|
||||
|
@ -514,7 +514,7 @@ this is in contrast with full parsers which are designed to be language agnostic
|
|||
<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 smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_jsonify%0Aversion:%2014.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/server-tools/issues/new?body=module:%20jsonifier%0Aversion:%2014.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">
|
||||
|
@ -541,7 +541,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
<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/server-tools/tree/14.0/base_jsonify">OCA/server-tools</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/14.0/jsonifier">OCA/server-tools</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>
|
|
@ -115,13 +115,13 @@ class TestParser(SavepointCase):
|
|||
"comment",
|
||||
]
|
||||
|
||||
exporter = self.env.ref("base_jsonify.ir_exp_partner")
|
||||
exporter = self.env.ref("jsonifier.ir_exp_partner")
|
||||
parser = exporter.get_json_parser()
|
||||
expected_full_parser = convert_simple_to_full_parser(expected_parser)
|
||||
self.assertEqual(parser, expected_full_parser)
|
||||
|
||||
# modify an ir.exports_line to put a target for a field
|
||||
self.env.ref("base_jsonify.category_id_name").write(
|
||||
self.env.ref("jsonifier.category_id_name").write(
|
||||
{"target": "category_id:category/name"}
|
||||
)
|
||||
expected_parser[4] = ("category_id:category", ["name"])
|
||||
|
@ -329,7 +329,7 @@ class TestParser(SavepointCase):
|
|||
def test_bad_parsers_fail_gracefully(self):
|
||||
rec = self.category
|
||||
|
||||
logger_patch_path = "odoo.addons.base_jsonify.models.models._logger.error"
|
||||
logger_patch_path = "odoo.addons.jsonifier.models.models._logger.error"
|
||||
|
||||
# logging is disabled when testing as it's useless and makes build fail.
|
||||
tools.config["test_enable"] = False
|
|
@ -9,7 +9,7 @@ class TestIrExportsLine(SavepointCase):
|
|||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.ir_export = cls.env.ref("base_jsonify.ir_exp_partner")
|
||||
cls.ir_export = cls.env.ref("jsonifier.ir_exp_partner")
|
||||
|
||||
def test_target_constrains(self):
|
||||
ir_export_lines_model = self.env["ir.exports.line"]
|
Loading…
Reference in New Issue