Versiunea funcțională EUMI
This commit is contained in:
+14
-1
@@ -89,7 +89,9 @@ class Employee(models.Model):
|
||||
role = models.CharField(max_length=255, verbose_name="Function/role")
|
||||
office_number = models.CharField(max_length=50, verbose_name="Office number")
|
||||
email = models.EmailField(verbose_name="Email address")
|
||||
observations = models.TextField(null=True, blank=True, verbose_name="Observations")
|
||||
|
||||
# Keep only this single observations field
|
||||
observations = models.TextField(blank=True, null=True, verbose_name="Observații")
|
||||
|
||||
# Organizational Placement - Employees can be placed at any of the three levels
|
||||
directie = models.ForeignKey(
|
||||
@@ -116,6 +118,17 @@ class Employee(models.Model):
|
||||
related_name="employees",
|
||||
verbose_name="Compartiment",
|
||||
)
|
||||
|
||||
@property
|
||||
def get_active_inventory(self):
|
||||
"""Returns a dictionary of all active equipment and certificates assigned to the user."""
|
||||
return {
|
||||
"computers": self.computers.filter(status="activ"),
|
||||
"monitors": self.monitors.filter(status="activ"),
|
||||
"peripherals": self.peripherals.filter(status="activ"),
|
||||
"certificates": self.digital_certificates.filter(is_canceled=False),
|
||||
}
|
||||
|
||||
history = HistoricalRecords()
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user