How to use OdooRPC - 10 common examples

To help you get started, we’ve selected a few OdooRPC examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github osiell / odoorpc / tests / test_init.py View on Github external
def test_init1(self):
        # Server + Protocol + Port
        odoo = odoorpc.ODOO(ARGS.server, ARGS.protocol, ARGS.port)
        self.assertIsInstance(odoo, odoorpc.ODOO)
        self.assertIsNotNone(odoo)
        self.assertEqual(odoo.server, ARGS.server)
        self.assertEqual(odoo.protocol, ARGS.protocol)
        self.assertEqual(odoo.port, ARGS.port)
github OCA / odoorpc / tests / test_login.py View on Github external
def test_logout(self):
        odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
        user = odoo.login(ARGS.database, ARGS.user, ARGS.passwd)
        success = odoo.logout()
        self.assertTrue(success)
github OCA / odoorpc / tests / test_session.py View on Github external
def test_session_odoo_load(self):
        self.odoo.save(self.session_name, rc_file=self.file_path)
        odoo = odoorpc.ODOO.load(self.session_name, rc_file=self.file_path)
        self.assertIsInstance(odoo, odoorpc.ODOO)
        self.assertEqual(self.odoo.server, odoo.server)
        self.assertEqual(self.odoo.port, odoo.port)
        self.assertEqual(self.odoo.db, odoo.db)
        self.assertEqual(self.odoo.protocol, odoo.protocol)
        self.assertEqual(self.odoo.user, odoo.user)
        odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
github osiell / odoorpc / tests / test_login.py View on Github external
def test_login(self):
        odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
        user = odoo.login(ARGS.database, ARGS.user, ARGS.passwd)
        self.assertIsNotNone(user)
        self.assertIsInstance(user, osv.BrowseRecord)
        self.assertEqual(odoo.user, user)
        self.assertEqual(odoo.db, ARGS.database)
github OCA / odoorpc / tests / test_db_create.py View on Github external
def setUp(self):
        self.odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
github osiell / odoorpc / tests / test_init.py View on Github external
def test_init2(self):
        # Server + Protocol + Port + Timeout
        odoo = odoorpc.ODOO(ARGS.server, ARGS.protocol, ARGS.port, 42)
        self.assertIsInstance(odoo, odoorpc.ODOO)
        self.assertIsNotNone(odoo)
        self.assertEqual(odoo.server, ARGS.server)
        self.assertEqual(odoo.protocol, ARGS.protocol)
        self.assertEqual(odoo.port, ARGS.port)
        self.assertEqual(odoo.config['timeout'], 42)
github osiell / odoorpc / tests / test_login.py View on Github external
def test_logout(self):
        odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
        user = odoo.login(ARGS.database, ARGS.user, ARGS.passwd)
        success = odoo.logout()
        self.assertTrue(success)
github osiell / odoorpc / tests / test_execute.py View on Github external
def setUp(self):
        self.odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
        self.user = self.odoo.login(ARGS.database, ARGS.user, ARGS.passwd)
github OCA / odoorpc / tests / test_login.py View on Github external
def test_login_no_password(self):
        # login no password => Error
        odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
        self.assertRaises(
            odoorpc.error.Error,
            odoo.login, ARGS.user)
github OCA / odoorpc / tests / test_execute.py View on Github external
def setUp(self):
        self.odoo = odoorpc.ODOO(
            ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
            version=ARGS.version)
        self.user = self.odoo.login(ARGS.database, ARGS.user, ARGS.passwd)