阅读(74) 最后更新: 2019年2月14日 14:16

上一页 Odoo12开发基础 中文版 | 第一章:使用Odoo开发者模式快速入门 下一页

翻译进度 100%


Odoo is a fully-featured open source platform for building applications.Based on this core framework, a suite of integrated applications was built, covering all business areas from CRM and sales to stocks and accounting.

Beyond these out-of-the-box features, Odoo's framework was built with extensibility in mind.Modifications can be implemented as extension modules, to be applied as a layer on top on the existing modules being changed, without actually changing the original code.

This provides a clean and easy-to-control customization approach.

This capability to combine several modules into feature-rich applications, along with the open source nature of Odoo, are probably important factors in the growth of the community around Odoo.In fact, there are thousands of community modules available for Odoo covering virtually every topic, and the number of people getting involved has been steadily growing every year.

OdoO 12开发要点为Odoo开发提供了一个逐步的指南,允许读者快速爬升学习曲线,并在Odoo应用程序平台上变得富有成效。同时,它试图提供良好的参考资料,每次您与Odoo一起工作时,都要保持在身边。
Odoo 12 Development Essentials provides a step-by-step guide to Odoo development, allowing readers to quickly climb the learning curve and become productive in the Odoo application platform.At the same time, it tries to provide good reference materials, to be kept close to hand every time you are working with Odoo.


熟悉Odoo的有经验的开发人员也应该从这本书中受益,它不仅使他们能够巩固他们的知识,而且还提供了一个简单的方法来更新OdoO 12.0所改变的所有细节。事实上,特别注意的是,自8.0以来,不同Odoo版本之间的所有相关更改都得到了特别的注意。
Experienced developers who are already familiar with Odoo should also benefit from this book.Not only does it allow them to consolidate their knowledge, but it also provides an easy way to get up to date with all the details that changed with Odoo 12.0.In fact, special care was taken to highlight all the relevant changes between the different Odoo versions since 8.0.

Finally, this book should provide a solid reference to be used daily, both by newcomers and experienced developers.The documentation of the relevant differences between the several Odoo versions should also be a good resource for any developer working with different Odoo versions at the same time or who is porting modules to other versions.

This books contains 14 chapters, organized into five parts: introduction, models, business logic, views, and deployment.

第二章“开发环境的准备”,介绍了如何从源代码中安装Odoo,以及如何设置整个书中使用的开发环境,我们选择在Ubuntu环境中安装Odoo,在Windows 10环境下,我们可以使用Windows Subsystem for Linux(WSL)来实现这一点。
Chapter 2, Preparing the Development Environment, explains how to install Odoo from source code and how to set up the development environment to be used throughout the book.We choose to install Odoo in an Ubuntu environment, and, with Windows 10, we can use the Windows Subsystem for Linux (WSL) to achieve this.

Chapter 3, Your First Odoo Application, provides a step-by-step guide to the creation of our first Odoo module, a book catalog for a Library app.While the example is simple, it covers all the different layers and components that can be involved in an Odoo application: models, business logic, backend views, and web frontend views.

Chapter 4, Extending Modules, explains the available inheritance mechanisms and how to use them to create extension modules, adding or modifying features from other existing add-on modules.

The second part of the book introduces the models responsible for the data model structures around which the application is built: Chapter 5, Import, Export, and Module Data, addresses the usage of data files in Odoo and their role in modules to load data and configurations to the database.It covers the XML and CSV data file formats, the external identifier concept, how to use data file in modules, and data import/export operations.

Chapter 6, Models – Structuring the Application Data, discusses the model layer in detail, introducing the framework's Object-Relational Mapping (ORM), the different types of models available, and the field types, including relational and computed fields.

In the third part, we explain how to write the business logic layer on top of the models—the controller component of the architecture.This includes the built-in ORM functions, used to manipulate the data in the models, and social features used for messages and notifications: Chapter 7, Recordsets – Working with Model Data, introduces the concepts and features of ORMs, how to query and ready to read data from models, how to manipulate recordsets, and how to write changes on model data.

Chapter 8, Business Logic – Supporting Business Processes, explores programming business logic on the server side to manipulate data and implement specific business rules.It also explains how to use wizards for more sophisticated user interaction.The built-in social features, messages, chatter, followers, and channels, are addressed, as well as testing and debugging techniques.

Chapter 9, External API – Integrating with Other Systems, shows how to implement external Odoo applications by implementing a command-line client that interacts with our Odoo server.There are several alternative client programming libraries available, which are introduced and used to implement our showcase client utility.

The fourth part explores the view layer and the several technologies that can be used for the user interface: Chapter 10, Backend Views – Design the User Interface, covers the web client's view layer, explaining the several types of views in detail and all the elements that can be used to create dynamic and intuitive user interfaces.

Chapter 11, Kanban Views and Client-Side QWeb, keeps working with the web client, but introduces Kanban views and explains the QWeb templates used to design the Kanban board elements.

Chapter 12, Reports and Server-Side QWeb, discusses using the QWeb-based report engine and everything needed to generate printer-friendly PDF reports.

Chapter 13, Creating Website Frontend Features, introduces Odoo website development, including web controller implementations and using QWeb templates to build frontend web pages.

By the end of the book, the reader should have a solid understanding of all the steps and components involved in the Odoo application development cycle, from the drawing board to the production, deployment, and maintenance of these applications.

Odoo is built using the Python programming language, so it is a good idea to have a good knowledge of it.We also choose to run Odoo in an Ubuntu host, and will do some work on the command line, so it will help to be familiar with it.

为了充分利用这本书,我们建议您对Python编程语言、Ubuntu/Debian Linux操作系统和PostgreSQL数据库进行一些补充性的阅读。
To get the most out of this book, we recommend that you do some complementary reading on the Python programming language, the Ubuntu/Debian Linux operating system, and the PostgreSQL database.

虽然我们将在Ubuntu主机(一种流行的云托管选项)中运行Odoo,但我们将提供有关如何使用Windows for Linux子系统(WSL)在Windows系统中设置我们的开发环境的指导,该系统在最近的Windows 10版本中可用。当然,使用Ubuntu/Debian本机系统也是一个不错的选择。
While we will run Odoo in an Ubuntu host (a popular cloud hosting option), we will provide guidance on how to set up our development environment in a Windows system using the Windows for Linux Subsystem (WSL), available in recent Windows 10 builds.Of course, working from an Ubuntu/Debian native system is also a good choice.

All the required software is freely available, and the instructions on where to find it will be given.

You can download the example code files for this book from your account at www.packt.com.If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps: Log in or register at www.packt.com.1.

Select the SUPPORT tab.2.

Click on Code Downloads & Errata.3.

Enter the name of the book in the Search box and follow the onscreen4.


一旦文件被下载,请确保使用以下最新版本解压缩或解压缩文件夹:WinRar/7-Zip for Windows Zipeg/iZip/UnRarX for Mac 7-Zip/PeaZip for Linux这本书的代码包也托管在GitHub上:https:/github.com/PacktPublission/Odoo-12-Development-Ess-Four-Editio n。我们也有其他的代码包,从我们丰富的图书和视频目录,可在https://github.com/PacktPublishing/.Check推出!
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of: WinRAR/7-Zip for Windows Zipeg/iZip/UnRarX for Mac 7-Zip/PeaZip for Linux The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Odoo-12-Development-Essentials-Fourth-Editio n. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/.Check them out!

We also provide a PDF file that has color images of the screenshots/diagrams used in this book.You can download it here: https://www.packtpub.com/sites/default/files/ downloads/9781789532470_ColorImages.pdf.

There are a number of text conventions used throughout this book.

Tips and tricks appear like this.

Feedback from our readers is always welcome.

General feedback: Email customercare@packtpub.com and mention the book title in the subject of your message.If you have questions about any aspect of this book, please email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen.If you have found a mistake in this book, we would be grateful if you would report this to us.Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name.

Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit authors.packt.com.

Please leave a review.Once you have read and used this book, why not leave a review on the site that you purchased it from?Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book.Thank you!For more information about Packt, please visit packt.com.





Finally, the fifth part covers deployment and maintenance practices.Some special considerations, not relevant to development environments, need to be taken into account when deploying for production use: Chapter 14, Deploying and Maintaining Production Instances, shows us how to prepare a server for production use, explaining what configuration should be taken care of and how to configure an NGINX reverse proxy for improved security and scalability.

This book was written for developers with minimal programming knowledge but a strong will to learn.We will often use the Python language and explain how to run Odoo in an Ubuntu/Debian system, but little previous knowledge of them is assumed.The code examples are kept simple and clear, and they are accompanied by appropriate explanations.


The first part introduces the Odoo framework, explains how to set up your development environment, and provides a tutorial including a thorough, step-by-step creation of a new Odoo module: Chapter 1, Quick Start Using the Developer Mode, visually introduces the Odoo development concepts by walking through the creation of an Odoo application directly from the user interface, a simple to-do tracking application.Instructions are given to set up Odoo in our workstation, but an existing Odoo installation, or an Odoo.com instance, can be used, so no local setup is required.

CodeInText:以文本、数据库表名、文件夹名、文件扩展名、路径名、虚拟URL、用户输入和Twitter手柄表示代码。下面是一个示例:“~符号是用户主目录的快捷方式,代码块设置如下:String=“NotDone”Domain=“[(‘x_is_Done’,‘=’,false)]”/>当我们希望提请您注意代码块的特定部分时,相关行或项以粗体设置:String=“NotDone”Domain=“[(x_is_Done‘,’=‘,false)]”/>任何命令行输入或输出如下所示:$createdb mydb$createdb-Template=MyDB MyDB2Bold:表示一个新术语,一个重要单词,或者在屏幕上看到的单词。例如,菜单或对话框中的单词出现在文本中。下面是一个示例:“单击调试图标并选择”编辑操作“选项,这将打开用于打开当前视图的窗口操作。”警告或重要说明如下。
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles.Here is an example: "The ~ symbol is a shortcut for the user's home directory, such as /home/daniel."A block of code is set as follows: string="Not Done" domain="[('x_is_done', '=', False)]" /> When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold: string="Not Done" domain="[('x_is_done', '=', False)]" /> Any command-line input or output is written as follows: $ createdb MyDB $ createdb --template=MyDB MyDB2 Bold: Indicates a new term, an important word, or words that you see on screen.For example, words in menus or dialog boxes appear in the text like this.Here is an example: "Click on the debug icon and select the Edit Action option.This will open the Window Actions used to open the current Views."Warnings or important notes appear like this.



odoo技术交流2 群号 625337975