Skip to main content

Contract management plugin for Netbox

Project description

Contract pluggin

Overview

The pluggin adds contracts and invoices model to Netbox.
It allows to register contract with objects.
Add invoices to contracts.

Check the documentation for additional information

Installation

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. Over in the NetBox installation path, open netbox/netbox/configuration.py and look for the PLUGINS parameter; this 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 configurationitems can be set:

# configuration.py
PLUGINS_CONFIG = {
    'netbox_contract': {
        'top_level_menu': True,
        'default_accounting_dimensions':{
            "account": "", 
            "project": "", 
            "cost center": ""
        },
        '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.
  • 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.

# configuration.py
FIELD_CHOICES = {
    'netbox_contract.Contract.internal_partie': (
        ('Nagravision SARL', 'Nagravision SARL', 'green'),
        ('Nagra USA', 'Nagra USA', 'green'),
        ('Nagra India', 'Nagra India', 'green'),
    ),
    'netbox_contract.Contract.currency': (
        ('usd', 'USD'),
        ('eur', 'EUR'),
        ('chf', 'CHF'),
        ('pln', 'PLN'),
    ),
    'netbox_contract.Contract.status': (
        ('Active', 'Active', 'green'),
        ('Cancled', 'Canceled', 'red'),
    )
}

Run database migrations

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

Project details


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.2.6.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

netbox_contract-2.2.6-py3-none-any.whl (48.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netbox_contract-2.2.6.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for netbox_contract-2.2.6.tar.gz
Algorithm Hash digest
SHA256 7b5325264dd6839bbc0f28932d39cbfa5bfb8bbb1d6476906350298c1d27c094
MD5 fa5e4738c50f30e85689bebb2c1867b4
BLAKE2b-256 2a71748ca3dd6d7b510f2d1bf6ebaa3e2a5c933dccd0cf73001d4d8c310a6d76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for netbox_contract-2.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cf514d02851769562da37e6d66760d0879d442aa00c397bdda3659fff0de2f4f
MD5 1385b111ce99ae750f4737e66bcdda72
BLAKE2b-256 6c91d0f13f57951e413d1e268aaeeacdc58675c42c363e71c8c2c1be0a42ef23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page