Explorar el Código

mejoras en calculo de dias disponibles en el mes para el recurso al modificar slot

Roberto Pineda hace 1 año
padre
commit
0adfc7c577

BIN
m22_planning/models/__pycache__/planning_slot.cpython-38.pyc


+ 3 - 1
m22_planning/models/planning_slot.py

@@ -22,11 +22,13 @@ class PlanningSlot(models.Model):
 
     real_working_days_count = fields.Float(
         string='Real Working Days',
+        compute='_compute_working_days_count',
         store=True,
+        help='Number of working days available in the month, regardless of slot start and end dates'
     )
 
+    @api.depends('start_datetime', 'end_datetime', 'resource_id', 'company_id')
     def _compute_working_days_count(self):
-        super(PlanningSlot, self)._compute_working_days_count()
         for slot in self:
             if not slot.start_datetime:
                 slot.real_working_days_count = 0