mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-22 02:32:07 +02:00
fix: QwebJSON circular reference on non-serializable session_info values
The QwebJSON.dumps default handler returned non-serializable objects
unchanged, causing Python's json encoder to report "Circular reference
detected". Use odoo.tools.json.json_default() as fallback to properly
convert ReadonlyDict, lazy, datetime, bytes, Domain and other types.
🤖 assisted by claude
This commit is contained in:
parent
6d349fb9e9
commit
2374290414
2 changed files with 74 additions and 1 deletions
|
|
@ -656,7 +656,7 @@ class QwebJSON(json.JSON):
|
|||
def dumps(self, *args, **kwargs):
|
||||
prev_default = kwargs.pop('default', lambda obj: obj)
|
||||
return super().dumps(*args, **kwargs, default=(
|
||||
lambda obj: prev_default(str(obj) if isinstance(obj, QwebContent) else obj)
|
||||
lambda obj: prev_default(str(obj) if isinstance(obj, QwebContent) else json.json_default(obj))
|
||||
))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue