mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
24 lines
393 B
Python
24 lines
393 B
Python
_MAP = {
|
|
"y": True,
|
|
"yes": True,
|
|
"t": True,
|
|
"true": True,
|
|
"on": True,
|
|
"1": True,
|
|
"n": False,
|
|
"no": False,
|
|
"f": False,
|
|
"false": False,
|
|
"off": False,
|
|
"0": False,
|
|
}
|
|
|
|
|
|
def strtobool(value):
|
|
result = _MAP.get(str(value).strip().lower())
|
|
|
|
if result is None:
|
|
raise ValueError(f"Invalid boolean value: {repr(value)}")
|
|
|
|
return result
|