diff --git a/odoo/scripts/databases.py b/odoo/scripts/databases.py index 8fa837d..c62e351 100644 --- a/odoo/scripts/databases.py +++ b/odoo/scripts/databases.py @@ -20,7 +20,10 @@ def dump(odoo, args): def restore(odoo, args): """ Restores database from local file to local or remote host """ - dump_path = u'{}/{}_{}.zip'.format(args.dump_path, args.host, args.database) + if args.dump_full_path: + dump_path = args.dump_full_path + else: + dump_path = u'{}/{}_{}.zip'.format(args.dump_path, args.host, args.database) with open(dump_path, 'rb') as dump_file: if args.target_host and args.target_port and args.target_password: connection = odoorpc.ODOO(args.target_host, port=args.target_port) @@ -53,6 +56,9 @@ def main(): parser.add_argument('-dp', '--dump-path', type=str, default='/tmp/', help='the absolute path where to dump the database, ' 'defaults to /tmp/') + parser.add_argument('-dfp', '--dump-full-path', type=str, + help='the absolute full path where to dump the database, ' + 'used if given, else dump path is used') parser.add_argument('-dt', '--database-target', type=str, help=('name for duplicated or restore targetted database ' ' (optional : name_copy otherwise'))