netbox-contract 2.2.10__tar.gz → 2.3.0__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.10/src/netbox_contract.egg-info → netbox_contract-2.3.0}/PKG-INFO +4 -4
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/README.md +2 -2
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/pyproject.toml +1 -1
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/__init__.py +1 -6
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/api/serializers.py +0 -5
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/forms.py +2 -34
- netbox_contract-2.3.0/src/netbox_contract/migrations/0038_alter_accountingdimension_options_and_more.py +31 -0
- netbox_contract-2.3.0/src/netbox_contract/migrations/0039_alter_accountingdimension_status_and_more.py +22 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/models.py +9 -13
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/tables.py +8 -2
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/contract_assignments_bottom.html +1 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/contract_list_bottom.html +1 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/netbox_contract/accountingdimension.html +1 -1
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/netbox_contract/contract.html +1 -7
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/netbox_contract/invoice.html +0 -6
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/views.py +0 -2
- {netbox_contract-2.2.10 → netbox_contract-2.3.0/src/netbox_contract.egg-info}/PKG-INFO +4 -4
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract.egg-info/SOURCES.txt +2 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/LICENSE +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/MANIFEST.in +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/setup.cfg +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/setup.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/api/__init__.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/api/urls.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/api/views.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/constants.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/filtersets.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0001_initial.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0002_alter_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0003_alter_contract_custom_field_data_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0004_contract_currency_invoice_currency.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0005_contract_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0006_alter_contract_circuit.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0007_invoice_date.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0008_invoice_comments.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0009_contract_external_reference.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0010_invoice_contracts.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0011_auto_20230122_2112.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0012_remove_invoice_contract.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0013_contract_documents_invoice_documents.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0014_contract_end_date.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0015_contractassignement.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0016_contract_parent.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0017_alter_contract_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0018_contract_external_partie_object_id_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0019_auto_20230924_1813.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0020_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0021_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0022_alter_contract_internal_partie_alter_contract_parent.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0023_rename_contractassignement_contractassignment_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0024_remove_contract_external_partie.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0025_remove_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0026_auto_20240421_1550.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0027_invoiceline.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0028_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0029_remove_invoiceline_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0030_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0031_contract_invoice_template_invoice_template.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0032_alter_invoice_period_end_alter_invoice_period_start_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0033_remove_contract_invoice_template.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0034_contract_yrc_alter_contract_mrc.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0035_accountingdimension_status_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0037_contract_notice_period_alter_contract_currency_and_more.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/__init__.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/navigation.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/search.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/template_content.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/netbox_contract/contractassignment.html +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/netbox_contract/invoiceline.html +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/templates/netbox_contract/serviceprovider.html +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/urls.py +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract.egg-info/dependency_links.txt +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract.egg-info/not-zip-safe +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract.egg-info/requires.txt +0 -0
- {netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: netbox-contract
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Contract management plugin for Netbox
|
|
5
5
|
Author-email: Marc Lebreuil <marc@famillelebreuil.net>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mlebreuil/netbox-contract
|
|
@@ -97,8 +97,8 @@ FIELD_CHOICES = {
|
|
|
97
97
|
('pln', 'PLN'),
|
|
98
98
|
),
|
|
99
99
|
'netbox_contract.Contract.status': (
|
|
100
|
-
('
|
|
101
|
-
('
|
|
100
|
+
('active', 'Active', 'green'),
|
|
101
|
+
('canceled', 'Canceled', 'red'),
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -5,7 +5,7 @@ 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.
|
|
8
|
+
version = '2.3.0'
|
|
9
9
|
author = 'Marc Lebreuil'
|
|
10
10
|
author_email = 'marc@famillelebreuil.net'
|
|
11
11
|
base_url = 'contracts'
|
|
@@ -13,11 +13,6 @@ class ContractsConfig(PluginConfig):
|
|
|
13
13
|
required_settings = []
|
|
14
14
|
default_settings = {
|
|
15
15
|
'top_level_menu': False,
|
|
16
|
-
'default_accounting_dimensions': {
|
|
17
|
-
'account': '',
|
|
18
|
-
'project': '',
|
|
19
|
-
'cost center': '',
|
|
20
|
-
},
|
|
21
16
|
'mandatory_contract_fields': [],
|
|
22
17
|
'hidden_contract_fields': [],
|
|
23
18
|
'mandatory_invoice_fields': [],
|
|
@@ -45,7 +45,6 @@ class NestedContractSerializer(WritableNestedSerializer):
|
|
|
45
45
|
'initial_term',
|
|
46
46
|
'renewal_term',
|
|
47
47
|
'currency',
|
|
48
|
-
'accounting_dimensions',
|
|
49
48
|
'mrc',
|
|
50
49
|
'yrc',
|
|
51
50
|
'nrc',
|
|
@@ -115,7 +114,6 @@ class ContractSerializer(NetBoxModelSerializer):
|
|
|
115
114
|
'initial_term',
|
|
116
115
|
'renewal_term',
|
|
117
116
|
'currency',
|
|
118
|
-
'accounting_dimensions',
|
|
119
117
|
'mrc',
|
|
120
118
|
'yrc',
|
|
121
119
|
'nrc',
|
|
@@ -144,7 +142,6 @@ class ContractSerializer(NetBoxModelSerializer):
|
|
|
144
142
|
'initial_term',
|
|
145
143
|
'renewal_term',
|
|
146
144
|
'currency',
|
|
147
|
-
'accounting_dimensions',
|
|
148
145
|
'mrc',
|
|
149
146
|
'yrc',
|
|
150
147
|
'nrc',
|
|
@@ -188,7 +185,6 @@ class InvoiceSerializer(NetBoxModelSerializer):
|
|
|
188
185
|
'period_start',
|
|
189
186
|
'period_end',
|
|
190
187
|
'currency',
|
|
191
|
-
'accounting_dimensions',
|
|
192
188
|
'amount',
|
|
193
189
|
'comments',
|
|
194
190
|
'tags',
|
|
@@ -207,7 +203,6 @@ class InvoiceSerializer(NetBoxModelSerializer):
|
|
|
207
203
|
'period_start',
|
|
208
204
|
'period_end',
|
|
209
205
|
'currency',
|
|
210
|
-
'accounting_dimensions',
|
|
211
206
|
'amount',
|
|
212
207
|
'comments',
|
|
213
208
|
)
|
|
@@ -20,7 +20,6 @@ from utilities.forms.fields import (
|
|
|
20
20
|
CSVModelMultipleChoiceField,
|
|
21
21
|
DynamicModelChoiceField,
|
|
22
22
|
DynamicModelMultipleChoiceField,
|
|
23
|
-
JSONField,
|
|
24
23
|
SlugField,
|
|
25
24
|
TagFilterField,
|
|
26
25
|
)
|
|
@@ -41,20 +40,6 @@ from .models import (
|
|
|
41
40
|
)
|
|
42
41
|
|
|
43
42
|
plugin_settings = settings.PLUGINS_CONFIG['netbox_contract']
|
|
44
|
-
default_dimensions = plugin_settings.get('default_accounting_dimensions')
|
|
45
|
-
|
|
46
|
-
# Dimensions
|
|
47
|
-
# Deprecated. To be removed in version 3.0
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class Dimensions(JSONField):
|
|
51
|
-
"""
|
|
52
|
-
Custom wrapper around Netbox's JSONField
|
|
53
|
-
"""
|
|
54
|
-
|
|
55
|
-
def __init__(self, *args, **kwargs):
|
|
56
|
-
super().__init__(*args, **kwargs)
|
|
57
|
-
self.widget.attrs['placeholder'] = str(default_dimensions)
|
|
58
43
|
|
|
59
44
|
|
|
60
45
|
# Contract
|
|
@@ -81,7 +66,6 @@ class ContractForm(NetBoxModelForm):
|
|
|
81
66
|
selector=True,
|
|
82
67
|
label=_('Parent'),
|
|
83
68
|
)
|
|
84
|
-
accounting_dimensions = Dimensions(required=False, label=_('Accounting dimensions'))
|
|
85
69
|
|
|
86
70
|
def __init__(self, *args, **kwargs):
|
|
87
71
|
initial = kwargs.get('initial', None)
|
|
@@ -147,7 +131,6 @@ class ContractForm(NetBoxModelForm):
|
|
|
147
131
|
'renewal_term',
|
|
148
132
|
'notice_period',
|
|
149
133
|
'currency',
|
|
150
|
-
'accounting_dimensions',
|
|
151
134
|
'yrc',
|
|
152
135
|
'mrc',
|
|
153
136
|
'nrc',
|
|
@@ -237,7 +220,6 @@ class ContractCSVForm(NetBoxModelImportForm):
|
|
|
237
220
|
'initial_term',
|
|
238
221
|
'renewal_term',
|
|
239
222
|
'currency',
|
|
240
|
-
'accounting_dimensions',
|
|
241
223
|
'yrc',
|
|
242
224
|
'mrc',
|
|
243
225
|
'nrc',
|
|
@@ -270,7 +252,6 @@ class ContractBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
270
252
|
tenant = DynamicModelChoiceField(
|
|
271
253
|
queryset=Tenant.objects.all(), required=False, selector=True, label=_('Tenant')
|
|
272
254
|
)
|
|
273
|
-
accounting_dimensions = Dimensions(required=False, label=_('Accounting dimensions'))
|
|
274
255
|
comments = CommentField(required=False, label=_('Comments'))
|
|
275
256
|
parent = DynamicModelChoiceField(
|
|
276
257
|
queryset=Contract.objects.all(),
|
|
@@ -279,10 +260,7 @@ class ContractBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
279
260
|
label=_('Parent'),
|
|
280
261
|
)
|
|
281
262
|
|
|
282
|
-
nullable_fields = (
|
|
283
|
-
'accounting_dimensions',
|
|
284
|
-
'comments',
|
|
285
|
-
)
|
|
263
|
+
nullable_fields = ('comments',)
|
|
286
264
|
model = Contract
|
|
287
265
|
|
|
288
266
|
|
|
@@ -301,7 +279,6 @@ class InvoiceForm(NetBoxModelForm):
|
|
|
301
279
|
selector=True,
|
|
302
280
|
label=_('Contracts'),
|
|
303
281
|
)
|
|
304
|
-
accounting_dimensions = Dimensions(required=False, label=_('Accounting dimensions'))
|
|
305
282
|
|
|
306
283
|
def __init__(self, *args, **kwargs):
|
|
307
284
|
super().__init__(*args, **kwargs)
|
|
@@ -392,7 +369,6 @@ class InvoiceForm(NetBoxModelForm):
|
|
|
392
369
|
'period_start',
|
|
393
370
|
'period_end',
|
|
394
371
|
'currency',
|
|
395
|
-
'accounting_dimensions',
|
|
396
372
|
'amount',
|
|
397
373
|
'documents',
|
|
398
374
|
'comments',
|
|
@@ -446,7 +422,6 @@ class InvoiceCSVForm(NetBoxModelImportForm):
|
|
|
446
422
|
'period_start',
|
|
447
423
|
'period_end',
|
|
448
424
|
'currency',
|
|
449
|
-
'accounting_dimensions',
|
|
450
425
|
'amount',
|
|
451
426
|
'documents',
|
|
452
427
|
'comments',
|
|
@@ -483,10 +458,6 @@ class InvoiceBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
483
458
|
required=False,
|
|
484
459
|
label=_('Currency'),
|
|
485
460
|
)
|
|
486
|
-
accounting_dimensions = Dimensions(
|
|
487
|
-
required=False,
|
|
488
|
-
label=_('Accounting dimensions'),
|
|
489
|
-
)
|
|
490
461
|
amount = forms.DecimalField(
|
|
491
462
|
max_digits=10,
|
|
492
463
|
decimal_places=2,
|
|
@@ -501,10 +472,7 @@ class InvoiceBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
501
472
|
comments = CommentField(
|
|
502
473
|
label=_('Comments'),
|
|
503
474
|
)
|
|
504
|
-
nullable_fields = (
|
|
505
|
-
'accounting_dimensions',
|
|
506
|
-
'comments',
|
|
507
|
-
)
|
|
475
|
+
nullable_fields = ('comments',)
|
|
508
476
|
|
|
509
477
|
model = Invoice
|
|
510
478
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Generated by Django 5.0.10 on 2025-01-05 11:13
|
|
2
|
+
|
|
3
|
+
from django.db import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
(
|
|
9
|
+
'netbox_contract',
|
|
10
|
+
'0037_contract_notice_period_alter_contract_currency_and_more',
|
|
11
|
+
),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.AlterModelOptions(
|
|
16
|
+
name='accountingdimension',
|
|
17
|
+
options={'ordering': ('name', 'value')},
|
|
18
|
+
),
|
|
19
|
+
migrations.AlterModelOptions(
|
|
20
|
+
name='invoiceline',
|
|
21
|
+
options={'ordering': ('invoice',)},
|
|
22
|
+
),
|
|
23
|
+
migrations.RemoveField(
|
|
24
|
+
model_name='contract',
|
|
25
|
+
name='accounting_dimensions',
|
|
26
|
+
),
|
|
27
|
+
migrations.RemoveField(
|
|
28
|
+
model_name='invoice',
|
|
29
|
+
name='accounting_dimensions',
|
|
30
|
+
),
|
|
31
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Generated by Django 5.0.10 on 2025-01-13 20:31
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
('netbox_contract', '0038_alter_accountingdimension_options_and_more'),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AlterField(
|
|
13
|
+
model_name='accountingdimension',
|
|
14
|
+
name='status',
|
|
15
|
+
field=models.CharField(default='active', max_length=50),
|
|
16
|
+
),
|
|
17
|
+
migrations.AlterField(
|
|
18
|
+
model_name='contract',
|
|
19
|
+
name='status',
|
|
20
|
+
field=models.CharField(default='active', max_length=50),
|
|
21
|
+
),
|
|
22
|
+
]
|
|
@@ -14,8 +14,8 @@ from utilities.choices import ChoiceSet
|
|
|
14
14
|
class StatusChoices(ChoiceSet):
|
|
15
15
|
key = 'Contract.status'
|
|
16
16
|
|
|
17
|
-
STATUS_ACTIVE = '
|
|
18
|
-
STATUS_CANCELED = '
|
|
17
|
+
STATUS_ACTIVE = 'active'
|
|
18
|
+
STATUS_CANCELED = 'canceled'
|
|
19
19
|
|
|
20
20
|
CHOICES = [
|
|
21
21
|
(STATUS_ACTIVE, 'Active', 'green'),
|
|
@@ -26,8 +26,8 @@ class StatusChoices(ChoiceSet):
|
|
|
26
26
|
class AccountingDimensionStatusChoices(ChoiceSet):
|
|
27
27
|
key = 'AccountingDimension.status'
|
|
28
28
|
|
|
29
|
-
STATUS_ACTIVE = '
|
|
30
|
-
STATUS_INACTIVE = '
|
|
29
|
+
STATUS_ACTIVE = 'active'
|
|
30
|
+
STATUS_INACTIVE = 'inactive'
|
|
31
31
|
|
|
32
32
|
CHOICES = [
|
|
33
33
|
(STATUS_ACTIVE, 'Active', 'green'),
|
|
@@ -84,6 +84,9 @@ class AccountingDimension(NetBoxModel):
|
|
|
84
84
|
def __str__(self):
|
|
85
85
|
return self.dimension
|
|
86
86
|
|
|
87
|
+
def get_status_color(self):
|
|
88
|
+
return AccountingDimensionStatusChoices.colors.get(self.status)
|
|
89
|
+
|
|
87
90
|
class Meta:
|
|
88
91
|
constraints = [
|
|
89
92
|
models.UniqueConstraint(
|
|
@@ -201,12 +204,6 @@ class Contract(NetBoxModel):
|
|
|
201
204
|
default=CURRENCY_DEFAULT,
|
|
202
205
|
verbose_name=_('currency'),
|
|
203
206
|
)
|
|
204
|
-
accounting_dimensions = models.JSONField(
|
|
205
|
-
null=True,
|
|
206
|
-
blank=True,
|
|
207
|
-
verbose_name=_('accounting dimensions'),
|
|
208
|
-
help_text=_('This field is deprecated and will be removed in version 3'),
|
|
209
|
-
)
|
|
210
207
|
yrc = models.DecimalField(
|
|
211
208
|
verbose_name=_('yearly recuring cost'),
|
|
212
209
|
max_digits=10,
|
|
@@ -249,6 +246,8 @@ class Contract(NetBoxModel):
|
|
|
249
246
|
def get_absolute_url(self):
|
|
250
247
|
return reverse('plugins:netbox_contract:contract', args=[self.pk])
|
|
251
248
|
|
|
249
|
+
def get_status_color(self):
|
|
250
|
+
return StatusChoices.colors.get(self.status)
|
|
252
251
|
class Meta:
|
|
253
252
|
ordering = ('name',)
|
|
254
253
|
indexes = [
|
|
@@ -290,9 +289,6 @@ class Invoice(NetBoxModel):
|
|
|
290
289
|
default=CURRENCY_DEFAULT,
|
|
291
290
|
verbose_name=_('currency'),
|
|
292
291
|
)
|
|
293
|
-
accounting_dimensions = models.JSONField(
|
|
294
|
-
null=True, verbose_name=_('accounting dimensions')
|
|
295
|
-
)
|
|
296
292
|
amount = models.DecimalField(
|
|
297
293
|
max_digits=10, decimal_places=2, verbose_name=_('amount')
|
|
298
294
|
)
|
|
@@ -100,6 +100,9 @@ class ContractListTable(NetBoxTable):
|
|
|
100
100
|
external_partie_object = tables.Column(verbose_name='External partie', linkify=True)
|
|
101
101
|
parent = tables.Column(linkify=True)
|
|
102
102
|
yrc = tables.Column(verbose_name='Yerly recuring costs')
|
|
103
|
+
status = columns.ChoiceFieldColumn(
|
|
104
|
+
verbose_name=('Status'),
|
|
105
|
+
)
|
|
103
106
|
|
|
104
107
|
class Meta(NetBoxTable.Meta):
|
|
105
108
|
model = Contract
|
|
@@ -118,7 +121,6 @@ class ContractListTable(NetBoxTable):
|
|
|
118
121
|
'initial_term',
|
|
119
122
|
'renewal_term',
|
|
120
123
|
'currency',
|
|
121
|
-
'accounting_dimensions',
|
|
122
124
|
'mrc',
|
|
123
125
|
'yrc',
|
|
124
126
|
'nrc',
|
|
@@ -173,7 +175,6 @@ class InvoiceListTable(NetBoxTable):
|
|
|
173
175
|
'period_start',
|
|
174
176
|
'period_end',
|
|
175
177
|
'currency',
|
|
176
|
-
'accounting_dimensions',
|
|
177
178
|
'amount',
|
|
178
179
|
'documents',
|
|
179
180
|
'comments',
|
|
@@ -225,6 +226,9 @@ class InvoiceLineListTable(NetBoxTable):
|
|
|
225
226
|
|
|
226
227
|
|
|
227
228
|
class AccountingDimensionListTable(NetBoxTable):
|
|
229
|
+
status = columns.ChoiceFieldColumn(
|
|
230
|
+
verbose_name=('Status'),
|
|
231
|
+
)
|
|
228
232
|
class Meta(NetBoxTable.Meta):
|
|
229
233
|
model = AccountingDimension
|
|
230
234
|
fields = (
|
|
@@ -232,9 +236,11 @@ class AccountingDimensionListTable(NetBoxTable):
|
|
|
232
236
|
'name',
|
|
233
237
|
'value',
|
|
234
238
|
'comments',
|
|
239
|
+
'status',
|
|
235
240
|
)
|
|
236
241
|
default_columns = (
|
|
237
242
|
'name',
|
|
238
243
|
'value',
|
|
239
244
|
'comments',
|
|
245
|
+
'status',
|
|
240
246
|
)
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</tr>
|
|
29
29
|
<tr>
|
|
30
30
|
<th scope="row">{% trans "Status" %}</th>
|
|
31
|
-
<td>{
|
|
31
|
+
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
|
32
32
|
</tr>
|
|
33
33
|
<tr>
|
|
34
34
|
<th scope="row">{% trans "External reference" %}</th>
|
|
@@ -78,12 +78,6 @@
|
|
|
78
78
|
<th scope="row">{% trans "Currency" %}</th>
|
|
79
79
|
<td>{{ object.currency }}</td>
|
|
80
80
|
</tr>
|
|
81
|
-
{% if not 'accounting_dimensions' in hidden_fields %}
|
|
82
|
-
<tr>
|
|
83
|
-
<th scope="row">{% trans "Accounting dimensions" %}</th>
|
|
84
|
-
<td>{{ object.accounting_dimensions }}</td>
|
|
85
|
-
</tr>
|
|
86
|
-
{% endif %}
|
|
87
81
|
<tr>
|
|
88
82
|
<th scope="row">{% trans "Monthly recuring costs" %}</th>
|
|
89
83
|
<td>{{ object.mrc }}</td>
|
|
@@ -42,12 +42,6 @@
|
|
|
42
42
|
<th scope="row">{% trans "Currency" %}</th>
|
|
43
43
|
<td>{{ object.currency }}</td>
|
|
44
44
|
</tr>
|
|
45
|
-
{% if not 'accounting_dimensions' in hidden_fields %}
|
|
46
|
-
<tr>
|
|
47
|
-
<th scope="row">{% trans "Accounting dimensions" %}</th>
|
|
48
|
-
<td>{{ object.accounting_dimensions }}</td>
|
|
49
|
-
</tr>
|
|
50
|
-
{% endif %}
|
|
51
45
|
<tr>
|
|
52
46
|
<th scope="row">{% trans "Amount" %}</th>
|
|
53
47
|
<td>{{ object.amount }}</td>
|
|
@@ -323,8 +323,6 @@ class InvoiceEditView(generic.ObjectEditView):
|
|
|
323
323
|
initial_data['amount'] = contract.mrc * contract.invoice_frequency
|
|
324
324
|
|
|
325
325
|
initial_data['currency'] = contract.currency
|
|
326
|
-
if contract.accounting_dimensions:
|
|
327
|
-
initial_data['accounting_dimensions'] = contract.accounting_dimensions
|
|
328
326
|
|
|
329
327
|
form = self.form(instance=obj, initial=initial_data)
|
|
330
328
|
restrict_form_fields(form, request.user)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: netbox-contract
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Contract management plugin for Netbox
|
|
5
5
|
Author-email: Marc Lebreuil <marc@famillelebreuil.net>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mlebreuil/netbox-contract
|
|
@@ -97,8 +97,8 @@ FIELD_CHOICES = {
|
|
|
97
97
|
('pln', 'PLN'),
|
|
98
98
|
),
|
|
99
99
|
'netbox_contract.Contract.status': (
|
|
100
|
-
('
|
|
101
|
-
('
|
|
100
|
+
('active', 'Active', 'green'),
|
|
101
|
+
('canceled', 'Canceled', 'red'),
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -61,6 +61,8 @@ src/netbox_contract/migrations/0034_contract_yrc_alter_contract_mrc.py
|
|
|
61
61
|
src/netbox_contract/migrations/0035_accountingdimension_status_and_more.py
|
|
62
62
|
src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py
|
|
63
63
|
src/netbox_contract/migrations/0037_contract_notice_period_alter_contract_currency_and_more.py
|
|
64
|
+
src/netbox_contract/migrations/0038_alter_accountingdimension_options_and_more.py
|
|
65
|
+
src/netbox_contract/migrations/0039_alter_accountingdimension_status_and_more.py
|
|
64
66
|
src/netbox_contract/migrations/__init__.py
|
|
65
67
|
src/netbox_contract/templates/contract_assignments_bottom.html
|
|
66
68
|
src/netbox_contract/templates/contract_list_bottom.html
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0007_invoice_date.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract/migrations/0027_invoiceline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.10 → netbox_contract-2.3.0}/src/netbox_contract.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|