* Display note info
* Support user locale
* Add unit testing for HTML content
* Observe color mode
* Add link between Note and NotesImage
* Ensure image file is deleted when NotesImage is deleted
* Add support for image upload in editor
* Skeleton for data migration
* Updates
* Update data migration
- Find any NoteImage items which do not link to a model
- Try to associate them with an existing note
* Remove validator
* Updated API endpoints for NotesImage model
* Update server side sanitizing
* Specify max field length
* Remove old fields from NotesImage model
* Refactor clean_string
* Remove obsolete task
* Remove legacy "notes" field from older models
* Adjust search params when switching notes
* Remove NotesFieldMixin
* Change editor
* Resizable image support
* Support tables
* Add table style
* Adjust header actions
* Add data migration for SalesOrderShipment notes
* Adjust back-end sanitizing
* Adjust
* Use subtle editor variant
* Move undo/redo
* Enhance editing logic
* Add report tags for notes
* Add unit test for note image cleanup
* Render note to HTML
- Automatically replace images
* Fix migration order
* Adjust migration text
* Fix "dirty" trigger on notes
* Prevent navigate from dirty notes
* Add documentation
* Prevent image clicking if not in editing mode
* Update API
* Update migration files
* Fix migrations
* remove notes from test fixtures
* remove notes field that does not exsist anymore
* add missing ruleset
* fix assertation
* fix assertation
* Update docs/docs/concepts/notes.md
Co-authored-by: Matthias Mair <code@mjmair.com>
* Remove blocknote deps
* Move old helper functions
- Only used for this migration
- Will potentially be removed at some point in the future?
* Revert change
* Fix note image URL
* Fix migration conflicts
* Fix migrations
* Fix delete call
* Fix content mixin
* Fix note duplication
* Make save method atomic
* Fix double-save
* Add "template" field to Note model
* Adjust migrations
* Frontend updates
* Fix for NotesEditor
* Render Note instance in forms
* Fix button-within-button
* Fix migrations
* Fix missing import
* add docs
* docs for rendering notes in reports
* Restrict queryset based on user view permissions
* APi unit tests for note permissions
* Duplicate embedded images when copying notes
* Add unit test for note duplication
* Add CHANGELOG
* Add 'copy_note' option to duplicate serializer
* Add unit tests for data migrations
* implement note duplication serializers
* frontend UI elements
* Fix migration conflicts
* Use branch for playwrigh testing
* Implement duplicate action for stock item
* Fix import
* Updated playwright tests
* Bug fix for receiving stock items
* Add screenshot
* Fix api_version
* Update unit tests
* Fix docs
* Remove defunct tests
* Fix migration order
* Adjust import/export workflow
* Manual cleaning update
* Fix migrations
* Fix migration files
* Fix for note save
* Adjust save ordering
* Skip constraint checking in NoteSerializer
* Custom validate_constraints on Note model
* Revert "Skip constraint checking in NoteSerializer"
This reverts commit b42bc955c1.
* Fix for note search
* Fix for receive_line_items
* Shim model renderer for NoteTemplate
* Fix playwright tests
* Adjust frontend CI
* Fix import/export CI job
* Fix for data migration test
* Fix migration test
* Adjust unit test
* Fix conflicting migration
* Fix unit test
* Run migration tests in parallel
* Robustify migration test
* Disable parallel options
* Fix conflicting migration
* Remove extraneous unit test
* Fix conflicting migrations
* Additional regression tests
* Check permissions before deleting Note instance
* Updated docs
* Validate note model type
* Prevent discard of unsaved changes in note editor
* Clean up dead code
* Fix migration conflict
* Improved data migration
* Prefetch role groups
* UI refactoring
* Refactor permission checking code
* Further code refactoring
* use DuplicateField helper
* Refactoring
* Add prefetch
* Throw exception rather than assert
* Logic fix for notes editor
* reimplement old background task
* Adjust data migration
* Fix notes field when receiving items
* Fix existing report templates
* Fix save action for notes editor
* Refactoring: Add "instance-info" API endpoint for common model properties
* Fix indicator dots
* Tweak nav alert msg
* Adjust layout of buttons
* Sanitize notes during migration
* Fix for NotesImage delete cascade
* Fix caching
* Fix race condition in notes editor
* Fix distinct issue when searching notse
* Fix race condition when saving new note instance
* Fix improper error
* Refactor StockItem duplication
* Refactoring
* Increase query time
* Fix api_version.py
* Additional migration tests
* Fix CI workflow
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
6.6 KiB
title
| title |
|---|
| Notes |
Notes
Notes allow free-form rich-text content to be written and stored against a specific object within InvenTree. Notes can be used to record observations, instructions, historical context, or any other information associated with a model instance.
!!! note "Business Logic" Notes are not to be used for any core business logic within InvenTree. They are intended to provide supplementary documentation and context for objects, which can be useful for reference, communication, or reporting purposes. Plugins should not use them for storage and opt for object metadata or custom models instead.
Notes can be associated with various InvenTree models, and each model can have multiple notes associated with it. The user interface provides a dedicated "Notes" tab on the detail page of any model that supports notes, allowing users to easily view and manage notes for that object.
Notes Tab
Any model which supports notes will have a "Notes" tab on its detail page. This tab displays the content of the currently selected note, along with a sidebar listing all notes for that object by title:
{{ image("concepts/notes-tab.png", "Notes Tab Example") }}
Note Fields
Each note has the following attributes:
| Field | Description |
|---|---|
| Title | A short title for the note (required) |
| Description | An optional brief description of the note's purpose |
| Content | The rich-text body of the note |
| Primary | Marks this note as the default note for the object |
Primary Note
When a model has multiple notes, one may be designated as the primary note. The primary note is indicated by a {{ icon("star") }} icon in the note sidebar.
- When the first note is created for a model instance, it is automatically set as the primary note.
- Only one note per model instance can be marked as primary at any time.
- The primary note is opened by default when navigating to the Notes tab.
Rich Text Editing
Note content is edited using a rich-text (WYSIWYG) editor. The following formatting options are available:
- Text formatting: Bold, italic, underline, strikethrough, inline code, code blocks
- Headings: H1 through H4
- Structure: Blockquotes, horizontal rules
- Lists: Bullet lists and ordered lists
- Links: Insert and remove hyperlinks
- Tables: Insert tables; add/remove rows and columns; toggle header rows
- Images: Embed images uploaded directly into the note
Inserting Images
Images can be embedded in note content in the following ways:
- Click the {{ icon("photo") }} button in the editor toolbar to select a file from your device
- Paste an image directly from the clipboard
- Drag and drop an image file into the editor
Uploaded images are stored on the server and linked to the note. If a note is edited or deleted, any images that are no longer referenced by any note are automatically removed.
Adding a Note
To add a note to an object:
- Navigate to the object's detail page
- Click on the Notes tab
- Click the Add Note button
- Fill in the
Title(required) and optionalDescriptionfields - Click Submit
The new note will appear in the sidebar ready for editing.
Editing Note Content
Note content is shown in read-only mode by default. To make changes:
- Click the {{ icon("pencil") }} icon in the note header to enter edit mode
- Use the toolbar to format content, insert images, or add tables
- Click the {{ icon("device-floppy") }} icon, or press Ctrl+S / Cmd+S, to save changes
- Click the {{ icon("check") }} icon to exit edit mode once all changes are saved
!!! warning "Unsaved Changes" If you navigate away from the Notes panel or leave the page while in edit mode with unsaved changes, InvenTree will prompt you to confirm before proceeding.
Resetting Changes
While in edit mode, clicking the {{ icon("reload") }} icon discards any unsaved changes and reloads the last saved version of the note.
Editing Note Properties
To change a note's title or description, open the actions menu in the note header and select Edit Note.
Deleting a Note
To delete a note, open the actions menu in the note header and select Delete Note.
!!! danger "Permanent Action" Deleting a note is permanent and cannot be undone. Any images embedded in the note that are not referenced elsewhere will also be removed.
Note Templates
Note templates are pre-defined notes that can be used as a starting point when adding a new note to any model instance. They allow administrators to standardize common note structures and reduce repetitive data entry.
Creating Notes from Templates
When adding a new note to an object, an optional From Template field is available. Selecting a template pre-fills the Title, Description, and Content fields with the template's content. These fields can then be edited before saving.
To create a note from a template:
- Navigate to the object's detail page and open the Notes tab
- Click the Add Note button
- In the From Template field, select an existing template from the dropdown
- The Title, Description, and Content fields are automatically populated from the template
- Edit any fields as needed
- Click Submit to save the note
!!! info "Template Filters" The template dropdown only shows templates that are applicable to the current model type, plus any templates that are not restricted to a specific model type.
Managing Note Templates
Note templates are managed by staff users via the Admin Center.
To access note templates:
- Navigate to Settings > Admin Center
- Select the Note Templates panel
This panel provides the same rich-text editor interface used for regular notes. Templates created here are available to all users when adding notes across the system.
Creating a Template
- In the Note Templates panel, click Add Note Template
- Enter a Title (required) and optional Description
- Optionally select a Model Type to restrict the template to a specific kind of object (e.g. Part, Build Order). Leave blank to make the template available for all model types
- Click Submit, then edit the template content in the editor
Editing a Template
Select a template from the sidebar, then use the same edit workflow as for regular notes: click the {{ icon("pencil") }} icon, make changes, and save with {{ icon("device-floppy") }} or Ctrl+S / Cmd+S.
Deleting a Template
Open the actions menu in the template header and select Delete Note Template.
!!! note Deleting a template does not affect any notes that were previously created from it.