Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dharmendrasha/odoo_python
odoo_helper
https://github.com/dharmendrasha/odoo_python
class database helper odo python3
Last synced: about 1 month ago
JSON representation
odoo_helper
- Host: GitHub
- URL: https://github.com/dharmendrasha/odoo_python
- Owner: dharmendrasha
- License: gpl-3.0
- Created: 2022-04-30T17:07:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T05:05:21.000Z (almost 2 years ago)
- Last Synced: 2024-10-15T04:24:59.991Z (3 months ago)
- Topics: class, database, helper, odo, python3
- Language: Python
- Homepage: https://pypi.org/project/odoo-helper/
- Size: 3.61 MB
- Stars: 0
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/dharmendrasha/odoo_python)
[Dharmendra Soni](https://github.com/dharmendrasha)
## How to install
```bash
pip install odoo-helper
```## How to use
```python
from odoo_helper import api
```## Initialize it
```python
odoo = api(
self.url = 'host'
self.db = 'database'
self.user = 'user'
self.password = 'password'
)
```## Get a version
```python
odoo.version() # 1.1
```## Get a Client
```python
odoo.client() # xmlrpc.client
```## Get a authenticate
```python
odoo.authenticate() # boolean
```## Check access to a certain model
```python
odoo.check_access(
model: str,
right: str = 'check_access_rights',
chmod: List[str] = ['read'],
raise_exception: bool = True,
) # boolean
```## search record in the model
```python
odoo.search(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # any
```## search record in the model and returns their ids
```python
odoo.search(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # any
```## read record in the model and returns their row
```python
odoo.records(
model: str,
condition: List[List[list]] = [[]],
limit: int = -1,
offset: int = -1
) # any
```## count record in the model
```python
odoo.count_records(
model: str,
condition: List[List[list]] = [[]]
): # any
```## check if data exists or not
```python
odoo.fields_get(
model: str,
condition: List[List[list]] = [[]],
attributes: List[str] = []
): # any
```## search the table and fetch the records from model
```python
odoo.fields_get(
self, model: str,
condition: List[List[list]] = [[]],
fields: List[str] = [],
limit: int = -1,
offset: int = -1
): # any
```## creates a records
```python
odoo.create(
model: str,
data: list = []
): # any
```## updates a records
```python
odoo.update(
model: str,
id: List[int],
value: dict
):
```## delete a records
```python
odoo.delete(
model: str,
condtion: List[List[list]] = [[]]
):
```