netbox-contract 2.2.8__tar.gz → 2.2.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netbox_contract-2.2.8/src/netbox_contract.egg-info → netbox_contract-2.2.11}/PKG-INFO +1 -1
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/pyproject.toml +1 -1
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/__init__.py +2 -2
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/forms.py +148 -53
- netbox_contract-2.2.11/src/netbox_contract/migrations/0037_contract_notice_period_alter_contract_currency_and_more.py +32 -0
- netbox_contract-2.2.11/src/netbox_contract/models.py +372 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/navigation.py +13 -12
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/contract_assignments_bottom.html +3 -2
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/contract_list_bottom.html +2 -1
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/netbox_contract/accountingdimension.html +5 -4
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/netbox_contract/contract.html +41 -34
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/netbox_contract/contractassignment.html +5 -4
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/netbox_contract/invoice.html +16 -15
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/netbox_contract/invoiceline.html +6 -5
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/templates/netbox_contract/serviceprovider.html +4 -5
- {netbox_contract-2.2.8 → netbox_contract-2.2.11/src/netbox_contract.egg-info}/PKG-INFO +1 -1
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract.egg-info/SOURCES.txt +1 -0
- netbox_contract-2.2.8/src/netbox_contract/models.py +0 -267
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/LICENSE +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/MANIFEST.in +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/README.md +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/setup.cfg +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/setup.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/api/__init__.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/api/serializers.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/api/urls.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/api/views.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/constants.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/filtersets.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0001_initial.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0002_alter_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0003_alter_contract_custom_field_data_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0004_contract_currency_invoice_currency.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0005_contract_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0006_alter_contract_circuit.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0007_invoice_date.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0008_invoice_comments.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0009_contract_external_reference.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0010_invoice_contracts.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0011_auto_20230122_2112.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0012_remove_invoice_contract.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0013_contract_documents_invoice_documents.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0014_contract_end_date.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0015_contractassignement.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0016_contract_parent.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0017_alter_contract_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0018_contract_external_partie_object_id_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0019_auto_20230924_1813.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0020_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0021_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0022_alter_contract_internal_partie_alter_contract_parent.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0023_rename_contractassignement_contractassignment_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0024_remove_contract_external_partie.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0025_remove_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0026_auto_20240421_1550.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0027_invoiceline.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0028_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0029_remove_invoiceline_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0030_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0031_contract_invoice_template_invoice_template.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0032_alter_invoice_period_end_alter_invoice_period_start_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0033_remove_contract_invoice_template.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0034_contract_yrc_alter_contract_mrc.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0035_accountingdimension_status_and_more.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/migrations/__init__.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/search.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/tables.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/template_content.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/urls.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract/views.py +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract.egg-info/dependency_links.txt +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract.egg-info/not-zip-safe +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract.egg-info/requires.txt +0 -0
- {netbox_contract-2.2.8 → netbox_contract-2.2.11}/src/netbox_contract.egg-info/top_level.txt +0 -0
|
@@ -5,11 +5,11 @@ class ContractsConfig(PluginConfig):
|
|
|
5
5
|
name = 'netbox_contract'
|
|
6
6
|
verbose_name = 'Netbox contract'
|
|
7
7
|
description = 'Contract management plugin for Netbox'
|
|
8
|
-
version = '2.2.
|
|
8
|
+
version = '2.2.11'
|
|
9
9
|
author = 'Marc Lebreuil'
|
|
10
10
|
author_email = 'marc@famillelebreuil.net'
|
|
11
11
|
base_url = 'contracts'
|
|
12
|
-
min_version = '4.
|
|
12
|
+
min_version = '4.1.10'
|
|
13
13
|
required_settings = []
|
|
14
14
|
default_settings = {
|
|
15
15
|
'top_level_menu': False,
|
|
@@ -2,6 +2,7 @@ from django import forms
|
|
|
2
2
|
from django.conf import settings
|
|
3
3
|
from django.contrib.contenttypes.models import ContentType
|
|
4
4
|
from django.core.exceptions import ObjectDoesNotExist, ValidationError
|
|
5
|
+
from django.utils.translation import gettext_lazy as _
|
|
5
6
|
from netbox.forms import (
|
|
6
7
|
NetBoxModelBulkEditForm,
|
|
7
8
|
NetBoxModelFilterSetForm,
|
|
@@ -42,6 +43,9 @@ from .models import (
|
|
|
42
43
|
plugin_settings = settings.PLUGINS_CONFIG['netbox_contract']
|
|
43
44
|
default_dimensions = plugin_settings.get('default_accounting_dimensions')
|
|
44
45
|
|
|
46
|
+
# Dimensions
|
|
47
|
+
# Deprecated. To be removed in version 2.3.0
|
|
48
|
+
|
|
45
49
|
|
|
46
50
|
class Dimensions(JSONField):
|
|
47
51
|
"""
|
|
@@ -57,21 +61,27 @@ class Dimensions(JSONField):
|
|
|
57
61
|
|
|
58
62
|
|
|
59
63
|
class ContractForm(NetBoxModelForm):
|
|
60
|
-
comments = CommentField()
|
|
64
|
+
comments = CommentField(label=_('Comments'))
|
|
61
65
|
|
|
62
66
|
external_partie_object_type = ContentTypeChoiceField(
|
|
63
67
|
queryset=ContentType.objects.all(),
|
|
64
68
|
limit_choices_to=SERVICE_PROVIDER_MODELS,
|
|
65
69
|
widget=HTMXSelect(),
|
|
70
|
+
label=_('External partie object type'),
|
|
71
|
+
)
|
|
72
|
+
external_partie_object = forms.ModelChoiceField(
|
|
73
|
+
queryset=None, label=_('External partie object')
|
|
66
74
|
)
|
|
67
|
-
external_partie_object = forms.ModelChoiceField(queryset=None)
|
|
68
75
|
tenant = DynamicModelChoiceField(
|
|
69
|
-
queryset=Tenant.objects.all(), required=False, selector=True
|
|
76
|
+
queryset=Tenant.objects.all(), required=False, selector=True, label=_('Tenant')
|
|
70
77
|
)
|
|
71
78
|
parent = DynamicModelChoiceField(
|
|
72
|
-
queryset=Contract.objects.all(),
|
|
79
|
+
queryset=Contract.objects.all(),
|
|
80
|
+
required=False,
|
|
81
|
+
selector=True,
|
|
82
|
+
label=_('Parent'),
|
|
73
83
|
)
|
|
74
|
-
accounting_dimensions = Dimensions(required=False)
|
|
84
|
+
accounting_dimensions = Dimensions(required=False, label=_('Accounting dimensions'))
|
|
75
85
|
|
|
76
86
|
def __init__(self, *args, **kwargs):
|
|
77
87
|
initial = kwargs.get('initial', None)
|
|
@@ -135,6 +145,7 @@ class ContractForm(NetBoxModelForm):
|
|
|
135
145
|
'end_date',
|
|
136
146
|
'initial_term',
|
|
137
147
|
'renewal_term',
|
|
148
|
+
'notice_period',
|
|
138
149
|
'currency',
|
|
139
150
|
'accounting_dimensions',
|
|
140
151
|
'yrc',
|
|
@@ -165,14 +176,21 @@ class ContractFilterForm(NetBoxModelFilterSetForm):
|
|
|
165
176
|
model = Contract
|
|
166
177
|
|
|
167
178
|
tenant = DynamicModelChoiceField(
|
|
168
|
-
queryset=Tenant.objects.all(), required=False, selector=True
|
|
179
|
+
queryset=Tenant.objects.all(), required=False, selector=True, label=_('Tenant')
|
|
180
|
+
)
|
|
181
|
+
external_reference = forms.CharField(required=False, label=_('External reference'))
|
|
182
|
+
internal_partie = forms.ChoiceField(
|
|
183
|
+
choices=InternalEntityChoices, required=False, label=_('Internal partie')
|
|
184
|
+
)
|
|
185
|
+
status = forms.ChoiceField(choices=StatusChoices, required=False, label=_('Status'))
|
|
186
|
+
currency = forms.ChoiceField(
|
|
187
|
+
choices=CurrencyChoices, required=False, label=_('Currency')
|
|
169
188
|
)
|
|
170
|
-
external_reference = forms.CharField(required=False)
|
|
171
|
-
internal_partie = forms.ChoiceField(choices=InternalEntityChoices, required=False)
|
|
172
|
-
status = forms.ChoiceField(choices=StatusChoices, required=False)
|
|
173
|
-
currency = forms.ChoiceField(choices=CurrencyChoices, required=False)
|
|
174
189
|
parent = DynamicModelChoiceField(
|
|
175
|
-
queryset=Contract.objects.all(),
|
|
190
|
+
queryset=Contract.objects.all(),
|
|
191
|
+
required=False,
|
|
192
|
+
selector=True,
|
|
193
|
+
label=_('Parent'),
|
|
176
194
|
)
|
|
177
195
|
tag = TagFilterField(model)
|
|
178
196
|
|
|
@@ -184,20 +202,24 @@ class ContractCSVForm(NetBoxModelImportForm):
|
|
|
184
202
|
help_text='service provider object type in the form <app>.<model>',
|
|
185
203
|
)
|
|
186
204
|
external_partie_object_id = forms.CharField(
|
|
187
|
-
help_text='service provider object name', label='
|
|
205
|
+
help_text='service provider object name', label=_('External partie name')
|
|
188
206
|
)
|
|
189
207
|
tenant = CSVModelChoiceField(
|
|
190
208
|
queryset=Tenant.objects.all(),
|
|
191
209
|
to_field_name='name',
|
|
192
210
|
help_text='Tenant name',
|
|
193
211
|
required=False,
|
|
212
|
+
label=_('Tenant'),
|
|
213
|
+
)
|
|
214
|
+
status = CSVChoiceField(
|
|
215
|
+
choices=StatusChoices, help_text='Contract status', label=_('Status')
|
|
194
216
|
)
|
|
195
|
-
status = CSVChoiceField(choices=StatusChoices, help_text='Contract status')
|
|
196
217
|
parent = CSVModelChoiceField(
|
|
197
218
|
queryset=Contract.objects.all(),
|
|
198
219
|
to_field_name='name',
|
|
199
220
|
help_text='Contract name',
|
|
200
221
|
required=False,
|
|
222
|
+
label=_('Parent'),
|
|
201
223
|
)
|
|
202
224
|
|
|
203
225
|
class Meta:
|
|
@@ -238,20 +260,23 @@ class ContractCSVForm(NetBoxModelImportForm):
|
|
|
238
260
|
|
|
239
261
|
|
|
240
262
|
class ContractBulkEditForm(NetBoxModelBulkEditForm):
|
|
241
|
-
name = forms.CharField(max_length=100, required=False)
|
|
242
|
-
external_reference = forms.CharField(
|
|
243
|
-
|
|
263
|
+
name = forms.CharField(max_length=100, required=False, label=_('Name'))
|
|
264
|
+
external_reference = forms.CharField(
|
|
265
|
+
max_length=100, required=False, label=_('External reference')
|
|
266
|
+
)
|
|
267
|
+
internal_partie = forms.ChoiceField(
|
|
268
|
+
choices=InternalEntityChoices, required=False, label=_('Internal partie')
|
|
269
|
+
)
|
|
244
270
|
tenant = DynamicModelChoiceField(
|
|
245
|
-
queryset=Tenant.objects.all(),
|
|
246
|
-
required=False,
|
|
247
|
-
selector=True,
|
|
271
|
+
queryset=Tenant.objects.all(), required=False, selector=True, label=_('Tenant')
|
|
248
272
|
)
|
|
249
|
-
accounting_dimensions = Dimensions(required=False)
|
|
250
|
-
comments = CommentField(required=False)
|
|
273
|
+
accounting_dimensions = Dimensions(required=False, label=_('Accounting dimensions'))
|
|
274
|
+
comments = CommentField(required=False, label=_('Comments'))
|
|
251
275
|
parent = DynamicModelChoiceField(
|
|
252
276
|
queryset=Contract.objects.all(),
|
|
253
277
|
required=False,
|
|
254
278
|
selector=True,
|
|
279
|
+
label=_('Parent'),
|
|
255
280
|
)
|
|
256
281
|
|
|
257
282
|
nullable_fields = (
|
|
@@ -268,11 +293,15 @@ class InvoiceForm(NetBoxModelForm):
|
|
|
268
293
|
number = forms.CharField(
|
|
269
294
|
max_length=100,
|
|
270
295
|
help_text='Invoice template name will be overriden to _invoice_template_contract name',
|
|
296
|
+
label=_('Number'),
|
|
271
297
|
)
|
|
272
298
|
contracts = DynamicModelMultipleChoiceField(
|
|
273
|
-
queryset=Contract.objects.all(),
|
|
299
|
+
queryset=Contract.objects.all(),
|
|
300
|
+
required=False,
|
|
301
|
+
selector=True,
|
|
302
|
+
label=_('Contracts'),
|
|
274
303
|
)
|
|
275
|
-
accounting_dimensions = Dimensions(required=False)
|
|
304
|
+
accounting_dimensions = Dimensions(required=False, label=_('Accounting dimensions'))
|
|
276
305
|
|
|
277
306
|
def __init__(self, *args, **kwargs):
|
|
278
307
|
super().__init__(*args, **kwargs)
|
|
@@ -378,15 +407,23 @@ class InvoiceForm(NetBoxModelForm):
|
|
|
378
407
|
|
|
379
408
|
class InvoiceFilterForm(NetBoxModelFilterSetForm):
|
|
380
409
|
model = Invoice
|
|
381
|
-
number = forms.CharField(
|
|
410
|
+
number = forms.CharField(
|
|
411
|
+
required=False,
|
|
412
|
+
label=_('Number'),
|
|
413
|
+
)
|
|
382
414
|
template = forms.NullBooleanField(
|
|
383
|
-
required=False,
|
|
415
|
+
required=False,
|
|
416
|
+
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
417
|
+
label=_('Template'),
|
|
418
|
+
)
|
|
419
|
+
currency = forms.ChoiceField(
|
|
420
|
+
choices=CurrencyChoices, required=False, label=_('Currency')
|
|
384
421
|
)
|
|
385
|
-
currency = forms.ChoiceField(choices=CurrencyChoices, required=False)
|
|
386
422
|
contracts = DynamicModelMultipleChoiceField(
|
|
387
423
|
queryset=Contract.objects.all(),
|
|
388
424
|
required=False,
|
|
389
425
|
selector=True,
|
|
426
|
+
label=_('Contracts'),
|
|
390
427
|
)
|
|
391
428
|
tag = TagFilterField(model)
|
|
392
429
|
|
|
@@ -396,6 +433,7 @@ class InvoiceCSVForm(NetBoxModelImportForm):
|
|
|
396
433
|
queryset=Contract.objects.all(),
|
|
397
434
|
to_field_name='name',
|
|
398
435
|
help_text='Related Contracts',
|
|
436
|
+
label=_('Contracts'),
|
|
399
437
|
)
|
|
400
438
|
|
|
401
439
|
class Meta:
|
|
@@ -417,21 +455,52 @@ class InvoiceCSVForm(NetBoxModelImportForm):
|
|
|
417
455
|
|
|
418
456
|
|
|
419
457
|
class InvoiceBulkEditForm(NetBoxModelBulkEditForm):
|
|
420
|
-
number = forms.CharField(max_length=100, required=True)
|
|
421
|
-
template = forms.BooleanField(
|
|
422
|
-
|
|
458
|
+
number = forms.CharField(max_length=100, required=True, label=_('Number'))
|
|
459
|
+
template = forms.BooleanField(
|
|
460
|
+
required=False,
|
|
461
|
+
label=_('Template'),
|
|
462
|
+
help_text=_('Wether this invoice is a template or not'),
|
|
463
|
+
)
|
|
464
|
+
date = forms.DateField(
|
|
465
|
+
required=False,
|
|
466
|
+
label=_('Date'),
|
|
467
|
+
)
|
|
423
468
|
contracts = DynamicModelMultipleChoiceField(
|
|
424
469
|
queryset=Contract.objects.all(),
|
|
425
470
|
required=False,
|
|
426
471
|
selector=True,
|
|
427
472
|
)
|
|
428
|
-
period_start = forms.DateField(
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
473
|
+
period_start = forms.DateField(
|
|
474
|
+
required=False,
|
|
475
|
+
label=_('Period start'),
|
|
476
|
+
)
|
|
477
|
+
period_end = forms.DateField(
|
|
478
|
+
required=False,
|
|
479
|
+
label=_('Period end'),
|
|
480
|
+
)
|
|
481
|
+
currency = forms.ChoiceField(
|
|
482
|
+
choices=CurrencyChoices,
|
|
483
|
+
required=False,
|
|
484
|
+
label=_('Currency'),
|
|
485
|
+
)
|
|
486
|
+
accounting_dimensions = Dimensions(
|
|
487
|
+
required=False,
|
|
488
|
+
label=_('Accounting dimensions'),
|
|
489
|
+
)
|
|
490
|
+
amount = forms.DecimalField(
|
|
491
|
+
max_digits=10,
|
|
492
|
+
decimal_places=2,
|
|
493
|
+
required=False,
|
|
494
|
+
label=_('Amount'),
|
|
495
|
+
)
|
|
496
|
+
documents = forms.URLField(
|
|
497
|
+
required=False,
|
|
498
|
+
label=_('Documents'),
|
|
499
|
+
help_text=_('URL to the contract documents'),
|
|
500
|
+
)
|
|
501
|
+
comments = CommentField(
|
|
502
|
+
label=_('Comments'),
|
|
503
|
+
)
|
|
435
504
|
nullable_fields = (
|
|
436
505
|
'accounting_dimensions',
|
|
437
506
|
'comments',
|
|
@@ -444,8 +513,8 @@ class InvoiceBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
444
513
|
|
|
445
514
|
|
|
446
515
|
class ServiceProviderForm(NetBoxModelForm):
|
|
447
|
-
slug = SlugField()
|
|
448
|
-
comments = CommentField()
|
|
516
|
+
slug = SlugField(label=_('Slug'))
|
|
517
|
+
comments = CommentField(label=_('Comments'))
|
|
449
518
|
|
|
450
519
|
class Meta:
|
|
451
520
|
model = ServiceProvider
|
|
@@ -454,13 +523,13 @@ class ServiceProviderForm(NetBoxModelForm):
|
|
|
454
523
|
|
|
455
524
|
class ServiceProviderFilterForm(NetBoxModelFilterSetForm):
|
|
456
525
|
model = ServiceProvider
|
|
457
|
-
name = forms.CharField(required=False)
|
|
526
|
+
name = forms.CharField(required=False, label=_('Name'))
|
|
458
527
|
tag = TagFilterField(model)
|
|
459
528
|
|
|
460
529
|
|
|
461
530
|
class ServiceProviderCSVForm(NetBoxModelImportForm):
|
|
462
|
-
slug = SlugField()
|
|
463
|
-
comments = CommentField()
|
|
531
|
+
slug = SlugField(label=_('Slug'))
|
|
532
|
+
comments = CommentField(label=_('Comments'))
|
|
464
533
|
|
|
465
534
|
class Meta:
|
|
466
535
|
model = ServiceProvider
|
|
@@ -468,8 +537,8 @@ class ServiceProviderCSVForm(NetBoxModelImportForm):
|
|
|
468
537
|
|
|
469
538
|
|
|
470
539
|
class ServiceProviderBulkEditForm(NetBoxModelBulkEditForm):
|
|
471
|
-
name = forms.CharField(max_length=100, required=True)
|
|
472
|
-
comments = CommentField()
|
|
540
|
+
name = forms.CharField(max_length=100, required=True, label=_('Name'))
|
|
541
|
+
comments = CommentField(label=_('Comments'))
|
|
473
542
|
nullable_fields = ('comments',)
|
|
474
543
|
model = ServiceProvider
|
|
475
544
|
|
|
@@ -478,7 +547,9 @@ class ServiceProviderBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
478
547
|
|
|
479
548
|
|
|
480
549
|
class ContractAssignmentForm(NetBoxModelForm):
|
|
481
|
-
contract = DynamicModelChoiceField(
|
|
550
|
+
contract = DynamicModelChoiceField(
|
|
551
|
+
queryset=Contract.objects.all(), selector=True, label=_('Contract')
|
|
552
|
+
)
|
|
482
553
|
|
|
483
554
|
class Meta:
|
|
484
555
|
model = ContractAssignment
|
|
@@ -494,6 +565,7 @@ class ContractAssignmentFilterForm(NetBoxModelFilterSetForm):
|
|
|
494
565
|
contract = DynamicModelChoiceField(
|
|
495
566
|
queryset=Contract.objects.all(),
|
|
496
567
|
selector=True,
|
|
568
|
+
label=_('Contract'),
|
|
497
569
|
)
|
|
498
570
|
|
|
499
571
|
|
|
@@ -501,9 +573,12 @@ class ContractAssignmentImportForm(NetBoxModelImportForm):
|
|
|
501
573
|
content_type = CSVContentTypeField(
|
|
502
574
|
queryset=ContentType.objects.all(),
|
|
503
575
|
help_text='Content Type in the form <app>.<model>',
|
|
576
|
+
label=_('Content type'),
|
|
504
577
|
)
|
|
505
578
|
contract = CSVModelChoiceField(
|
|
506
|
-
queryset=Contract.objects.all(),
|
|
579
|
+
queryset=Contract.objects.all(),
|
|
580
|
+
help_text='Contract id',
|
|
581
|
+
label=_('Contract'),
|
|
507
582
|
)
|
|
508
583
|
|
|
509
584
|
class Meta:
|
|
@@ -515,9 +590,16 @@ class ContractAssignmentImportForm(NetBoxModelImportForm):
|
|
|
515
590
|
|
|
516
591
|
|
|
517
592
|
class InvoiceLineForm(NetBoxModelForm):
|
|
518
|
-
invoice = DynamicModelChoiceField(
|
|
593
|
+
invoice = DynamicModelChoiceField(
|
|
594
|
+
queryset=Invoice.objects.all(),
|
|
595
|
+
selector=True,
|
|
596
|
+
label=_('Invoice'),
|
|
597
|
+
)
|
|
519
598
|
accounting_dimensions = DynamicModelMultipleChoiceField(
|
|
520
|
-
queryset=AccountingDimension.objects.all(),
|
|
599
|
+
queryset=AccountingDimension.objects.all(),
|
|
600
|
+
required=False,
|
|
601
|
+
selector=True,
|
|
602
|
+
label=_('Accounting dimensions'),
|
|
521
603
|
)
|
|
522
604
|
|
|
523
605
|
def clean(self):
|
|
@@ -556,13 +638,19 @@ class InvoiceLineFilterForm(NetBoxModelFilterSetForm):
|
|
|
556
638
|
queryset=Invoice.objects.all(),
|
|
557
639
|
required=False,
|
|
558
640
|
selector=True,
|
|
641
|
+
label=_('Invoice'),
|
|
559
642
|
)
|
|
560
643
|
accounting_dimensions = DynamicModelMultipleChoiceField(
|
|
561
644
|
queryset=AccountingDimension.objects.all(),
|
|
562
645
|
required=False,
|
|
563
646
|
selector=True,
|
|
647
|
+
label=_('Accounting dimensions'),
|
|
648
|
+
)
|
|
649
|
+
currency = forms.ChoiceField(
|
|
650
|
+
choices=CurrencyChoices,
|
|
651
|
+
required=False,
|
|
652
|
+
label=_('Currency'),
|
|
564
653
|
)
|
|
565
|
-
currency = forms.ChoiceField(choices=CurrencyChoices, required=False)
|
|
566
654
|
tag = TagFilterField(model)
|
|
567
655
|
|
|
568
656
|
|
|
@@ -571,11 +659,13 @@ class InvoiceLineImportForm(NetBoxModelImportForm):
|
|
|
571
659
|
queryset=Invoice.objects.all(),
|
|
572
660
|
to_field_name='number',
|
|
573
661
|
help_text='Invoice number',
|
|
662
|
+
label=_('Invoice'),
|
|
574
663
|
)
|
|
575
664
|
accounting_dimensions = CSVModelMultipleChoiceField(
|
|
576
665
|
queryset=AccountingDimension.objects.all(),
|
|
577
666
|
to_field_name='id',
|
|
578
667
|
help_text='accounting dimension id',
|
|
668
|
+
label=_('Accounting dimensions'),
|
|
579
669
|
)
|
|
580
670
|
|
|
581
671
|
class Meta:
|
|
@@ -596,6 +686,7 @@ class InvoiceLineBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
596
686
|
queryset=AccountingDimension.objects.all(),
|
|
597
687
|
required=False,
|
|
598
688
|
selector=True,
|
|
689
|
+
label=_('Accounting dimensions'),
|
|
599
690
|
)
|
|
600
691
|
model = InvoiceLine
|
|
601
692
|
|
|
@@ -618,9 +709,13 @@ class AccountingDimensionForm(NetBoxModelForm):
|
|
|
618
709
|
class AccountingDimensionFilterForm(NetBoxModelFilterSetForm):
|
|
619
710
|
model = AccountingDimension
|
|
620
711
|
|
|
621
|
-
name = forms.CharField(required=False)
|
|
622
|
-
value = forms.CharField(required=False)
|
|
623
|
-
status = forms.ChoiceField(
|
|
712
|
+
name = forms.CharField(required=False, label=_('Name'))
|
|
713
|
+
value = forms.CharField(required=False, label=_('Value'))
|
|
714
|
+
status = forms.ChoiceField(
|
|
715
|
+
choices=AccountingDimensionStatusChoices,
|
|
716
|
+
required=False,
|
|
717
|
+
label=_('Status'),
|
|
718
|
+
)
|
|
624
719
|
|
|
625
720
|
|
|
626
721
|
class AccountingDimensionImportForm(NetBoxModelImportForm):
|
|
@@ -638,6 +733,6 @@ class AccountingDimensionImportForm(NetBoxModelImportForm):
|
|
|
638
733
|
|
|
639
734
|
|
|
640
735
|
class AccountingDimensionBulkEditForm(NetBoxModelBulkEditForm):
|
|
641
|
-
name = forms.CharField(max_length=20, required=False)
|
|
642
|
-
value = forms.CharField(max_length=20, required=False)
|
|
736
|
+
name = forms.CharField(max_length=20, required=False, label=_('Name'))
|
|
737
|
+
value = forms.CharField(max_length=20, required=False, label=_('Value'))
|
|
643
738
|
model = AccountingDimension
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated by Django 5.0.10 on 2025-01-03 19:52
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
('netbox_contract', '0036_alter_invoiceline_accounting_dimensions'),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AddField(
|
|
13
|
+
model_name='contract',
|
|
14
|
+
name='notice_period',
|
|
15
|
+
field=models.IntegerField(default=90),
|
|
16
|
+
),
|
|
17
|
+
migrations.AlterField(
|
|
18
|
+
model_name='contract',
|
|
19
|
+
name='currency',
|
|
20
|
+
field=models.CharField(default='eur', max_length=3),
|
|
21
|
+
),
|
|
22
|
+
migrations.AlterField(
|
|
23
|
+
model_name='invoice',
|
|
24
|
+
name='currency',
|
|
25
|
+
field=models.CharField(default='eur', max_length=3),
|
|
26
|
+
),
|
|
27
|
+
migrations.AlterField(
|
|
28
|
+
model_name='invoiceline',
|
|
29
|
+
name='currency',
|
|
30
|
+
field=models.CharField(default='eur', max_length=3),
|
|
31
|
+
),
|
|
32
|
+
]
|