Exploring the Odoo Database - Copy web pages between databases pt 1
This intermediate/advanced full one hour and 23 minute video shows you how to track transactions in the Postgres databases for troubleshooting or module development.
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?
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.
The importance of ir_ui_view in Odoo applications
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.
Odoo and Postgres Database v8
Why would I care about how Odoo stores data inside Postgres?
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.
The value of seeing the queries that Odoo creates
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.
Recovering from 'Invalid XML View Architecture'
If you have worked seriously with OpenERP / Odoo and have done any kind of development it is probably inevitiable 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 corrrupted. 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.