forked from tfrancoi/odoo_csv_import
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (36 loc) · 924 Bytes
/
Copy pathmain.py
File metadata and controls
41 lines (36 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import subprocess
def main():
# Configuration options
config_options = [
"-c",
"connection.conf",
"--file=res.bank.csv",
"--model=res.bank",
"--encoding=utf-8",
"--worker=2",
"--size=4",
"--groupby=",
"--ignore=",
"--sep=';'",
"--context=\"{'tracking_disable': True}\""
]
config_fail_options = [
"-c",
"connection.conf",
"--fail",
"--file=res.bank.csv",
"--model=res.bank",
"-encoding=utf-8",
"--ignore=",
"--sep=';'",
"--context=\"{'tracking_disable': True}\""
]
# Construct the command to run
command = ["python", "odoo_import_thread.py"] + config_options
command_fail = ["python", "odoo_import_thread.py"] + config_fail_options
# Run the command
subprocess.run(command)
subprocess.run(command_fail)
if __name__ == "__main__":
main()