Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Odoo Development Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Odoo Development Cookbook

Odoo Development Cookbook

By : Daudi, Vora, Gajjar, Fayolle, Holger Brunn, Daniel Reis
4.2 (12)
close
close
Odoo Development Cookbook

Odoo Development Cookbook

4.2 (12)
By: Daudi, Vora, Gajjar, Fayolle, Holger Brunn, Daniel Reis

Overview of this book

The latest version of the powerful Odoo framework uncovers a wide variety of features for rapid application development. Written by seasoned Odoo experts, this updated Odoo Development Cookbook will help you explore Odoo 17’s new features and use them to develop applications from scratch. You'll learn about website development concepts and get to grips with the Odoo Web Library (OWL), as well as create a new Odoo module from the ground up before progressing to advanced framework concepts. The book also shows you how to modify existing applications, including Point of Sale (POS) applications. Going beyond backend development, you'll discover advanced JavaScript recipes for creating new views and widgets. You'll get a clear understanding of website development and be on your way to becoming a proficient Odoo developer by studying performance optimization, debugging, and automated testing. By the end of this book, you'll have the knowledge you need to build impressive applications and be well-versed in Odoo development best practices.
Table of Contents (28 chapters)
close
close
17
Chapter 17: In-App Purchasing with Odoo

Logging in to/connecting Odoo with XML-RPC

In this recipe, we will carry out user authentication through RPC to check whether the credentials (server_url, db_name, username, and password) supplied are valid.

Getting ready

To connect an Odoo instance through RPC, you will need a running Odoo instance to connect with. We will assume that you have the Odoo server running on http://localhost:8017 and that you have installed the my_hostel module.

How to do it...

Perform the following steps to carry out user authentication through RPC:

  1. Add the odoo_authenticate.py file. You can place this file anywhere you want because the RPC program will work independently.
  2. Add the following code to the file:
    from xmlrpc import client
    server_url = 'http://localhost:8017'
    db_name = 'cookbook_17e'
    username = 'admin'
    password = 'admin'
    common = client.ServerProxy('%s/xmlrpc/2/common' % server_url)
    user_id = common.authenticate(db_name...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY