Đăng ký Đăng nhập

Tài liệu Openobject-developer_2

.PDF
213
309
101

Mô tả:

Open Object Developer Book Release 1.0 Tiny SPRL 2009-04-10 CONTENTS i ii Open Object Developer Book, Release 1.0 I Forewords 5 1 Introduction 7 2 Who is this book for ? 9 3 Content of the book 11 4 About the author(s) 13 II 5 6 7 III 8 9 Part 1 : Getting Started with OpenERP 15 Development Environment 17 5.1 Working with Launchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.3 Command line options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.4 OpenERP Server and Web Client - Start/Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.5 Shutting down the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Moulder Development Approach 35 6.1 OpenObject Server and Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.2 Module Integrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 6.3 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 OpenObject Architecture - Mvc 41 7.1 MVC - Model, View, Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 7.2 MVCSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Part 2 : Module Development 47 First Module to OpenERP 49 8.1 49 The Modules - Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Objects, Fields and Methods 67 9.1 OpenERP Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 9.2 The ORM - Object Relation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 9.3 OpenERP Object Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 9.4 Object Inheritance - _inherit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 9.5 Inheritance by Delegation - _inherits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 9.6 Fields Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 CONTENTS 1 Open Object Developer Book, Release 1.0 9.7 Type of Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 9.8 ORM methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 10 Views and Events 87 10.1 Introduction to Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 10.2 Form views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 10.3 Tree views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10.4 Graph views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10.5 Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 10.6 Inheritance in Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 10.7 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 11 Menu and Actions 101 11.1 Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 11.2 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 11.3 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 IV Part 3 : Business Process Development 12 Workflow-Business Process 111 113 12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 12.2 Defining Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 12.3 General structure of a workflow XML file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 12.4 Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 12.5 Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 12.6 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 12.7 User Role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 12.8 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 12.9 Creating a Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 13 Creating Wizard - (The Process) 127 13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 13.2 Wizards - Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 13.3 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 13.4 Add A New Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 13.5 osv_memory Wizard System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 14 Reports 2 139 CONTENTS Open Object Developer Book, Release 1.0 14.1 OpenOffice.org reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 14.2 XSL:RML reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 14.3 Reports without corporate header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 14.4 Each report with its own corporate header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 14.5 Bar Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 14.6 How to add a new report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 14.7 Usual TAGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 14.8 Unicode reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 15 I18n - Internationalization 159 15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 V Part 4 : Business Process Advance Configuration 16 Server Action 161 163 16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 16.2 Client Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 16.3 Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 16.4 Email Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 16.5 Create Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 16.6 Write Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 16.7 Multi Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 17 Dashboard VI Part 5 : Migration, Upgradation, Testing 18 Data Migration - Import / Export 169 171 173 18.1 Data Importation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 19 Upgrading Server, Modules VII Part 6 : Service base Integration 20 Working with Web Services 177 179 181 20.1 How to load data ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 20.2 The objects methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 21 XML-RPC Web services CONTENTS 183 3 Open Object Developer Book, Release 1.0 21.1 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 21.2 Python Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 21.3 PHP Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 VIII Part 7 : Other Topics 22 RAD Tools 193 195 22.1 DIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 22.2 Open Office Report Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 IX Part 8 : Appendices 23 Appendices Index 199 201 23.1 Appendices A : Coding Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 23.2 Releasing a module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 23.3 Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Index 4 209 CONTENTS Part I Forewords 5 CHAPTER ONE INTRODUCTION Open ERP is a rich development environment. Thanks to its Python and PostgreSQL bindings, and above all, its Object Relational Mapping (ORM), you can develop any arbitrary complex module in Open ERP. 7 Open Object Developer Book, Release 1.0 8 Chapter 1. Introduction CHAPTER TWO WHO IS THIS BOOK FOR ? 9 Open Object Developer Book, Release 1.0 10 Chapter 2. Who is this book for ? CHAPTER THREE CONTENT OF THE BOOK Book Contents 11 Open Object Developer Book, Release 1.0 12 Chapter 3. Content of the book CHAPTER FOUR ABOUT THE AUTHOR(S) 13 Open Object Developer Book, Release 1.0 14 Chapter 4. About the author(s) Part II Part 1 : Getting Started with OpenERP 15
- Xem thêm -

Tài liệu liên quan