add some new info to pos distributions list - has sale license-free sale
This commit is contained in:
@@ -4,6 +4,7 @@ from apps.herd.services.services import get_rancher_statistics, rancher_quota_we
|
||||
from apps.pos_device.services.services import pos_organizations_sharing_information
|
||||
from rest_framework.exceptions import APIException
|
||||
from apps.product import models as product_models
|
||||
from apps.core.models import SystemConfig
|
||||
from rest_framework import serializers
|
||||
from apps.product.exceptions import (
|
||||
QuotaWeightException,
|
||||
@@ -87,13 +88,20 @@ class QuotaDistributionSerializer(serializers.ModelSerializer):
|
||||
instance.quota
|
||||
),
|
||||
'quota_incentive_plans': quota_incentive_plans_info(instance.quota),
|
||||
'quota_sale_license': instance.quota.sale_license
|
||||
'quota_sale_license': instance.quota.sale_license,
|
||||
'has_sale_license': instance.quota.is_in_valid_time()
|
||||
}
|
||||
|
||||
sale_limitation = SystemConfig.get(
|
||||
"IGNORE_ALL_RANCHER_PURCHASE_LIMITS",
|
||||
quota_identity=instance.quota.quota_id
|
||||
)
|
||||
representation['product'] = {
|
||||
'image': instance.quota.product.img,
|
||||
'name': instance.quota.product.name,
|
||||
'id': instance.quota.product.id,
|
||||
'free_sale_for_all': sale_limitation if sale_limitation else False,
|
||||
'free_sale_for_this_rancher': self.context['rancher'].ignore_purchase_limit
|
||||
}
|
||||
|
||||
representation['pricing'] = { # noqa
|
||||
|
||||
Reference in New Issue
Block a user