Skip to main content

simple helper library for connecting database with odoo

Project description

odoo_python - Database

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.

github repo

Dharmendra Soni

How to install

pip install odoo-helper

How to use

from odoo_helper import api

Initialize it

odoo = api(
    self.url = 'host'
    self.db = 'database'
    self.user = 'user'
    self.password = 'password'
)

Get a version

odoo.version() # 1.1

Get a Client

odoo.client() # xmlrpc.client

Get a authenticate

odoo.authenticate() # boolean

Check access to a certain model

odoo.check_access(
    model: str,
    right: str = 'check_access_rights',
    chmod: List[str] = ['read'],
    raise_exception: bool = True,
) # boolean

search record in the model

odoo.search(
    model: str,
     condition: List[List[list]] = [[]], 
     limit: int = -1, 
     offset: int = -1
     ) # any

search record in the model and returns their ids

odoo.search(
    model: str,
     condition: List[List[list]] = [[]], 
     limit: int = -1, 
     offset: int = -1
     ) # any

read record in the model and returns their row

odoo.records(
    model: str,
     condition: List[List[list]] = [[]], 
     limit: int = -1, 
     offset: int = -1
     ) # any

count record in the model

odoo.count_records(
    model: str, 
    condition: List[List[list]] = [[]]
    ): # any

check if data exists or not

odoo.fields_get(
    model: str, 
    condition: List[List[list]] = [[]], 
    attributes: List[str] = []
    ): # any

search the table and fetch the records from model

odoo.fields_get(
    self, model: str, 
    condition: List[List[list]] = [[]], 
    fields: List[str] = [], 
    limit: int = -1,
    offset: int = -1
    ): # any

creates a records

odoo.create(
    model: str, 
    data: list = []
    ): # any

updates a records

odoo.update(
    model: str, 
    id: List[int], 
    value: dict
    ):

delete a records

odoo.delete(
   model: str, 
   condtion: List[List[list]] = [[]]
    ):

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odoo_helper-0.1.1.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

odoo_helper-0.1.1-py3-none-any.whl (15.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page