diff --git a/CHANGELOG.md b/CHANGELOG.md index 7317f45..5731dcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * [154](https://github.com/mlebreuil/netbox-contract/issues/154) Fix edit and delete bulk operations on dimensions and invoice lines. * [153](https://github.com/mlebreuil/netbox-contract/issues/153) Enforce uniquness of accounting dimensions. * Adds a status ( Active or Inactive ) to accounitng dimensions. +* [151](https://github.com/mlebreuil/netbox-contract/issues/151) Fix accounting line and dimensions search. ### Version 2.2.1 diff --git a/src/netbox_contract/api/serializers.py b/src/netbox_contract/api/serializers.py index f5d1636..9511ac0 100644 --- a/src/netbox_contract/api/serializers.py +++ b/src/netbox_contract/api/serializers.py @@ -50,7 +50,7 @@ class Meta: class NestedContractAssignmentSerializer(WritableNestedSerializer): url = serializers.HyperlinkedIdentityField( - view_name='plugins-api:netbox_contract-api:ContractAssignment-detail' + view_name='plugins-api:netbox_contract-api:contractassignment-detail' ) class Meta: @@ -61,7 +61,7 @@ class Meta: class NestedInvoicelineSerializer(WritableNestedSerializer): url = serializers.HyperlinkedIdentityField( - view_name='plugins-api:netbox_contract-api:InvoiceLine-detail' + view_name='plugins-api:netbox_contract-api:invoiceline-detail' ) class Meta: @@ -79,7 +79,7 @@ class Meta: class NestedAccountingDimensionSerializer(WritableNestedSerializer): url = serializers.HyperlinkedIdentityField( - view_name='plugins-api:netbox_contract-api:AccountingDimension-detail' + view_name='plugins-api:netbox_contract-api:accountingdimension-detail' ) class Meta: diff --git a/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py b/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py new file mode 100644 index 0000000..93f2218 --- /dev/null +++ b/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py @@ -0,0 +1,19 @@ +# Generated by Django 5.0.6 on 2024-08-18 19:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('netbox_contract', '0035_accountingdimension_status_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='invoiceline', + name='accounting_dimensions', + field=models.ManyToManyField( + blank=True, to='netbox_contract.accountingdimension' + ), + ), + ] diff --git a/src/netbox_contract/models.py b/src/netbox_contract/models.py index ff0cf09..a15e6f9 100644 --- a/src/netbox_contract/models.py +++ b/src/netbox_contract/models.py @@ -239,9 +239,7 @@ class InvoiceLine(NetBoxModel): max_length=3, choices=CurrencyChoices, default=CurrencyChoices.CURRENCY_USD ) amount = models.DecimalField(max_digits=10, decimal_places=2) - accounting_dimensions = models.ManyToManyField( - AccountingDimension, related_name='invoicelines', blank=True - ) + accounting_dimensions = models.ManyToManyField(AccountingDimension, blank=True) comments = models.TextField(blank=True) def get_absolute_url(self):