mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
fix: dependencies and deprecated code (#390)
This commit is contained in:
co-authored by
GitHub
parent
14cab08024
commit
dddd130e79
@@ -6,7 +6,7 @@ import os
|
||||
import re
|
||||
|
||||
from collections import namedtuple
|
||||
from distutils.util import strtobool
|
||||
from .strtobool import strtobool
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.tools.config import config
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
_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):
|
||||
try:
|
||||
return _MAP[str(value).lower()]
|
||||
except KeyError:
|
||||
raise ValueError('"{}" is not a valid bool value'.format(value))
|
||||
Reference in New Issue
Block a user