O'Reilly logo

Odoo Development Essentials by Daniel Reis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying data

Unlike views, regular data records don't have an XML arch structure and can't be extended using XPath expressions. But they can still be modified to replace values in their fields.

The <record id="x" model="y"> element is actually performing an insert or update operation on the model: if x does not exist, it is created; otherwise, it is updated/written over.

Since records in other modules can be accessed using a <model>.<identifier> identifier, it's perfectly legal for our module to overwrite something that was written before by another module.

Note

Note that the dot is reserved to separate the module name from the object identifier, so they shouldn't be used in identifiers. Instead use the underscore.

As an example, let's change the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required