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

Module: Discuss

Entity: ir.actions.server

Compute Method: _compute_activity_date_deadline_range

View 19.0 View 20.0
Inputs Method Outputs
  • activity_type_id
  • activity_type_id.res_model
  • model_id
  • model_id.model
  • activity_summary
  • activity_type_id.summary
  • activity_date_deadline_range_type
  • activity_user_type
- to_reset = self.filtered(lambda act: not act.model_id or act.state != 'next_activity')
- if to_reset:
-             to_reset.activity_type_id = False
-             to_reset.activity_summary = False
-             to_reset.activity_note = False
-             to_reset.activity_date_deadline_range = False
-             to_reset.activity_date_deadline_range_type = False
-             to_reset.activity_user_type = False
- for action in (self - to_reset):
-             if action.activity_type_id.res_model and action.model_id.model != action.activity_type_id.res_model:
-                 action.activity_type_id = False
-             if not action.activity_summary:
-                 action.activity_summary = action.activity_type_id.summary
-             if not action.activity_date_deadline_range_type:
-                 action.activity_date_deadline_range_type = 'days'
-             if not action.activity_user_type:
-                 action.activity_user_type = 'specific'
+ to_reset = self.filtered(lambda act: act.state != 'next_activity')
+ to_reset.activity_date_deadline_range = False
+ to_default = (self - to_reset).filtered(lambda act: not act.activity_date_deadline_range)
+ to_default.activity_date_deadline_range = 1
  • activity_type_id
  • activity_summary
  • activity_date_deadline_range_type
  • activity_user_type

Back to entity