add: fix bug and add user field for income contract list api

This commit is contained in:
behruz-dev
2025-09-15 14:45:18 +05:00
parent 64dc74294a
commit b264bf632b
4 changed files with 29 additions and 3 deletions

View File

@@ -15,9 +15,15 @@ class IncomeContractSerializer(serializers.ModelSerializer):
model = IncomeContract
fields = [
'id', 'project_folder', 'project', 'income_type', 'counterparty', 'price', 'currency',
'date', 'comment'
'date', 'comment' , 'user'
]
extra_kwargs = {'id': {'read_only': True}}
def get_user(self, obj):
return {
'id': obj.user.id,
'full_name': obj.user.full_name,
}
def get_counterparty(self, obj):
return {