add organization assignment logic in device and services modules
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import typing
|
||||
|
||||
from apps.pos_device.models import Device, StakeHolders
|
||||
from apps.product.models import (
|
||||
Quota,
|
||||
QuotaDistribution,
|
||||
Organization,
|
||||
QuotaPriceCalculationItems,
|
||||
QuotaFinalPriceTypes
|
||||
Organization
|
||||
)
|
||||
from apps.pos_device.models import Device, StakeHolderShareAmount
|
||||
import typing
|
||||
|
||||
|
||||
def pos_organizations_sharing_information(
|
||||
@@ -95,3 +94,14 @@ def agency_organization_pos_info(
|
||||
})
|
||||
|
||||
return pos_sharing_list
|
||||
|
||||
|
||||
def get_organization_by_stake_holder(id: int = None, stake_holder: StakeHolders = None) -> typing.Any:
|
||||
""" get organization object by stake holder """
|
||||
|
||||
if id:
|
||||
stake_holder = StakeHolders.objects.get(id=id)
|
||||
organization = get_organization_by_stake_holder(stake_holder=stake_holder)
|
||||
return organization
|
||||
organization = stake_holder.assignment.client.organization
|
||||
return organization
|
||||
|
||||
Reference in New Issue
Block a user