Author(s): Daniel Reis
Edition: 4
Publisher: Packt
Year: 2018
Language: English
Pages: 395
City: BIRMINGHAM - MUMBAI
Cover......Page 1
Title Page......Page 2
Copyright and Credits......Page 3
Packt Upsell......Page 4
Foreword......Page 5
Contributors......Page 6
Table of Contents......Page 8
Preface......Page 17
Chapter 1: Quick Start Using the Developer Mode......Page 24
Introducing the to-do list project......Page 25
Basic concepts......Page 27
The Odoo architecture......Page 28
Odoo community versus Odoo enterprise......Page 29
Odoo version policy......Page 30
Using an Odoo SaaS trial database......Page 31
Installing Odoo using Docker containers......Page 32
Creating a work database......Page 34
Enabling the developer mode......Page 36
Modifying an existing model to add a field......Page 38
Adding a field to a Model......Page 39
Adding a field to a form view......Page 41
Creating a new Model......Page 47
Configuring access control security......Page 50
Security groups......Page 51
Security access control lists......Page 52
Security record rules......Page 54
Creating menu items......Page 56
List views......Page 60
Form views......Page 62
Search views......Page 63
Questions......Page 65
Technical requirements......Page 66
Installing the Windows Subsystem for Linux......Page 67
Installing a Linux server......Page 68
Installing Odoo from source......Page 69
Installing Odoo system dependencies......Page 70
Installing Odoo from source......Page 71
Initializing a new Odoo database......Page 73
Managing Odoo databases......Page 74
More server configuration options......Page 75
Odoo server configuration files......Page 76
Database selection options......Page 77
Managing server log messages......Page 78
Finding community modules......Page 79
Installing Odoo in a Python virtual environment......Page 80
Downloading and installing add-on modules from PyPI......Page 83
The server development mode......Page 84
Summary......Page 85
Chapter 3: Your First Odoo Application......Page 86
Overview of the library project......Page 87
Preparing the addons path......Page 88
Creating the module directory and manifest......Page 89
Adding an icon......Page 92
Installing a new module......Page 93
Upgrading modules......Page 94
Adding the app's top menu item......Page 95
Adding security groups......Page 97
Adding automated tests......Page 99
Testing access security......Page 100
The model layer......Page 101
Creating the data model......Page 102
Adding access control security......Page 105
Row-level access rules......Page 107
The view layer......Page 108
Adding menu items......Page 109
Creating the form view......Page 110
Business document form views......Page 111
Adding action buttons......Page 112
The complete form view......Page 113
Adding list and search views......Page 114
Adding business logic......Page 116
Web pages and controllers......Page 117
Summary......Page 120
Further Reading......Page 121
Technical requirements......Page 122
Learning project – extending the Library app......Page 123
In-place Model extension......Page 124
Adding fields to a Model......Page 125
Modifying existing fields......Page 126
Extending Views......Page 127
Selecting extension points with XPath......Page 129
Modifying data......Page 130
More Model inheritance mechanisms......Page 131
Copying features with prototype inheritance......Page 132
Embedding Models using delegation inheritance......Page 133
Extending Models using mixin classes......Page 136
Extending Python methods......Page 139
Extending Web Controllers......Page 140
Extending QWeb Templates......Page 142
Summary......Page 143
Questions......Page 144
Further reading......Page 145
Technical requirements......Page 146
How external identifiers work......Page 147
Finding external identifiers......Page 150
Exporting data......Page 151
Importing data......Page 154
Related records in CSV data files......Page 156
Adding module data......Page 157
Demonstration data......Page 158
Using XML data files......Page 159
The noupdate data attribute......Page 161
Setting values using expressions......Page 162
Setting values on to-many relation fields......Page 163
Other actions in XML data files......Page 165
Calling model methods......Page 166
Further reading......Page 167
Technical requirements......Page 168
Creating models......Page 169
Model attributes......Page 170
Models and Python classes......Page 171
Inspecting existing models......Page 172
Basic field types......Page 174
Common field attributes......Page 177
Special field names......Page 178
Many-to-one relationships......Page 180
One-to-many inverse relationships......Page 181
Many-to-many relationships......Page 182
Hierarchical relationships......Page 184
Computed fields......Page 186
Searching and writing to computed fields......Page 188
Storing computed fields......Page 189
Model constraints......Page 190
Python model constraints......Page 191
About the Odoo base Models......Page 192
Summary......Page 193
Chapter 7: Recordsets – Working with Model Data......Page 194
Using the shell command......Page 195
Environment attributes......Page 196
The environment context......Page 197
Querying data with recordsets and domains......Page 198
Creating recordsets......Page 199
Domain expressions......Page 200
Accessing data on records......Page 202
Accessing relational fields......Page 203
Accessing date and time values......Page 204
Converting text-represented dates and times......Page 206
Writing with object-style value assignment......Page 207
Writing with the write() method......Page 208
Creating and deleting records......Page 209
Composing recordsets......Page 211
Low-level SQL and database transactions......Page 213
Summary......Page 214
Technical requirements......Page 215
Learning project – the library_checkout module......Page 216
Using stages for document-centered workflows......Page 219
Methods for singleton records – @api.one......Page 223
On change methods......Page 224
Methods for writing model data......Page 226
Methods for data import and export......Page 229
Methods to support the user interface......Page 230
The message and activity features......Page 231
Posting messages......Page 232
The wizard model......Page 233
The wizard form......Page 235
The wizard business logic......Page 237
Using log messages......Page 238
Raising exceptions......Page 239
Adding unit tests......Page 241
Running tests......Page 242
Setting up tests......Page 243
Writing test cases......Page 244
Testing exceptions......Page 245
Server development options......Page 246
The Python debugger ......Page 247
A sample debugging session......Page 248
Alternative Python debuggers......Page 249
Printing messages and logging ......Page 250
Inspecting and killing running processes......Page 251
Further reading......Page 252
Chapter 9: External API – Integrating with Other Systems......Page 253
Learning project – a client to catalogue books......Page 254
Connecting to Odoo API using XML-RPC......Page 255
Running server methods using XML-RPC......Page 256
Search and read API methods......Page 258
The Library client XML-RPC interface......Page 259
The Library client user interface......Page 261
Using the OdooRPC library......Page 264
About the ERPpeek client......Page 266
Summary......Page 267
Further reading......Page 268
Technical requirements......Page 269
Menu items......Page 270
Window Actions......Page 271
Business document views......Page 273
Header buttons......Page 275
The stage pipeline......Page 276
Using states instead of stages......Page 277
Title and subtitle......Page 278
Grouping the form content......Page 280
Tabbed notebooks......Page 281
Fields......Page 282
Field widgets......Page 283
Relational fields......Page 284
Buttons......Page 285
Smart buttons......Page 287
On-change events......Page 289
Dynamic attributes......Page 290
List views......Page 291
Search views......Page 292
Other view types......Page 294
Calendar views......Page 295
Pivot views......Page 296
Graph views......Page 297
Summary......Page 298
Further reading......Page 299
Technical requirements......Page 300
Kanban views......Page 301
Designing Kanban views......Page 304
Priority, Kanban state, and color......Page 305
Kanban card elements......Page 306
The Kanban card layout......Page 308
Adding a Kanban card option menu......Page 310
Actions in Kanban views......Page 311
The QWeb template language......Page 312
The QWeb JavaScript evaluation context......Page 313
Dynamic attributes by string substitution – t-attf......Page 314
Dynamic attributes by expressions – t-att......Page 315
Loops – t-foreach......Page 316
Conditionals – t-if......Page 317
Set values on variables – t-set......Page 318
Call and reuse other templates – t-call......Page 319
Inheritance on Kanban views......Page 321
Custom CSS and JavaScript assets......Page 322
Further reading......Page 323
Chapter 12: Reports and Server-Side QWeb......Page 324
Installing wkhtmltopdf......Page 325
Creating business reports......Page 326
QWeb report templates......Page 328
Presenting data in reports......Page 330
Report totals......Page 333
Defining paper formats......Page 335
Enabling language translation in reports......Page 336
Reports based on custom SQL......Page 337
Summary......Page 339
Further reading......Page 340
Technical requirements......Page 341
Learning project – the Library self-service......Page 342
Our first web page......Page 345
Hello World using a QWeb template......Page 347
HelloCMS!......Page 348
Building websites......Page 349
The checkout-list controller......Page 351
The checkout QWeb template......Page 353
The checkout detail page......Page 354
Further reading......Page 355
Chapter 14: Deploying and Maintaining Production Instances......Page 356
Installing dependencies......Page 357
Preparing a dedicated system user......Page 359
Setting up the configuration file......Page 360
Multiprocessing workers......Page 363
Setting up Odoo as a system service......Page 364
Creating a systemd service......Page 365
Creating an Upstart or sysvinit service......Page 366
Checking the Odoo service from the command line......Page 367
Setting up an nginx reverse proxy......Page 368
Configuring and enforcing HTTPS......Page 371
Configuring HTTPS access on nginx......Page 372
Caching static content......Page 374
Creating a staging environment......Page 375
Updating Odoo source code......Page 376
Further reading......Page 378
Assessments......Page 379
Other Books You May Enjoy......Page 385
Index......Page 388