fix - showing price features in distributions seraizlier
This commit is contained in:
2
.idea/Rasaddam_Backend.iml
generated
2
.idea/Rasaddam_Backend.iml
generated
@@ -14,7 +14,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="jdk" jdkName="Python 3.8" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.10 (env)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PyDocumentationSettings">
|
<component name="PyDocumentationSettings">
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
|||||||
<component name="Black">
|
<component name="Black">
|
||||||
<option name="sdkName" value="Python 3.10 (env)" />
|
<option name="sdkName" value="Python 3.10 (env)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (env)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
||||||
@@ -114,13 +114,17 @@ class QuotaDistributionSerializer(serializers.ModelSerializer):
|
|||||||
representation['warehouse_balance'] = quotas_stat_amount['inventory_entry_balance']
|
representation['warehouse_balance'] = quotas_stat_amount['inventory_entry_balance']
|
||||||
representation['been_sold'] = quotas_stat_amount['been_sold']
|
representation['been_sold'] = quotas_stat_amount['been_sold']
|
||||||
|
|
||||||
|
# if quota stat exists and do not have attribute values, check !
|
||||||
|
attribute_values = quota.attribute_values.filter(org_quota_stat=quota_stat)
|
||||||
representation['attribute_values'] = product_serializers.AttributeValueSerializer(
|
representation['attribute_values'] = product_serializers.AttributeValueSerializer(
|
||||||
quota.attribute_values.filter(org_quota_stat=quota_stat),
|
attribute_values if attribute_values.exists() else quota.attribute_values.filter(org_quota_stat=None),
|
||||||
many=True
|
many=True
|
||||||
).data
|
).data
|
||||||
|
|
||||||
|
# if quota stat exists and do not have broker values, check !
|
||||||
|
broker_values = quota.broker_values.filter(org_quota_stat=quota_stat)
|
||||||
representation['brokers'] = QuotaBrokerValueSerializer(
|
representation['brokers'] = QuotaBrokerValueSerializer(
|
||||||
quota.broker_values.filter(org_quota_stat=quota_stat),
|
broker_values if broker_values.exists() else quota.broker_values.filter(org_quota_stat=None),
|
||||||
many=True
|
many=True
|
||||||
).data
|
).data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user