-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5_creat_eemployee.py
More file actions
45 lines (45 loc) · 2.06 KB
/
5_creat_eemployee.py
File metadata and controls
45 lines (45 loc) · 2.06 KB
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
44
45
# # -*- coding: utf-8 -*-
# import xmlrpc.client
#
# from _odoo_conf import get_odoo_config
#
# # get odoo info from file to secure it
# odoo_info = get_odoo_config()
#
# url = odoo_info.get('server')
# db = odoo_info.get('dbname')
# username = odoo_info.get('username')
# password = odoo_info.get('pwd')
#
# login = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
# uid = login.authenticate(db, username, password, {})
# models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
#
#
# recored_info = models.execute_kw(db, uid, password,
# 'hr.employee',
# 'search_read',
# [[('work_email', '=', 'quang.trinhvan@vti.com.vn')]],
# {
# 'fields': [
# 'id', # - Employee_id
# 'name', # - Full_name
# 'department_id', # - Unit [id, name]
# # n/a - Employee_code
# 'gender', # - Sex (0 is female, 1 is male)
# 'birthday', # - Birthday
# 'work_email', # - Email
# 'work_phone', # - Phone_number
# # n/a - Post_code
# 'address_home_id', # - Address
# # n/a - Team
# 'contract_id', # - Contract_type
# 'work_location', # - Working_site
# # - Skills
# # - Certificates
# 'image', # - Avatar_path (base64)
# ],
# 'limit': 1
# })
#
# print(recored_info)