fix: dependencies and deprecated code (#390)

This commit is contained in:
Vincent Renaville
2022-11-04 14:34:29 +01:00
committed by GitHub
co-authored by GitHub
parent 14cab08024
commit dddd130e79
14 changed files with 224 additions and 111 deletions
+1 -1
View File
@@ -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
+21
View File
@@ -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))