Check to make sure clins complete as part of checking if TO is complete
This commit is contained in:
@@ -37,6 +37,19 @@ class CLIN(Base, mixins.TimestampsMixin):
|
||||
JEDICLINType.JEDI_CLIN_3,
|
||||
]
|
||||
|
||||
@property
|
||||
def is_completed(self):
|
||||
return all(
|
||||
[
|
||||
self.number,
|
||||
self.start_date,
|
||||
self.end_date,
|
||||
self.obligated_amount,
|
||||
self.jedi_clin_type,
|
||||
len(self.loas),
|
||||
]
|
||||
)
|
||||
|
||||
def to_dictionary(self):
|
||||
return {
|
||||
c.name: getattr(self, c.name)
|
||||
|
@@ -92,9 +92,13 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
||||
def has_ended(self):
|
||||
return self.start_date is not None and Clock.today() >= self.end_date
|
||||
|
||||
@property
|
||||
def clins_are_completed(self):
|
||||
return all([len(self.clins), (clin.is_completed for clin in self.clins)])
|
||||
|
||||
@property
|
||||
def is_completed(self):
|
||||
return all([self.pdf, self.number, len(self.clins)])
|
||||
return all([self.pdf, self.number, self.clins_are_completed])
|
||||
|
||||
@property
|
||||
def is_signed(self):
|
||||
|
Reference in New Issue
Block a user