Commit Graph

1011 Commits (250fbe2d4e197ea1c0ef17d216005c01d335dcbb)

Author SHA1 Message Date
OCA-git-bot 90c2511706 base_jsonify 14.0.1.2.0 2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) 3d1e4abc0b [IMP] base_jsonify: Allow to export many2one and referene field as simple field
Before this change, the result of the export of a relational field was always a dict or a list of dict.

ex:

<record id="ir_exp_shopinvader_variant_lang" model="ir.exports.line">
  <field name="name">publication_language_id/name</field>
  <field name="alias">publication_language_id/name:lang</field>
  <field name="export_id" ref="shopinvader.ir_exp_shopinvader_variant" />
</record>

will output:
{
    ...
    "publication_language_id" : {
        "lang": "French"
    }
    ...
}

After this change it's now possible to define simple exporter for relational fields where the value into the result will be the display_name or a list of display_name of the related records.

ex:

<record id="ir_exp_shopinvader_variant_lang" model="ir.exports.line">
  <field name="name">publication_language_id</field>
  <field name="alias">publication_language_id:lang</field>
  <field name="export_id" ref="shopinvader.ir_exp_shopinvader_variant" />
</record>

will output:
{
    "lang": "French"
}

(Cherry-pick of 652c0167a after this commit was dropped by #1894's refactoring)
(+ test so that it cannot be forgotten again)
2023-02-27 10:05:54 +01:00
OCA-git-bot 4b4d6bae70 base_jsonify 14.0.1.1.0 2023-02-27 10:05:54 +01:00
Simone Orsi df5bd5808d base_jsonify: add handy method to get only ID from m2o 2023-02-27 10:05:54 +01:00
Simone Orsi 0127a7ef09 base_jsonify: fix _function_value -> bind to record 2023-02-27 10:05:54 +01:00
Simone Orsi 9635b0b32d base_jsonify: fix instance_method_name field def 2023-02-27 10:05:54 +01:00
OCA-git-bot 5e9bbbe48e [UPD] README.rst 2023-02-27 10:05:54 +01:00
oca-travis e4ded49ae4 [UPD] Update base_jsonify.pot 2023-02-27 10:05:54 +01:00
Chafique 5c6520adfa [MIG] base_jsonify: Migration to 14.0 2023-02-27 10:05:54 +01:00
OCA Transbot b03b7e6808 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-13.0/server-tools-13.0-base_jsonify
Translate-URL: https://translation.odoo-community.org/projects/server-tools-13-0/server-tools-13-0-base_jsonify/
2023-02-27 10:05:54 +01:00
OCA-git-bot a28879313e base_jsonify 13.0.3.0.0 2023-02-27 10:05:54 +01:00
oca-travis e6a6f6a22f [UPD] Update base_jsonify.pot 2023-02-27 10:05:54 +01:00
nans 1e9a7e6d00 [IMP] base_jsonify: cache json parser 2023-02-27 10:05:54 +01:00
nans d30ea05fcf [REF] base_jsonify: review changes 2023-02-27 10:05:54 +01:00
nans 74a4c2c713 [REF] base_jsonify: rename ir.exports.line field `alias` to `target` 2023-02-27 10:05:54 +01:00
nans 3812375799 [TEST] base_jsonify: test and document code 2023-02-27 10:05:54 +01:00
nans a648e21313 [IMP] base_jsonify: better help message in resolvers 2023-02-27 10:05:54 +01:00
nans 88173418a1 [IMP] base_jsonify: add context to resolver eval method 2023-02-27 10:05:54 +01:00
nans 09aff57cd0 [IMP] base_jsonify: simplify full parser API when not using translations 2023-02-27 10:05:54 +01:00
nans 8380df640e [IMP] base_jsonify: add lang, custom resolvers, alias* support 2023-02-27 10:05:54 +01:00
OCA Transbot 672e904d38 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-13.0/server-tools-13.0-base_jsonify
Translate-URL: https://translation.odoo-community.org/projects/server-tools-13-0/server-tools-13-0-base_jsonify/
2023-02-27 10:05:54 +01:00
OCA-git-bot 8b6cb20937 base_jsonify 13.0.1.3.1 2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) c54627cca5 [IMP] base_jsonify: Allow to export many2one and referene field as simple field
Before this change, the result of the export of a relational field was always a dict or a list of dict.

ex:

<record id="ir_exp_shopinvader_variant_lang" model="ir.exports.line">
  <field name="name">publication_language_id/name</field>
  <field name="alias">publication_language_id/name:lang</field>
  <field name="export_id" ref="shopinvader.ir_exp_shopinvader_variant" />
