agenda: init time and _duration when creating acts for a rdv

This commit is contained in:
Benjamin Dauvergne 2013-01-05 23:35:48 +01:00
parent 06a19b4d3e
commit 7b3953674b
1 changed files with 2 additions and 0 deletions

View File

@ -414,6 +414,8 @@ class EventWithAct(Event):
from ..actes.models import Act, ActValidationState
today = today or self.start_datetime.date()
act, created = Act.objects.get_or_create(patient=self.patient,
time=self.start_datetime.time(),
_duration=self.timedelta().seconds // 60,
parent_event=getattr(self, 'parent', self),
date=today,
act_type=self.act_type)