Skip to main content

Contract plugin

NetBox plugin to manage contracts.

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
4.4 2.4
4.5 2.4
4.6 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': [],
        'supported_models': [
            'circuits.circuit',
            'circuits.virtualcircuit',
            'dcim.site',
            'dcim.device',
            'dcim.rack',
            'virtualization.virtualmachine',
            'virtualization.cluster',
            'ipam.ipaddress',
            'ipam.prefix',
        ],
        'contract_assignments_display': 'both',  # options: 'tab', 'inline', 'both'
    }
}
  • top_level_menu : If "Contracts" appears under the "Plugins" menu item or on its own
  • contract_assignments_display:
    • 'tab' - only the Contracts view tab is visible on the related object page.
    • 'inline' - only the inline contract assignments table is shown in object detail; the Contracts tab is hidden.
    • 'both' - both tab and inline table are shown (default behavior).
  • 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 party reference the legal entity of your organization that is a party to the contract.
The first currency will also be the default currency for contracts.

# configuration.py
FIELD_CHOICES = {
    'netbox_contract.Contract.internal_party': (
        ('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'),
    )
    'netbox_contract.Invoice.status': (
        ('draft', 'Draft', 'yellow'),
        ('posted', 'Posted', 'green'),
        ('canceled', 'Canceled', 'red'),
    )
}

Run database migrations

(venv) $ cd /opt/netbox/netbox/
(venv) $ python3 manage.py migrate

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_contract-2.4.7.tar.gz (290.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_contract-2.4.7-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file netbox_contract-2.4.7.tar.gz.

File metadata

  • Download URL: netbox_contract-2.4.7.tar.gz
  • Upload date:
  • Size: 290.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for netbox_contract-2.4.7.tar.gz
Algorithm Hash digest
SHA256 a58d8c26886368eed8c76d174695704269a533b78a2f81c69f41888a244b4fc8
MD5 3412c17395abe9febd3b500b9ded03da
BLAKE2b-256 b621a6485fef7a75781d0fcdfcd6cf41e40c85894899eba0c8db703e3e3f8a20

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_contract-2.4.7.tar.gz:

Publisher: python-publish.yml on mlebreuil/netbox-contract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbox_contract-2.4.7-py3-none-any.whl.

File metadata

  • Download URL: netbox_contract-2.4.7-py3-none-any.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for netbox_contract-2.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bbbc0324dca2554f9293c393c4592992345ccec4c7cd1baa3a4c111405e4d4b5
MD5 074af9a3743ad3f0e9d87b73c1ddee2d
BLAKE2b-256 11fad3825fd74b0f4736a97c228dd58c79ae4353e7ccddb47086d9da09a791b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_contract-2.4.7-py3-none-any.whl:

Publisher: python-publish.yml on mlebreuil/netbox-contract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.4.7 This release

2 files

2.4.6

2 files

2.4.5

2 files

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.11

2 files

2.2.10

2 files

2.2.8

2 files

2.2.7

2 files

2.2.6

2 files

2.2.5

2 files

2.2.4

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.2

2 files

2.1.0

2 files

2.0.14

2 files

2.0.13

2 files

2.0.11

2 files

2.0.10

2 files

2.0.9

2 files

2.0.8

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page