Exploring the Odoo Database - Copy Web Pages Between Databases
Understand transactions in the Postgres databases for troubleshooting or module development
If you are working with Odoo's website builder you may have wondered how does Odoo maintain the pages, the content on the pages, and what could i do to perhaps make a copy of an Odoo website. Well unlike many traditional websites, Odoo does not store website pages in files on your server. Instead all of your website content is stored in Postgres tables within that Odoo database.
When you see a view inside of Odoo that record is store in the table ir_ui_view within that database. It doesn't matter if it is the purchase order form inside Odoo's classic ERP framework or a web page added within the website builder. As you will learn in this video, when the Odoo server starts up the views from the modules are updated in the database if required.
For developers and Odoo integrators it is vital that you have a clear understanding of Odoo's database architecture. In this video we look specifically at how Odoo manages the various view and forms and the related tables inside Odoo. When you go to write an Odoo module it is most likely it will involve creating and updating records of some kind inside Odoo. While the ORM does a great job of hiding complexity, it is valuable to understand exactly the data that is in Odoo and how it relates to the transactions in the application you are working on.
In this video we explore the value of logging Postgres queries and analyzing them as Odoo creates and updates records. When developing modules that integrate with Odoo or for our specific purpose, copies web pages from one Odoo database to another Odoo database; it is very helpful to see exactly what data gets created and updated inside of Odoo. While looking through the code is of course quite valuable as well, it is possible to miss something with all the various layers and objects interacting with each other. By looking critically at the queries that are executed inside Postgres you can see EXACTLY what data is updated inside of Odoo. This is perfect for creating data conversion utilities, EDI integration, or collaborating with external web services.
If you have worked seriously with OpenERP / Odoo and have done any kind of development it is probably inevitable you have encountered an Invalid XML View Architecture error or Internal Server Error that can often be traced back to a bad view in ir_ui_view. In this video we take a look at that table and demonstrate how changes in that table can be seen in the source within the website builder. By locating the id from the error you received in your log within ir_ui_view and making the necessary corrections in the XML (or deleting the view entirely) you can often recover Odoo databases that refuse to come up and appear corrupted. While this video is not specifically on database recovery, we look at the specific table that is most often responsible for many common failures in getting Odoo to startup successfully.
Learn how Odoo stores its data in the Postgres Database
Learn how to see every query that Odoo generates
Critical skills for database recovery and troubleshooting
How does Odoo CMS store website pages?
The importance of ir_ui_view in Odoo applications
Odoo and Postgres Database
Why would I care about how Odoo stores data inside Postgres?
The value of seeing the queries that Odoo creates
Recovering from 'Invalid XML View Architecture'
Your Instructor
Greg Moss started working with personal computers at 12 years old. At age 15, he wrote his first paid business application, a loan management application for First American Acceptance Corporation. A few months later Greg developed a statistical application to process surveys for John A Logan College. Now more than 30 years later, Greg has produced hundreds of commercial applications and training courses, and has been involved in numerous enterprise application projects.
In addition to completing degrees in Business Administration and Information Systems Design, Greg is a Certified Information Systems Auditor, a Six Sigma Black Belt, and holds an Information Assurance Certification from Carnegie Mellon University. In addition to his successful consulting practice, Greg has worked in positions as a Chief Information Officer (CIO), Chief Executive Officer (CEO), and excels in delivering technology-enabled growth to companies. He is an experienced digital marketer and focuses on real-world results and solutions.
Greg is the founder of First Class Ventures, LLC and OdooClass.com. Over the past 8 years Greg has produced over 200 video courses covering business application development and game design.
Greg is the author of Working with Odoo, Working with Odoo 10, Working with Odoo 11, Working with Odoo 12, and Learn Odoo.