Skip to main content

Odoo RPC client

Project description

s6r-odoo

Installation

    pip install s6r-odoo

Usage

from s6r_odoo import OdooConnection

odoo = OdooConnection(url='http://odoo.localhost',
                          dbname='odoo',
                          user='admin',
                          password='admin')
res_partner = odoo.model('res.partner')
partner_ids = res_partner.search([],  fields=['name', 'email'])
for partner_id in partner_ids:
    print(f'{partner_id.name} : {partner_id.email}')

Testing in local environment

Setup environment

To run the tests locally, first install pytest in your venv

pip install --upgrade pytest pytest-env
# pytest-env is an optional package to handle .env variables

Then from the repository root directory, install the s6r-odoo module in editable mode in your venv:

pip install -e ./

Edit /tests/pytest.ini to setup the tests config file

[pytest]
log_cli=true
log_level=WARNING
;WARNING produces a very nice and readable output, use DEBUG or INFO if you need to catch odoo-configurator logs or test logs 
log_format = %(asctime)s %(levelname)s %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
env =
    ODOO_V16_PASSWORD=
    ODOO_V17_PASSWORD=
    ODOO_V18_PASSWORD=
; You need to fill these password env variables

For now, this is where we manage the passwords to access testing Odoo instances.

Run the tests

Go to the /tests directory cd tests, then just run:

pytest

If you are using Pycharm, this article explains in details the configuration: https://pytest-with-eric.com/integrations/pytest-pycharm-integration/#Configuring-PyCharm-for-Pytest-Optional

License

This project is licensed under the GNU Lesser General Public License (LGPL) Version 3.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

Contributors

Maintainer

This software is maintained by Scalizer.

Scaliser

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

s6r_odoo-2.1.3.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

s6r_odoo-2.1.3-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file s6r_odoo-2.1.3.tar.gz.

File metadata

  • Download URL: s6r_odoo-2.1.3.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for s6r_odoo-2.1.3.tar.gz
Algorithm Hash digest
SHA256 55be5b75a4ca54fd1d26f6dceec392bb1f03fbc8e23ec4ed3971b2a7f1de05f2
MD5 7e2bc830f78d77e242d661615faaf408
BLAKE2b-256 25c2d968e263f338901b4238742a250ddacf635135fccd0c5ae60c7ae36b4d19

See more details on using hashes here.

File details

Details for the file s6r_odoo-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: s6r_odoo-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for s6r_odoo-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 80f2fce4d6cfaa1b796777da085189c1cba506e209bd69f97a44b98cd1629929
MD5 e1eee4cea5a0a76ae856fa95754359c0
BLAKE2b-256 9490a1698d0f971f6ec0dec8dcd404964d5586597721f7b274c028fbf6663d83

See more details on using hashes here.

Supported by

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