Contract management plugin for Netbox
Project description
Contract plugin
NetBox plugin to manage contracts.
- Free software: MIT
- Documentation: https://mlebreuil.github.io/netbox-contract/
Features
The plugin adds contracts and invoices model to NetBox.
It allows to link contract with objects.
And link invoice templates and invoices with contracts.
Invoice lines can be linked to each invoice / invoice template.
Accounting dimensions can be linked with invoice lines.
Compatibility
NetBox Version | Plugin Version |
---|---|
4.1 | 2.2 |
4.2 | 2.3 |
4.3 | 2.4 |
Installing
Activate venv
To ensure our plugin is accessible to the NetBox installation, we first need to activate the Python virtual environment that was created when we installed NetBox. To do this, determine the virtual environment's path (this will be /opt/netbox/venv/
if you use the documentation's defaults) and activate it:
$ source /opt/netbox/venv/bin/activate
Install the package
$ python3 -m pip install netbox-contract
Configure NetBox
Finally, we need to configure NetBox to enable our new plugin. In the NetBox installation directory, open netbox/netbox/configuration.py
and locate the PLUGINS
parameter; it should be an empty list. (If it's not yet defined, go ahead and create it.) Add the name of our plugin to this list:
# configuration.py
PLUGINS = [
'netbox_contract',
]
Customize the plugin
The following configuration items can be set:
# configuration.py
PLUGINS_CONFIG = {
'netbox_contract': {
'top_level_menu': True,
'mandatory_contract_fields': [],
'hidden_contract_fields': [],
'mandatory_invoice_fields': [],
'hidden_invoice_fields': [],
'mandatory_dimensions': [],
}
}
- top_level_menu : If "Contracts" appears under the "Plugins" menu item or on its own
- default_accounting_dimensions: The accounting dimensions which will appear in the field' background when empty. Note that accounting dimensions are now managed as individual objects. The use of this field is deprecated.
- mandatory_contract_fields, mandatory_invoice_fields: Fields which are not required by default and can be set as such. The list of fields is at the bottom of the contract import form.
- hidden_contract_fields, hidden_invoice_fields: List of fields to be hidden. Fields should not be required to be hidden.
Customize the plugin fields choices
Internal partie reference the legal entity of your organization that is a partie to the contract.
The first currency will also be the default currency for contracts.
# configuration.py
FIELD_CHOICES = {
'netbox_contract.Contract.internal_partie': (
('default', 'Default entity', 'green'),
('entity1', 'Entity 1', 'green'),
('entity2', 'Entity 2', 'yellow'),
),
'netbox_contract.Contract.currency': (
('usd', 'USD'), # 1st position is the default currency
('eur', 'EUR'),
('chf', 'CHF'),
('pln', 'PLN'),
),
'netbox_contract.Contract.status': (
('active', 'Active', 'green'),
('canceled', 'Canceled', 'red'),
)
}
Run database migrations
(venv) $ cd /opt/netbox/netbox/
(venv) $ python3 manage.py migrate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file netbox_contract-2.4.0.tar.gz
.
File metadata
- Download URL: netbox_contract-2.4.0.tar.gz
- Upload date:
- Size: 286.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
35c340226f71149a298b9f62793b429e3362426fadb4a1d806ca85bfb67d7cbb
|
|
MD5 |
424cc1ccf846de7185d8cde283548a1b
|
|
BLAKE2b-256 |
123de934f68accbd53a3a28db429b489a8c2b4180738f9debc91d30b05523e98
|
Provenance
The following attestation bundles were made for netbox_contract-2.4.0.tar.gz
:
Publisher:
python-publish.yml
on mlebreuil/netbox-contract
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
netbox_contract-2.4.0.tar.gz
-
Subject digest:
35c340226f71149a298b9f62793b429e3362426fadb4a1d806ca85bfb67d7cbb
- Sigstore transparency entry: 206474494
- Sigstore integration time:
-
Permalink:
mlebreuil/netbox-contract@30f3c0902a023f8d6c51764c210b58383992a6fb
-
Branch / Tag:
refs/tags/v2.4.0
- Owner: https://github.com/mlebreuil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@30f3c0902a023f8d6c51764c210b58383992a6fb
-
Trigger Event:
release
-
Statement type:
File details
Details for the file netbox_contract-2.4.0-py3-none-any.whl
.
File metadata
- Download URL: netbox_contract-2.4.0-py3-none-any.whl
- Upload date:
- Size: 63.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b87a76d0c620357e3a6876b1b0945e90b8d4a1c3f44d87d69d4eab6c5adb9277
|
|
MD5 |
8af8635a493d86ac6b77d936bc06cad1
|
|
BLAKE2b-256 |
0dd7d86cbb571c5b470f1e89738d19e1649b787bf01cc2d60beb55028d476889
|
Provenance
The following attestation bundles were made for netbox_contract-2.4.0-py3-none-any.whl
:
Publisher:
python-publish.yml
on mlebreuil/netbox-contract
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
netbox_contract-2.4.0-py3-none-any.whl
-
Subject digest:
b87a76d0c620357e3a6876b1b0945e90b8d4a1c3f44d87d69d4eab6c5adb9277
- Sigstore transparency entry: 206474495
- Sigstore integration time:
-
Permalink:
mlebreuil/netbox-contract@30f3c0902a023f8d6c51764c210b58383992a6fb
-
Branch / Tag:
refs/tags/v2.4.0
- Owner: https://github.com/mlebreuil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@30f3c0902a023f8d6c51764c210b58383992a6fb
-
Trigger Event:
release
-
Statement type: