# 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]] = [[]]
):
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dharmendrasha/odoo_python",
"name": "odoo-helper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "odoo sdk api database package",
"author": "dharmendra",
"author_email": "dharmendrashah2002@yahoo.com",
"download_url": "https://files.pythonhosted.org/packages/f3/d3/9f30eac62808effd0e4753af4542752c833b65ae040e7afb0293b6ee14d3/odoo_helper-0.1.1.tar.gz",
"platform": null,
"description": "# odoo_python - Database\n\nThis package will help to connect odoo database. It converts ``xmlrpc`` based api into into simple functions.\n\nPlease give it a star on github if you like it.\n\n[github repo](https://github.com/dharmendrasha/odoo_python)\n\n[Dharmendra Soni](https://github.com/dharmendrasha)\n\n## How to install\n\n```bash\npip install odoo-helper\n```\n\n## How to use\n\n```python\nfrom odoo_helper import api\n```\n\n## Initialize it\n\n```python\nodoo = api(\n self.url = 'host'\n self.db = 'database'\n self.user = 'user'\n self.password = 'password'\n)\n```\n\n## Get a version\n\n```python\nodoo.version() # 1.1\n```\n\n## Get a Client\n\n```python\nodoo.client() # xmlrpc.client\n```\n\n## Get a authenticate\n\n```python\nodoo.authenticate() # boolean\n```\n\n## Check access to a certain model\n\n```python\nodoo.check_access(\n model: str,\n right: str = 'check_access_rights',\n chmod: List[str] = ['read'],\n raise_exception: bool = True,\n) # boolean\n```\n\n## search record in the model\n\n```python\nodoo.search(\n model: str,\n condition: List[List[list]] = [[]], \n limit: int = -1, \n offset: int = -1\n ) # any\n```\n\n## search record in the model and returns their ids\n\n```python\nodoo.search(\n model: str,\n condition: List[List[list]] = [[]], \n limit: int = -1, \n offset: int = -1\n ) # any\n```\n\n## read record in the model and returns their row\n\n```python\nodoo.records(\n model: str,\n condition: List[List[list]] = [[]], \n limit: int = -1, \n offset: int = -1\n ) # any\n```\n\n## count record in the model\n\n```python\nodoo.count_records(\n model: str, \n condition: List[List[list]] = [[]]\n ): # any\n```\n\n## check if data exists or not\n\n```python\nodoo.fields_get(\n model: str, \n condition: List[List[list]] = [[]], \n attributes: List[str] = []\n ): # any\n```\n\n## search the table and fetch the records from model\n\n```python\nodoo.fields_get(\n self, model: str, \n condition: List[List[list]] = [[]], \n fields: List[str] = [], \n limit: int = -1,\n offset: int = -1\n ): # any\n```\n\n## creates a records\n\n```python\nodoo.create(\n model: str, \n data: list = []\n ): # any\n```\n\n## updates a records\n\n```python\nodoo.update(\n model: str, \n id: List[int], \n value: dict\n ):\n```\n\n## delete a records\n\n```python\nodoo.delete(\n model: str, \n condtion: List[List[list]] = [[]]\n ):\n```\n",
"bugtrack_url": null,
"license": "GNU",
"summary": "simple helper library for connecting database with odoo",
"version": "0.1.1",
"split_keywords": [
"odoo",
"sdk",
"api",
"database",
"package"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a1d2652f041a345d6ab4a11ab2b5a7f9ce24a5eea0da51fd0f02fde907094e8e",
"md5": "4d143159fe236c547ee869539775b128",
"sha256": "c03f457fff150ad0240c63f7458b653fb88b28bf27a7eeda338cc8e257a95c4d"
},
"downloads": -1,
"filename": "odoo_helper-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4d143159fe236c547ee869539775b128",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 15779,
"upload_time": "2023-03-12T04:50:55",
"upload_time_iso_8601": "2023-03-12T04:50:55.414891Z",
"url": "https://files.pythonhosted.org/packages/a1/d2/652f041a345d6ab4a11ab2b5a7f9ce24a5eea0da51fd0f02fde907094e8e/odoo_helper-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f3d39f30eac62808effd0e4753af4542752c833b65ae040e7afb0293b6ee14d3",
"md5": "2b5f03756f629f3274fb39c9410ee11c",
"sha256": "8cddf544751fa6c34e7a9c8b72bba41464b150d0df860ab3efdfa77e67b4175c"
},
"downloads": -1,
"filename": "odoo_helper-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "2b5f03756f629f3274fb39c9410ee11c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 15554,
"upload_time": "2023-03-12T04:50:57",
"upload_time_iso_8601": "2023-03-12T04:50:57.690307Z",
"url": "https://files.pythonhosted.org/packages/f3/d3/9f30eac62808effd0e4753af4542752c833b65ae040e7afb0293b6ee14d3/odoo_helper-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-12 04:50:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "dharmendrasha",
"github_project": "odoo_python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "odoo-helper"
}