Manipulating recordsets

We will surely want to add, remove, or replace the elements in these related fields, and so this leads to the question: how can recordsets be manipulated?

Recordsets are immutable, meaning that their values can't be directly modified. Instead, modifying a recordset means composing a new recordset based on existing ones.

One way to do this is using the supported set operations:

  • rs1 | rs2 is the union set operation, and results in a recordset with all elements from both recordsets.
  • rs1 + rs2 is the addition set operation, to concatenate both recordsets into one. It may result in a set with duplicate records.
  • rs1 & rs2 is the intersection set operation, and results in a recordset with only the elements present in both ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.