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

Module: Certificate

Entity: certificate.certificate

Compute Method: _compute_is_valid

View 20.0
Inputs Method Outputs
  • date_start
  • date_end
  • loading_error
+ now = fields.Datetime.now()
+ for certificate in self:
+             if not certificate.date_start or not certificate.date_end or certificate.loading_error:
+                 certificate.is_valid = False
+             else:
+                 date_start = certificate.date_start
+                 date_end = certificate.date_end
+                 certificate.is_valid = date_start <= now <= date_end
  • is_valid

Back to entity