-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_template.py
executable file
·43 lines (33 loc) · 1.21 KB
/
script_template.py
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
42
43
#! /usr/bin/env python3
# -*- encoding: utf-8 -*-
import sys
import argparse
import erppeek
from cfg_secret_configuration import odoo_configuration_user_test as odoo_configuration_user
###############################################################################
# Odoo Connection
###############################################################################
def init_openerp(url, login, password, database):
openerp = erppeek.Client(url)
uid = openerp.login(login, password=password, database=database)
user = openerp.ResUsers.browse(uid)
tz = user.tz
return openerp, uid, tz
openerp, uid, _ = init_openerp(
odoo_configuration_user['url'],
odoo_configuration_user['login'],
odoo_configuration_user['password'],
odoo_configuration_user['database'])
###############################################################################
# Script
###############################################################################
def parse_args():
parser = argparse.ArgumentParser(
description='desc')
parser.add_argument('var', help='desc')
return parser.parse_args()
def main():
# Configure arguments parser
args = parse_args()
if __name__ == "__main__":
main()