Odoo 12 Development Essentials
eBook - ePub

Odoo 12 Development Essentials

Fast-track your Odoo development skills to build powerful business applications, 4th Edition

Daniel Reis

Compartir libro
  1. 404 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Odoo 12 Development Essentials

Fast-track your Odoo development skills to build powerful business applications, 4th Edition

Daniel Reis

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Extend your skills with Odoo 12 to build resourceful and open source business applications

Key Features

  • Explore Odoo 12 capabilities to develop business applications
  • Program business logic and manipulate data to implement specific business rules in your applications
  • Integrate Python APIs for building customizable and scalable business logic

Book Description

Odoo is one of the best platforms for open source ERP and CRM. Its latest version, Odoo 12, brings with it new features and updates in Python packages to develop more customizable applications with additional cloud capabilities.

The book begins by covering the development essentials for building business applications. You will start your journey by learning how to install and configure Odoo, and then transition from having no specific knowledge of Odoo to being ready for application development. You will develop your first Odoo application and understand topics such as models and views. Odoo 12 Development Essentials will also guide you in using server APIs to add business logic, helping you lay a solid foundation for advanced topics. As you progress through the chapters, you will be equipped to build and customize your applications and explore the new features in Odoo 12, such as cloud integration, to scale your business applications. You will get insights into building business logic and integrating various APIs into your application.

By the end of the book, you will be able to build a business application from scratch by using the latest version of Odoo.

What you will learn

  • Manage Odoo server instances
  • Create a new Odoo application from scratch using the most frequently used elements
  • Develop new models and use inheritance to extend existing models
  • Use ORM methods in the Odoo server and from external clients
  • Create Kanban views using QWeb effectively
  • Build custom web and website CMS pages
  • Use external APIs to integrate Odoo with external applications
  • Add automated tests and techniques to debug module business logic

Who this book is for

If you are a developer familiar with Python and MVC design and want to build business applications using Odoo, this book is for you.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Odoo 12 Development Essentials un PDF/ePUB en línea?
Sí, puedes acceder a Odoo 12 Development Essentials de Daniel Reis en formato PDF o ePUB, así como a otros libros populares de Computer Science y Desktop Applications. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781789538984
Edición
4

Quick Start Using the Developer Mode

Odoo provides a rapid application development framework that's particularly suited to building business applications. This type of application is usually concerned with keeping business records, centered around create, read, update, and delete (CRUD) operations. Not only does Odoo makes it easy to build this type of application, it also provides rich components to create compelling user interfaces, such as kanban, calendar, and graph views.
This book is organized into five parts. We start by providing an overview of the Odoo framework, setting up a development environment, and building our first Odoo application. Being generally familiar with the main Odoo components, we will dive, in more detail, into each of the three main application layers—models, business logic, and views. Finally, our application will need to be deployed to a production environment and maintained. That's what is covered in the final chapter of the book.
In this chapter, we will quickly get into the action, exploring the Odoo internals directly from the web user interface, even before having set up our local development environment.
In this chapter, we will do the following:
  • Introduce the learning project used in this chapter, the to-do application.
  • Understand the Odoo architecture, editions, and releases, to have the essential context and insights relevant to working with Odoo.
  • Prepare a basic Odoo work environment, so that we can work on an example project and learn by experience. Several options are proposed:
    • Using Odoo online
    • Using the Windows all-in-one installer
    • Using Docker
  • Enable the developer mode, to make available in the user interface the tools we will be using.
  • Modify an existing model to add a field, a quick introduction to a common customization.
  • Create a custom data model, to add new data structures for your applications.
  • Configure access security, to allow specific user groups to access the application features.
  • Create menu items, to make the new data model available in the user interface.
  • Create list, form, and search views, the basic building blocks for the user interface.
We will learn by example, and the next section will introduce the project we will use for this.

Technical requirements

The minimal requirement for this chapter is to have a modern web browser, such as Firefox, Chrome, or Edge. With this you can follow the chapter using an Odoo SaaS trial database, as explained in the Preparing a basic work environment section.
You may go a little further and use a packaged Odoo distribution to have it locally installed on your computer. For that, you only need an operating system such as Windows, macOS, Debian-based Linux (such as Ubuntu), or Red Hat-based Linux (such as Fedora). Windows, Debian, and Red Hat have installation packages available. Another option is to use Docker, available for all these systems and for macOS. The Preparing a basic work environment section will guide us in any of these installation scenarios.
In this chapter, we will mostly have point-and-click interaction with the user interface. You will find the code snippets used and a summary of the steps performed in the book's code repository, at https://github.com/PacktPublishing/Odoo-12-Development-Essentials-Fourth-Edition, under the ch01 folder.

Introducing the to-do list project

The TodoMVC (http://todomvc.com/) project provides a comparison between multiple JavaScript frameworks by implementing the same simple to-do application in each of them. Inspired by this, we will go through the experience of building a simple to-do application with Odoo.
It should allow us to add new to-do items, and then mark them as completed. For example, you could add to-do items to the list, such as Buy eggs, and then check an Is Done? box once they are completed. The To-do Items should be private to the current user, so that you will only be able to access your own to-do items.
This should be enough for a simple to-do application, but to make it a little more interesting we will introduce a couple of complications. Our to-do list items should be able to include a list of people involved in the task, the work team.
It is useful to think about our application by considering several layers involved:
  • The data tier: Implemented through models
  • The logic tier: Implemented through automation code
  • The presentation tier: Implemented through views
For the data tier, we need a To-do Item model. We will also make use of the built-in partner (or contacts) model to support the work team feature. We must not forget to configure the access control security for our new model.
The logic tier used here will be the basic CRUD operations handled by the framework, and we don't have in our requirements any additional automation to support. To access the full power of the framework, we need to use Python code in developer modules. While we can't do that yet, the developer menu does provide some tools for us to implement some business logic from the user interface, the automate actions. We will work on a simple example of how to use them.
Finally, for the presentation tier we will add the menu option for our application, and the views for the to-do item model. The essential views for a business application are the list view, where we can browse the existing records, and the form view, where we can zoom in to a record and see all the details. For better usability, we can also add preconfigured filters to the search box, available in the list view. The available search options are also considered a view, so this can be done through a search view.
The following are the steps to create a to-do list:
  1. First, we will create a new model for to-do items, and then make it available to users by adding a to-do top menu for it.
  2. Next, we will create the list and form views for the To-do Items model. This new model should have these fields:
    • Description text field
    • Is Done? flag (a Boolean field)
Our specification for the application includes the ability to select a list of people that will be working on the task, so we need a Model to represent people. Fortunately, Odoo includes out of the box a model for this—the partner model (res.partner is its technical name), used to store individual people, companies, and addresses.
And only particular persons are selectable for this work team. This means that we need to modify the partner model to add this new Is Work Team? flag.
So, the To-do Items model should also include the work team field, with a list of people. The linked people are selectable from the partners/contacts that have the Is Work Team? flag enabled.
As a summary, this is what we will need to do:
  • Add a field to the partner model and form view
  • Create a To-do Item model
  • Create a to-do application menu item
  • Create a to-do Item user interface: List and form view, and U...

Índice