Skip to content

Commit

Permalink
Merge pull request #94 from mlebreuil/48-add-documents-through-file-u…
Browse files Browse the repository at this point in the history
…pload-or-documentsassessment-plugin

Allow plugin to contract and invoice view
  • Loading branch information
mlebreuil authored Sep 3, 2023
2 parents e458174 + e0d8475 commit d40cb76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/netbox_contract/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Meta:
model = ServiceProvider
fields = ('id', 'url', 'display', 'name')

class NestedContracSerializer(WritableNestedSerializer):
class NestedContractSerializer(WritableNestedSerializer):
url = serializers.HyperlinkedIdentityField(
view_name='plugins-api:netbox_contract-api:contract-detail'
)
Expand Down Expand Up @@ -50,7 +50,7 @@ class ContractSerializer(NetBoxModelSerializer):
)
#circuit= NestedCircuitSerializer(many=True, required=False)
external_partie = NestedServiceProviderSerializer(many=False)
parent = NestedContracSerializer(many=False, required=False)
parent = NestedContractSerializer(many=False, required=False)
tenant= NestedTenantSerializer(many=False, required=False)

class Meta:
Expand All @@ -66,7 +66,7 @@ class InvoiceSerializer(NetBoxModelSerializer):
url = serializers.HyperlinkedIdentityField(
view_name='plugins-api:netbox_contract-api:invoice-detail'
)
contracts = NestedContracSerializer(many=True, required=False)
contracts = NestedContractSerializer(many=True, required=False)

class Meta:
model = Invoice
Expand Down Expand Up @@ -95,7 +95,7 @@ class ContractAssignementSerializer(NetBoxModelSerializer):
queryset=ContentType.objects.all()
)
content_object = serializers.SerializerMethodField(read_only=True)
contract = NestedContracSerializer()
contract = NestedContractSerializer()

class Meta:
model = ContractAssignement
Expand Down
2 changes: 2 additions & 0 deletions src/netbox_contract/templates/netbox_contract/contract.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'generic/object.html' %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% block breadcrumbs %}
{{ block.super }}
Expand Down Expand Up @@ -137,4 +138,5 @@ <h5 class="card-header">Invoices</h5>
</div>
</div>
{% endif %}
{% plugin_right_page object %}
{% endblock content %}
2 changes: 2 additions & 0 deletions src/netbox_contract/templates/netbox_contract/invoice.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'generic/object.html' %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% block breadcrumbs %}
{{ block.super }}
Expand Down Expand Up @@ -69,4 +70,5 @@ <h5 class="card-header">Contracts</h5>
{% include 'inc/panels/comments.html' %}
</div>
</div>
{% plugin_right_page object %}
{% endblock content %}

0 comments on commit d40cb76

Please sign in to comment.