add - parent to org

This commit is contained in:
2025-11-04 11:21:47 +03:30
parent 3c85d92c92
commit c2de185a26
3 changed files with 35 additions and 0 deletions

View File

@@ -82,6 +82,12 @@ class OrganizationType(BaseModel):
('CO', 'Cooperative'),
('CMP', 'Companies')
)
parent = models.ForeignKey(
'self',
on_delete=models.CASCADE,
related_name='children',
null=True
)
key = models.CharField(choices=organization_keys, default='EMP', max_length=3)
name = models.CharField(max_length=50, unique=True, null=True)
code = models.IntegerField(default=0)