Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Base

Entity: res.users.apikeys.description

Compute Method: _compute_expiration_date

View 20.0
Inputs Method Outputs
  • duration
+ for record in self:
+             duration = int(record.duration)
+             if duration >= 0:
+                 record.expiration_date = (
+                     fields.Date.today() + datetime.timedelta(days=duration)
+                     if int(record.duration)
+                     else None
+                 )
  • expiration_date

Back to entity