</record>

will output:
{
    ...
    "publication_language_id" : {
        "lang": "French"
    }
    ...
}

After this change it's now possible to define simple exporter for relational fields where the value into the result will be the display_name or a list of display_name of the related records.

ex:

<record id="ir_exp_shopinvader_variant_lang" model="ir.exports.line">
  <field name="name">publication_language_id</field>
  <field name="alias">publication_language_id:lang</field>
  <field name="export_id" ref="shopinvader.ir_exp_shopinvader_variant" />
</record>

will output:
{
    "lang": "French"
}
 Please enter the commit message for your changes. Lines starting
2023-02-27 10:05:54 +01:00
OCA-git-bot 67dfd65d12 base_jsonify 13.0.1.3.0 2023-02-27 10:05:54 +01:00
Simone Orsi 2b46ff032c base_jsonify: return one record on demand
If you use this module extensively - as I do -
you've done this tons of time. For sure :)
This little change simplifies your code base where needed.
2023-02-27 10:05:54 +01:00
OCA Transbot 5f5b50eb18 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-13.0/server-tools-13.0-base_jsonify
Translate-URL: https://translation.odoo-community.org/projects/server-tools-13-0/server-tools-13-0-base_jsonify/
2023-02-27 10:05:54 +01:00
OCA-git-bot 331e68ac3b base_jsonify 13.0.1.2.0 2023-02-27 10:05:54 +01:00
oca-travis 59bef1a997 [UPD] Update base_jsonify.pot 2023-02-27 10:05:54 +01:00
Simone Orsi bfdb5b93d7 base_jsonify: allow export line exclusion
Sometimes you just want to turn off via configuration
lines created by some other modules.
2023-02-27 10:05:54 +01:00
OCA Transbot 699771531f Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-13.0/server-tools-13.0-base_jsonify
Translate-URL: https://translation.odoo-community.org/projects/server-tools-13-0/server-tools-13-0-base_jsonify/
2023-02-27 10:05:54 +01:00
OCA-git-bot 92ba26c250 base_jsonify 13.0.1.1.0 2023-02-27 10:05:54 +01:00
OCA-git-bot 2cf2b1766f [UPD] README.rst 2023-02-27 10:05:54 +01:00
oca-travis 37292fbba6 [UPD] Update base_jsonify.pot 2023-02-27 10:05:54 +01:00
Simone Orsi cca854b1a8 base_jsonify: tests use SavepointCase 2023-02-27 10:05:54 +01:00
Simone Orsi e2e9bee9dc base_jsonify: support callable parser 2023-02-27 10:05:54 +01:00
Simone Orsi f947336f62 base_jsonify: ease override jsonify per record 2023-02-27 10:05:54 +01:00
OCA-git-bot 48fdf12ad9 pre-commit update 2023-02-27 10:05:54 +01:00
OCA Transbot f61aa138f6 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-13.0/server-tools-13.0-base_jsonify
Translate-URL: https://translation.odoo-community.org/projects/server-tools-13-0/server-tools-13-0-base_jsonify/
2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) 2296bc2271 base_jsonify 13.0.1.0.1 2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) 1cd1c11562 [FIX] base_jsonify: Serialize datetime into the user's timezone 2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) e629cac52f [FIX] base_jsonify: Add tz info into serialized datetime 2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) 4a95e38d9d [IMP] base_jsonify: Serialize Date and Datetime into ISO 8601 format 2023-02-27 10:05:54 +01:00
OCA-git-bot 87d87ef296 base_jsonify 13.0.1.0.1 2023-02-27 10:05:54 +01:00
Laurent Mignon (ACSONE) b08a2dfaf3 [FIX] base_jsonify: In odoo 12, Date and Datetime fields values are datetime object
Convert fields.Date and fields.Datetime values to string when serializing to json
2023-02-27 10:05:54 +01:00
OCA-git-bot 0bdbbf9ad8 [UPD] README.rst 2023-02-27 10:05:54 +01:00
oca-travis 3ebe6349af [UPD] Update base_jsonify.pot 2023-02-27 10:05:54 +01:00
Laurent-Corron 96e3ad7459 [MIG] base_jsonify: Migration to 13.0 2023-02-27 10:05:54 +01:00
laurent.corron b92f8d5244 [IMP] base_jsonify: black, isort 2023-02-27 10:05:54 +01:00
OCA Transbot 5a1172f34a Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-12.0/server-tools-12.0-base_jsonify
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-base_jsonify/
2023-02-27 10:05:54 +01:00
OCA-git-bot 725a054a91 base_jsonify 12.0.1.1.0 2023-02-27 10:05:54 +01:00