Versiunea funcțională EUMI

This commit is contained in:
2026-08-31 16:10:46 +03:00
parent 75bcef3095
commit ce5028a27f
58 changed files with 4271 additions and 98 deletions
+14 -1
View File
@@ -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):