Commit Graph

167 Commits

Author SHA1 Message Date
Michael
17ae1a780d
Added dropdown menu to the example panel (#5898)
* Fix errors in variable names of examples

* Added drop down example

* Added drop down example

* Fixed picture name

* Fixed context variable in purchase order report
2023-11-13 22:17:52 +11:00
42CrMo4
a1ce2f53e1
correct Part uploadImage Parameter spelling (#5902) 2023-11-12 23:12:56 +11:00
Joshua Miller
078538add2
Minor documentation updates (#5900)
* Fixed typo

* Minor description adjustment
2023-11-12 22:55:12 +11:00
Oliver
e6db817c8f
Model render refactor (#5894)
* Embiggen search drawer

* Refactor search drawer queries:

- Use proper permission checks

* Actually check user settings

* Move StatusRenderer

* Update renderers

- Improve in-line render for different order types

* Update stockitem renderere

* Remove old renderer functions

* Better data handling in UserState

* Tweaks for settings pages

* "Fix" scanning page

- Rendering is a bit broken currently, as the barcode scan does not send back the model data

* "Fix" scanning page

- Rendering is a bit broken currently, as the barcode scan does not send back the model data
- Required refactoring enumerations out into separate files
- Some strange race condition / import loop was happening

* Fix incorrect imports

* Fixing hover card

- Use unique key

* fixes

* Fix urls.md

* More udpates

* Fix unused import
2023-11-10 15:44:02 +11:00
Joshua Miller
9e2da947a9
Updated URL documentation with more information about panels (#5896)
* Fixed error "Line 39 in Markdown file: Encountered unknown tag 'load'."

I did not include the statements {% raw %} and {% endraw %} to escape the code. I have been able to set up a dev server and can confirm this new md file works. My apologies!

* Added more documentation about Panels, and their role in `page_base.html`

* Added more sidebar documentation, and documentation about panels

* Fixed `Line 73 in Markdown file: Encountered unknown tag 'trans'.` error.

Also, made minor clarity improvements

* Reworded some sentences for clarity improvements.

Additionally, added more information about `onPanelLoad`

* Minor syntax updates
2023-11-10 13:55:10 +11:00
Oliver
a0b1ba62a9
Label sheet printer (#5883)
* Add skeleton for new label sheet plugin

* Add custom printing options serializer

* Render individual label outputs to HTML

* Extract page size and column size

* Check label dimensions before printing

* Split labels into multiple pages / sheets

* Render out multiple labels onto a single sheet

* Cleanup base label template

- Allow @page style to *not* be generated
- Pass through as optional context variable
- Check that it still works for single label printing (default behaviour unchanged)
- Prevents multiple @page styles from being generated on label sheet output

* Fix stylesheets for part labels

* Cleanup stock location labels

* Cleanup more label templates

* Check if label can actually fit on page

* Generate output to PDF and return correct response

* Update panel.md

* Fix unit tests

* More unit test fixes
2023-11-09 09:00:23 +11:00
Michael
e674ca7437
Added a chapter for more complicated data (#5878) 2023-11-08 21:11:57 +11:00
Oliver
4f8bca4ea4
PO auto fill fix (#5871)
* Take "on_order" quantity into account when ordering items

* Clean up panel.md

* update urls.d
2023-11-06 21:14:23 +11:00
Joshua Miller
a2b464e874
Fixed error "Line 39 in Markdown file: Encountered unknown tag 'load'." (#5867)
I did not include the statements {% raw %} and {% endraw %} to escape the code. I have been able to set up a dev server and can confirm this new md file works. My apologies!
2023-11-06 14:23:40 +11:00
Michael
77f39230c1
Added example with user data input to the panel mixin doc (#5848)
* Added example with user data input to the panel mixin doc

* Typo

* Added changes proposed by Lukas
2023-11-06 09:30:00 +11:00
Michael
7b9c618658
Addec context variables for contacts to docs (#5834)
* Corrected report mixin example

* Remove unused file

* Added context variables for company and address

* Repair link in file

* Repair link in file

* Repair link in file

* Removed blank

* Added context variables for contacts to docs

* Typo in link

* Update .pre-commit-config.yaml

Revert version

* Delete InvenTree/order/migrations/0099_auto_20231101_1747.py

* Delete InvenTree/part/migrations/0119_auto_20231101_1747.py

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2023-11-02 17:40:40 +11:00
Lukas
a11418398f
Printing options (#5786)
* Added backend changes to support printing options

* Pass printing options seperatly via kwargs for easier api refactor later

* Implemented printing options in CUI

* Fix js linting

* Use translations for printing dialog

* Added docs

* Remove plugin and template fields from send printing options

* Fix docs

* Added tests

* Fix tests

* Fix options response and added test for it

* Fix tests

* Bump api version

* Update docs

* Apply suggestions from code review

* Fix api change date
2023-11-02 00:39:19 +11:00
Michael
4cd4a84bac
Added context variables for address (#5807)
* Corrected report mixin example

* Remove unused file

* Added context variables for company and address

* Repair link in file

* Repair link in file

* Repair link in file

* Removed blank
2023-10-29 22:07:21 +11:00
Joshua Miller
3c5e2a3541
Added Views, blocks, and templates documentation (#5805) 2023-10-29 12:11:10 +11:00
Michael
70578500ca
Corrected example in report mixin (#5801)
* Corrected report mixin example

* Remove unused file
2023-10-27 23:08:30 +11:00
Oliver
e13b57669c
Barcode app docs (#5788)
* Update settings page

* Update barcode action documentation

* Update app privacy information
2023-10-25 23:46:26 +11:00
Oliver
b335728e29
Fix admin site - Custom admin URL (#5766)
* Update config template file

* Add entry to docs

* Add INVENTREE_ADMIN_ENABLED to settings.py

* Add helper functions for improving admin links

* Refactor existing admin links

* remove debug statements

* Fix custom admin URL

* Expand documentation

* Fix URL

* Improve wording in config_template.yaml

* Extend admin_url tag

- Allow lookup without pk
- Handle case where pk not found
2023-10-21 22:12:14 +11:00
Bobbe
ae063d2722
Add basic support for scanning vendor barcodes (#5509)
* Add support for scanning digikey and mouser barcodes

* added small fixes if no part is found

* made small style cleanups

* Separate out ecia 2d barcode parser, Add quantity, PO number to response

* Use model instead of name for mouser supplier, add auto detection magic

* Add lcsc barcode support

* Move barcode plugins to new suppliers subdirectory

* Add get_supplier_part helper, Refactor plugins in preparation for #3791

* Add __init__.py to suppliers directory

* Improve formatting

* Add barcode integration tests

* Add api-barcode-po-receive endpoint

* Refactor supplier_barcode.py helpers into BarcodeMixin

* Implement the api-barcode-po-receive endpoint for all suppliers

* Always include lineitem in api response

* Fix location in response, only include quantity and location if set

* Check if barcode has already been assigned, Fix tests

* FIx quantity and location not being in lineitem reponse

* Use part.get_default_location() instead of part.default_location

* Fix fomatting again

* Fix type annotations for python 3.8

* Add get_supplier_part helper, check for barcode_data being a str

* Fix naming clash

* Clarify return type for scan_receive_item

* Improve model access using first() in two places

* Refactor a bunch of checks

* Improve selection of line item, if multiple line items match the SKU

* Add new api version for this PR

* Fix error if no line item exists

* Add debug print to investigate why tests are failing

* Remove the test print again

* Fix pre formatted log messages

* Test removing all plugins

* Test only with digikey plugin

* Test with all plugins, but without mouser "model" setting

* Test again without tests

* Test with simple tests

* Test with simple receive test

* Test with even more receive tests

* Test second receive test

* Test third receive test

* Test 4th receive test with debug prints

* Try deleting the stock item and stock locations

* Disable the test again

* Add SupplierBarcodeMixin to minimize shared code between plugins

* Add TME supplier barcode plugin

* Remove the TME tests again

* If this works the tests are broken, if this doesn't work the tests are broken too

* Add TME tests again

* Add back all tests again

* Fix TME purchase order number

* Fix TME qrcode regex

* Add documentation for this feature

* Fix TME qrcode regex

* Use Decimal instead of int for quantity

* Refactor get_supplier_parts, Add get_supplier method

* Improve docstrings

* Fix None type access

* FIx TME barcode detection, Improve supplier barcode handling

* Try to retrigger pipeline

* Refactor get_supplier_parts to not use lists

* Add DEFAULT_SUPPLIER_NAME to mouser plugin

* Add SUPPLIER_ID setting to other suppliers

* Fix supplier plugins not inheriting from settings mixin

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-10-19 23:28:21 +11:00
Matthias Mair
faac6b6bf5
refactor: remove blank lines after docstring (#5736)
There shouldn't be any blank lines after the function docstring.
Remove the blank lines to fix this issue.

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2023-10-18 07:28:57 +11:00
Matthias Mair
158a209a0f
Version bump (#5740)
* Updated all dependencies

* fixed some spelling errors

* More spelling corrections

* Fixes for changes in react-query
2023-10-18 07:27:28 +11:00
Oliver
997b2ad569
Remove --no-frontend option (#5568)
- Until the new frontend is fully ready to be shipped, adding this option only serves to confuse users (and break the install process potentially)
- Remove this option entirely from the invoke script
- Update documentation accordingly
2023-10-18 00:21:26 +11:00
Oliver
c74368f805
Fix typo (#5715)
* Fix typo

getSpashScren -> getSplashScreen

* Cleanup docs
2023-10-17 12:12:22 +11:00
Michael
f409cd6894
Added example for barcode plugin (#5670)
* Added example for barcode plugin

* Add some words in stock location reports

* Correct error in link

* Correct error in link

* Typo in link

* Style in code example
2023-10-17 10:24:05 +11:00
Oliver
01f30222eb
Update docker production guide (#5701)
- Fixes https://github.com/inventree/InvenTree/issues/5655
2023-10-16 12:43:10 +11:00
Oliver
6f2dca729d
Report orientation (#5678)
* Add helper functions for report generation

* Add new fields to Report model:

- page_size (default = A4)
- landscape (default = False)

* Add migration for InvenTree reports

* Enable landscape printing
2023-10-09 13:25:53 +11:00
Oliver
c7eb90347a
Exchange rate plugin (#5667)
* Add plugin mixin class for supporting exchange rates

* Split some mixin classes out into their own files

- mixins.py is becoming quite bloated!

* Add some new settings for controlling currency updates

* Adds basic plugin implementation

* Refactor existing implementation

- Builtin plugin uses frankfurter.app API
- Better error / edge case handlign

* Add sample plugin for currency exchange

* Allow user to select which plugin to use for plugin updates

* Observe user-configured setting for how often exchange rates are updated

* Updates for some of the sample plugins

* Fix plugin slug

* Add doc page

* Document simple example

* Improve sample

* Add blank page for currency settings info

* More info in "config" page

* Update docs again

* Updated unit tests

* Fill out default settings values when InvenTree runs

* Add log messages

* Significant improvement in default settings speed

- Use bulk create
- Be efficient
- Dont' be inefficient

* More strict checks

* Refactor default values implementation

- Don't run at startup
- Run on list API
- Implement generic @classmethod
2023-10-05 21:19:28 +11:00
Lukas
8ec04028d5
Native LDAP support (#5226)
* Added basic ldap support

* Added new settings to config template

* Added missing apk dependency to dockerfile

* update requirements.txt

* Remove requirements and added docs

* Update advanced.md

* Added more ldap options

* allow direct bind
* add ldap debug mode
* add ldap global_options
* add start_tls
* use get_boolean_setting

* Update advanced.md to use a warning box

* fix: style

* Update advanced.md

* Remove ldap install instructions for non docker installs
2023-10-05 07:52:36 +11:00
Oliver Lippert
46b0d77418
Let plugins decide if events should be processed or not (#5618)
* add wants_process_event to EventMixin

in register_event this function get called and the task is just offload if the plugin returns true

* add tests for wants_process_event

* fix comments for register_event after code changes

* add documentation for EventMixin.wants_process_event

* avoid pre-formatting log messages

---------

Co-authored-by: Oliver Lippert <oliver@lipperts-web.de>
2023-10-01 21:10:26 +11:00
Oliver Lippert
7fa0c6d280
Add worker task to VS Code (#5605)
* add worker task to vscode

* add documentation for devcontainer backgorund workers

* fix misphrased sentence ("want need" -> "need")

---------

Co-authored-by: Oliver Lippert <oliver@lipperts-web.de>
2023-10-01 21:06:34 +11:00
Oliver
dad240529d
Adds optional config setting to enable database level logging (#5617) 2023-09-25 16:54:17 +10:00
Oliver
202dd6b4a1
Update context_variables.md (#5581)
Fix typo made when fixing a typo
2023-09-21 09:45:25 +10:00
Oliver
459d38cfc2
Update context_variables.md (#5580)
Fix typo "path_string" -> "pathstring"
2023-09-21 09:39:37 +10:00
saharshtapi
c741bfe39d
Typo Fixed (#5501) 2023-09-04 23:44:45 +10:00
Matthias Mair
7d5ff1d5bd
fixed allauth docs links (#5486) 2023-08-28 09:31:04 +10:00
Oliver
a5f6a05c1f
Fix docker instructions (#5479) 2023-08-25 23:15:08 +10:00
Peter Kopias
58e06ba1cb
Add comments and warnings to documentation so readers would follow the correct version (#5431)
* add warning to use stable docs for stable docker_prod.md

* add notification and documentation column to different versions in docker.md
2023-08-15 09:54:19 +10:00
Peter Kopias
6707f18f73
Update migrate.md to handle exporting json via docker volume (#5428) 2023-08-11 13:04:09 +10:00
Matthias Mair
131442b6c7
fixes small style error in panel.md (#5404) 2023-08-07 09:50:20 +10:00
Michael
e1abe5be40
Added docs on the panel plugin example (#5402)
* added docu and image for panel plugin example

* format
2023-08-06 21:49:29 +10:00
Oliver
eeabc8d1f9
Pin mkdocs version to 1.4.3 (#5388)
- Updates to readthedocs policy mean that this needs to be pinned
- Moving to 1.5.0 breaks current documentation set
2023-08-02 22:52:01 +10:00
Oliver
bfedb9cf87
Email config fix (#5336)
* Change for DEFAULT_FROM_EMAIL

- Use USERNAME if not specified

(cherry picked from commit 487ac917c90e9fe3da4effaa9326b707ceecd321)

* Email configuration fails if DEFAULT_FROM_EMAIL not set

(cherry picked from commit 01e573c3a2702e7c21ed13b0cb44280c89d3dee1)

* Docs update
2023-07-25 11:41:17 +10:00
Matthias Mair
507205ca78
Add DIO identifier (#5312)
* Add info for installer, branch, publisher

* include version info

* fix permissions

* fix typo

* add more info

* use GH url

* fix node

* remove publisher

* remove more logging

* Add info to version view

* enable branch discovery when not set

* fix ref to github version

* add branch to about dialog

* use precise plattform information - if no env is set

* fix ref names

* load VERSION info

* rename plattform to target

* extend installer var

* add generic plattform info

* add docs for version info

* add more info

* add installer codes

* Add DIO code
2023-07-23 09:09:28 +10:00
Matthias Mair
2259de7f31
P UI: Added frontend publishing for bare-metal (git) (#5277)
* Add SPA views for react #2789

* split up frontend urls

* Add settings for frontend url loading

* add new UI scaffold

* remove tracking insert

* add platform app

* ensure static indexes work too

* add lingui

* add lingui config

* add mgmt tasks

* add base locales

* settings for frontend dev

* fix typo

* update deps

* add pre-commit

* add eslint

* add testing scaffold

* fix paths

* remove error - tests trip correctly

* merge workflow

* cleanup samples

* use name inline with other tests

* Add real worl frontend tests

* setup env

* tun migrations first

* optimize setup time

* setup demo dataset

* optimize run setup

* add test for class ui

* rename

* fix typo

* and another typo

* do install

* run migrations first

* fix name

* cleanup

* use other credentials

* use other credentials

* fix qc

* move envs to qc

* remove create_site

* reduce testing env

* fix test

* fix test call

* allaccess user

* add ui plattform check

* add better check

* remove unneeded env

* enable debug

* reduce wait time

* also build frontend on static

* add sort plugin

* fix order

* run pre-commit fixes

* add node min version

* Docker container (#129)

* Fix allocation check for completing build order (#5199)

- Allocation check only applies to untracked line items

* docker dev

Install required node packages to docker development image

* add import order settings

* cleanout built ui

* remove default arg from build

* remove eslint

* optimize svg

* add build step for plattform UI

* fix install command

* use alpine commands

* do not use cache when creating image

* Added release pipeline

* trigger: ci

* Fix ci

* Fix ci

* Fix ci

* fix: workflow

* fix: workflow

* fix: doubble zipping

* fix: doubble zipping

* fix: doubble zipping

* fix: doubble zipping

* fix: doubble zipping

* Added frontend-download helper to tasks.py

* revert unrelated change

* Add frontend step to update task

* add frontend stuff to version info

* small change to trigger ci

* keep terminal output clean

* return found versions

* fix suggested command

* revert small change

* move to multiline

* add flag to stop frontend compile

* make node building optional on static

* add node trans to transalte task

* ammend commands to use new flag

* remove unneeded flag

* add warning

* add yarn bypass

* docstrings

* check for docker env

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: wolflu05 <76838159+wolflu05@users.noreply.github.com>
2023-07-20 10:12:08 +10:00
Oliver
6d3978ea28
Add database model for defining custom units (#5268)
* Add database model for defining custom units

- Database model
- DRF serializer
- API endpoints

* Add validation hook

* Custom check for the 'definition' field

* Add settings page for custom units

- Table of units
- Create / edit / delete buttons

* Allow "unit" field to be empty

- Not actually required for custom unit definition

* Load custom unit definitions into global registry

* Docs: add core concepts page(s)

* Add some back links

* Update docs

* Add unit test for custom unit conversion

* More unit testing

* remove print statements

* Add missing table rule
2023-07-19 06:24:16 +10:00
Sébastien APP
5862c70b24
Update python.md (#5264)
Just a typo corrected in a script sample.
2023-07-18 09:04:58 +10:00
Oliver
e8d16298a4
Label plugin refactor (#5251)
* Add skeleton for builtin label printing plugin

* Force selection of plugin when printing labels

* Enhance LabelPrintingMixin class

- Add render_to_pdf method
- Add render_to_html method

* Enhance plugin mixin

- Add class attribute to select blocking or non-blocking printing
- Add render_to_png method
- Add default method for printing multiple labels
- Add method for offloding print job

* Simplify print_label background function

- All arguments now handled by specific plugin

* Simplify label printing API

- Simply pass data to the particular plugin
- Check result type
- Return result

* Updated sample plugin

* Working on client side code

* Cleanup

* Update sample plugin

* Add new model type

- LabelOutput model
- Stores generated label file to the database
- Makes available for download

* Update label printing plugin mixin

* Add background task to remove any old label outputs

* Open file if response contains filename

* Remove "default printer" option which does not specify a plugin

* Delete old labels after 5 days

* Remove debug statements

* Update API version

* Changed default behaviour to background printing

* Update label plugin mixin docs

* Provide default printer if none provided (legacy)

* Update unit test

* unit test updates

* Further fixes for unit tests

* unit test updates
2023-07-17 21:39:53 +10:00
Matthias Mair
4d7fb751eb
remove unneeded gunicorn (#5248) 2023-07-17 20:53:02 +10:00
Oliver
370021bc7c
Update docs to match reality (#5255) 2023-07-15 23:55:22 +10:00
Lukas
0aee2a11c4
Fix weasyprint links (#5244)
* Fix weasyprint links

* Update report.md
2023-07-13 18:31:05 +02:00
Lukas
ee274739a6
Added required attribute to settings/plugins, refactor: allValues (#5224)
* Added required attribute to settings/plugins, refactor: allValues

- added 'required' attribute to InvenTreeBaseSetting
- added 'check_all_settings'
- added 'all_settings' to get a list of all defined settings
- refactored 'allValues' to use new 'all_settings' function
- added docs for new 'check_setting' function on plugin SettingsMixin

* Fix typing to be compatible with python 3.9

* trigger: ci

* Fixed **kwargs bug and added tests
2023-07-12 08:19:19 +10:00