Commit Graph

11 Commits (99728bc941296b3ec05baa4d0098415773a79adb)

Author SHA1 Message Date
Simone Orsi 10eac2b7fa jsonifier: fix get_json_parser caching
The resolver was returned as a full recordset,
hence its cursor could diverge from the original one
and get closed while the other was still active.
2025-02-21 10:35:12 +01:00
Simone Orsi 2e7ee2269b jsonifier: fix field validation
An invalid field must be skipped in any case if not in strict mode.
Error message has been downgraded to warning since is not really broken
till you use string mode.

Log tests reworked.
2025-02-21 10:34:55 +01:00
Simone Orsi f58c7447ca jsonifier: fix exception warning 2025-02-21 10:29:20 +01:00
Giovanni Francesco Capalbo aee47a5e41 [ADD] jsonifier: with_fieldname option
Orig commit msg:

[ADD] use jsonifier features to retund postprocessed values, containing
field string as well

Better Version, not using function features , leaves parser syntax
intact.

[FIX] Review fixes

[FIX] small comment and style fix
2025-02-21 10:27:12 +01:00
Simone Orsi 908a4c5956 jsonifier: allow json_key override by resolver
Quite handy to take full control of the final result.
2025-02-21 09:50:53 +01:00
Simone Orsi 945f113735 jsonifier: reduce complexity of _jsonify_record 2025-02-21 09:50:43 +01:00
Laurent Mignon (ACSONE) 8d9f80f140 [FIX] jsonifier: Call callable for unknown field
If a field name into the parser definition doesn't exist into the model but is resolved by a callable, call the method. Prior to this change, it was o more possible to define computed json value for custome keys
2024-02-02 14:13:15 +01:00
Sébastien BEAU 6281758a6e jsonifier: remove deprecated logic for getting the date in user tz 2023-02-27 10:16:05 +01:00
Sébastien BEAU a9449b2be9 [IMP] jsonifier: black, isort, prettier 2023-02-27 10:05:54 +01:00
Simone Orsi 4b4de6471e jsonifier: fix date handling
We should always keep UTC and let the consumer deal w/ it.
This change is backward compatible but allows to turn off
the old behavior w/ the ctx flag `jsonifier__date_user_tz=False`.
2023-02-27 10:05:54 +01:00
Simone Orsi 47306c8143 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.
2023-02-27 10:05:54 +01:00