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-helperfrom odoo_helper import apiodoo = api(
self.url = 'host'
self.db = 'database'
self.user = 'user'
self.password = 'password'
)odoo.version() # 1.1odoo.client() # xmlrpc.clientodoo.authenticate() # booleanodoo.check_access(
model: str,
right: str = 'check_access_rights',
chmod: List[str] = ['read'],
raise_exception: bool = True,
) # booleanodoo.search(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # anyodoo.search(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # anyodoo.records(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # anyodoo.count_records(
model: str,
condition: List[List[list]] = [[]]
): # anyodoo.fields_get(
model: str,
condition: List[List[list]] = [[]],
attributes: List[str] = []
): # anyodoo.fields_get(
self, model: str,
condition: List[List[list]] = [[]],
fields: List[str] = [],
limit: int = -1,
offset: int = -1
): # anyodoo.create(
model: str,
data: list = []
): # anyodoo.update(
model: str,
id: List[int],
value: dict
):odoo.delete(
model: str,
condtion: List[List[list]] = [[]]
):