mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 20:32:06 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -7,6 +7,7 @@ from __future__ import annotations
|
|||
|
||||
import ast
|
||||
import collections
|
||||
import collections.abc
|
||||
import itertools
|
||||
import logging
|
||||
from datetime import datetime, date
|
||||
|
|
@ -579,8 +580,15 @@ class Form:
|
|||
self._env.flush_all()
|
||||
self._env.clear() # discard cache and pending recomputations
|
||||
|
||||
if result.get('warning'):
|
||||
_logger.getChild('onchange').warning("%(title)s %(message)s", result['warning'])
|
||||
if w := result.get('warning'):
|
||||
if isinstance(w, collections.abc.Mapping) and w.keys() >= {'title', 'message'}:
|
||||
_logger.getChild('onchange').warning("%(title)s %(message)s", w)
|
||||
else:
|
||||
_logger.getChild('onchange').error(
|
||||
"received invalid warning %r from onchange on %r (should be a dict with keys `title` and `message`)",
|
||||
w,
|
||||
field_names,
|
||||
)
|
||||
|
||||
if not field_name:
|
||||
# fill in whatever fields are still missing with falsy values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue