The transient model in Odoo is used as a base class for records that
are meant to be temporarily stored and automatically cleaned up over
time. It follows a short-lived data paradigm, making it ideal for
wizards and temporary operations. This model simplifies access
rights by allowing users to create records while restricting access
to only those they’ve created. However, the superuser has
unrestricted access to all transient records.
Transient models are typically used for wizard interfaces, where user
input is collected temporarily to perform specific actions like
generating reports or applying batch operations.
Records in transient models are automatically deleted after a
certain period as defined by Odoo’s garbage collection mechanism.
from odoo import models, fields
class TransientModelExample(models.TransientModel):
_name = "model.name"
field = fields.Char(string="Field Label")