Prepare ERP source for Gitea deployment

This commit is contained in:
A R R R Associates
2026-06-20 15:01:44 +05:30
commit 5c75eb6bd9
450 changed files with 67698 additions and 0 deletions
@@ -0,0 +1,27 @@
def build_client_association(current_user, role_name, selected_partner_id=None):
role = (role_name or '').lower()
if role in ('system admin', 'firm admin'):
return {
'association_type': 'firm',
'firm_tenant_id': getattr(current_user, 'tenant_id', None),
'partner_user_id': selected_partner_id,
'created_source': 'firm_admin',
}
if role == 'partner':
return {
'association_type': 'firm',
'firm_tenant_id': getattr(current_user, 'tenant_id', None),
'partner_user_id': current_user.id,
'created_source': 'partner',
}
if role == 'consultant':
return {
'association_type': 'consultant',
'consultant_id': current_user.id,
'created_source': 'consultant',
}
return {
'association_type': 'self_service_unassigned',
'created_source': 'self_service',
}