This package will help to connect odoo database. It converts xmlrpc
based api into into simple functions.
Please give it a star on github if you like it.
pip install odoo-helper
from odoo_helper import api
odoo = api(
self.url = 'host'
self.db = 'database'
self.user = 'user'
self.password = 'password'
)
odoo.version() # 1.1
odoo.client() # xmlrpc.client
odoo.authenticate() # boolean
odoo.check_access(
model: str,
right: str = 'check_access_rights',
chmod: List[str] = ['read'],
raise_exception: bool = True,
) # boolean
odoo.search(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # any
odoo.search(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # any
odoo.records(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # any
odoo.count_records(
model: str,
condition: List[List[list]] = [[]]
): # any
odoo.fields_get(
model: str,
condition: List[List[list]] = [[]],
attributes: List[str] = []
): # any
odoo.fields_get(
self, model: str,
condition: List[List[list]] = [[]],
fields: List[str] = [],
limit: int = -1,
offset: int = -1
): # any
odoo.create(
model: str,
data: list = []
): # any
odoo.update(
model: str,
id: List[int],
value: dict
):
odoo.delete(
model: str,
condtion: List[List[list]] = [[]]
):