diff --git a/odoo-rpc.py b/odoo-rpc.py index a01c78b..30fbef3 100755 --- a/odoo-rpc.py +++ b/odoo-rpc.py @@ -17,7 +17,24 @@ def eprint(*args, **kwargs): # CONFIG FOLDER = '/home/dig/odoo-export/datas' -PARAMS = sys.argv[1:] +# PARAMS = sys.argv[1:] +PARAMS = [] +OPTS = {} +for param in sys.argv[1:]: + if param[0] == '-': + kv = param[1:].split( '=' ) + if len(kv) == 1: + OPTS[kv[0]] = False + else: + OPTS[kv[0]] = kv[1] + elif param[0] == '+': + kv = param[1:].split( '=' ) + if len(kv) == 1: + OPTS[kv[0]] = True + else: + OPTS[kv[0]] = kv[1] + else: + PARAMS.append( param ) MODEL_IGNORE = [] with open(".modelignore", "r") as file: