Commit Graph

14332 Commits

Author SHA1 Message Date
Matthias Mair
21ed4b2081
Fix common spelling mistakes (#4956)
* add codespell

* first fixes

* doc fixes

* fix docstrings and comments

* functional changes

* docstrings again

* and docs again

* rename args

* add ignore

* use pre-commit for filtering instead

* ups

* fix typo in filter
2023-06-04 00:04:52 +10:00
Oliver
5e2bfaa43a
Update CONTRIBUTING.md (#4960)
Add documentation on new PR tags
2023-06-03 23:16:39 +10:00
Oliver
b0338e181e
Parameter validation via plugin (#4958)
* Expose part parameter validation to plugins

- Allow ValidationMixin plugins to validate part parameter values

* Update sample plugin

* Catch and re-throw error

* Update docs

* Improve plugin docs

* Simplify validation sample

* Calculate numeric value first
2023-06-03 21:27:31 +10:00
miggland
1d85b70313
Add Metadata to more models (#4898)
* Update models: add MetadataMixin

* Fix name of model in Metadata API definition

* Add API endpoints

* Update API version

* Fix syntax

* Add API endpoint for RO, RO line, RO line extra item

* Add Metadata to Contacts

* Fix link in API version

* Fix name of model

* Fix error?

* Fix error?

* Fix all errors, hopefully..

* Add tests for order, line, extraline metadata

Extend for PO, SO

* Add tests for metadata for Company-related models

* Fix spelling

* Consolidate metadata test for all part models into one test

* Add test for all Stock metadata

* Update stock test_api

* Add all metadata tests for orders

* Fix various errors in tests

* Fix model name

* Add migration files

* Update tests for metadata

* Resolve conflict around API version number

* Rename migration file

* Rename migration file

* Will Contact edit endpoint work better?

* Revert changes in URL definitions

* Remove test, duplicate

* Fix tests with fixed PK, not from fixtures, to use a dynamic PK

* Fix migration overlap
2023-06-02 19:26:20 +10:00
Oliver
c0dafe155f
Fix for 'available' filter (#4952)
- Available filter also requires "in stock"
2023-06-02 16:37:16 +10:00
Lukas
1df97a7607
Add "can reproduce" checkbox to bug template (#4953)
* Added can-reproduce selection

* Update bug_report.yaml

* Update bug_report.yaml

* Update bug_report.yaml

* Update bug_report.yaml

* Update bug_report.yaml

* Update bug_report.yaml

* Update bug_report.yaml
2023-06-02 16:35:17 +10:00
Oliver
812b256e08
Shorten displayed linked by default (#4951) 2023-06-02 14:27:15 +10:00
Oliver
2c3ba6e528
Update action.md (#4949)
Fix path for action plugin docs
2023-06-02 09:35:56 +10:00
miggland
936c8ad7fc
Metadata bugfixes (#4947)
* Fix name of model in Metadata API definition

* Add API endpoint for RO, RO line, RO line extra item

* Update InvenTree/order/api.py

Thanks @matmair - missed that I changed this later on

Co-authored-by: Matthias Mair <code@mjmair.com>

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-06-02 07:54:55 +10:00
Oliver
60f2f1ea86
Report files (#4946)
* Adds more report tags

- uploaded_file: Load qualified path for a media file
- encode_svg_image: Encode an svg image as base64 data

* Docs updates
2023-06-02 07:54:15 +10:00
miggland
11c5ce5f80
Test flexibility (#4945)
* Add option to specify which tests to run in invoke test

* Add information on testing in CONTRIBUTING.md
2023-06-01 23:54:06 +10:00
Lukas
4d9e92011e
Fix/settings bugs and added model SettingKeyType typing (#4944)
* fix .gitignore and spelling issues

* Fix setting get not cached correctly

* Add model to settings key type

* Fix plugin setting slug url

* Fix typo

* Fix resetting of related setting field

* Improved model comment
2023-06-01 23:53:06 +10:00
Oliver
037654610e
Better rendering for parameter table (#4943)
- Use trueFalseLabel
2023-06-01 20:30:53 +10:00
Miklós Márton
46a808c064
Add user settings to remember the last/favourite label template (#4938)
* Add user settings to remember the last/favourite label template

Fixes #4932

* Remove settings_value from translated templates

Thanks Oliver for the hint!
2023-06-01 20:01:48 +10:00
Oliver
18d9ecd0f4
Tweak svg data cleaning: (#4941)
- Decode data if passed as bytes
2023-06-01 16:47:47 +10:00
Oliver
cb0f0e34d9
Improvements for parameteric part table (#4940)
- Initially only display columns which have data
2023-06-01 16:09:13 +10:00
Oliver
2c58b2fd36
New Crowdin updates (#4939)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-01 15:39:39 +10:00
Oliver
e21a5e62b8
Parameter types (#4935)
* Add fields to PartParameterTemplateModel

- checkbox: Is the field a 'checkbox'
- choices: List of valid options

* Update javascript

* Adds unit test for PartParameterTemplate

- Checkbox cannot have units
- Checkbox cannot have choices
- Choices must be unique

* Improve API filtering

- Add "has_choices" filter
- Add "has_units" filter

* Prune dead code

* Update js functions for creating / editing parameters

* Update part parameter form

- Rebuild the "data" field based on the selected template
- Supports "string" / "boolean" / "select"

* Adjust data input based on parameter type

- Choice displays available options
- Checkbox displays boolean switch
- Otherwise displays text input
- Adds more unit testing
- Updates to forms.js for improved functionality

* Calculate numeric value for boolean parameters

* Update docs

* Bump API version
2023-06-01 07:20:11 +10:00
Oliver
2c05e3e74d
Improve docs for report helpers (#4933) 2023-05-31 22:05:13 +10:00
Oliver
685cc1fd77
BOM table: remove quantity footer (#4930)
- Summing quantities of different parts does not make sense
- Especially when different parts have units
- i.e. "3 m + 22 litres = ??"
2023-05-31 17:25:51 +10:00
Lukas
99d122baa9
Refactor model helpers into own file (#4927)
* Refactor model helpers into own file to allow helper import when apps not loaded yet

* Import helper functions at module level

* Added missing imports where vscode couldnt help because its no explicit import
2023-05-31 09:18:42 +10:00
Matthias Mair
a196f443a1
Bump deps (#4911)
* bump deps

* Update requirements.txt

* fix pint

* fix reqs

* fix dev reqs
2023-05-31 09:18:02 +10:00
Oliver
92930d475c
Fix JS linting workflow (#4915)
* Add bad .js code

- Call function which has not been defined
- Should throw JS lint error

* update eslint

- Move to newer version of eslint
- Change default rules

* Fixes for tables.js

* Fixes for table_filters.js

* Fixes for stock.js

* Fix for sales_order.js and search.js

* Fix return_order.js

* Fixes for purchase_order.js

* More updates

- part.js
- plugin.js
- pricing.js

* Updates

- order.js

* Even morerer updates

- label.js
- modals.js
- model_renderers.js
- news.js
- notification.js

* More, MORE!

- build.js
- company.js
- charts.js
- filters.js
- forms.js
- helpers.js

* Final?

- api.js
- attachment.js
- barcode.js
- bom.js

* Fix 'useless-escape'

* Disable no-useless-escape rule
2023-05-30 22:55:53 +10:00
Oliver
0808382d06
Fix ReturnOrder serializer (#4923)
- Add in missing fields
2023-05-30 21:00:03 +10:00
Oliver
eca2172624
Add Finnish language support (#4921) 2023-05-29 22:05:38 +10:00
Oliver
3205527ebe
Change target of PurchaseOrder notification (#4905)
* Change target of PurchaseOrder notification

- Triggered when order is placed
- No longer when order is created

* unit test fixes
2023-05-29 21:04:31 +10:00
Ulices
32331875fe
Fix Unink to Unlink (#4919) 2023-05-29 15:56:58 +10:00
Oliver
95755c5453
js fixes (#4918)
- Do not call formatDecimal on a string
2023-05-29 11:36:12 +10:00
Oliver
b842d5ea67
New Crowdin updates (#4910)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-28 22:13:15 +10:00
Oliver
637b195a68
Add name to backport workflow (#4914) 2023-05-28 20:26:39 +10:00
Oliver
60f79a0a23
Add workflow for backporting PRs (#4912)
* Add workflow for backporting PRs

- Time saving for backporting bug fixes to stable branches
- Apply to PRs before closing

* Cleanup .json file
2023-05-28 18:55:06 +10:00
Miklós Márton
0b4a06ae7e
Fix completeSalesOrderShipment typo in sales_order.js (#4908) 2023-05-27 09:48:14 +10:00
Miklós Márton
21dafdee8e
- Bump djLint to 1.29.0 (from 1.25.0) in the CI linting scripts (#4907)
- Add alt attribute to the img tags in the templates (required by the bump)
2023-05-27 08:52:10 +10:00
Oliver
11f816a787
Fix for migration file (#4901)
- Catch *all* exceptions when migrating

(cherry picked from commit bcd068fc23637d815d7899d549f83b8bd8a26057)
2023-05-26 19:44:32 +10:00
Oliver
01e2376748
New Crowdin updates (#4875)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-26 17:01:21 +10:00
miggland
4d76708bee
Add API Calendar for Return Orders (#4899)
* Add RO to calendar output

* Update title and description to be more descriptive

* Add documentation

* Add simple test for RO calendar

* Lint/syntax

* Lint

* Changes to title, description
2023-05-26 17:01:04 +10:00
Oliver
5dd6f18495
Part units (#4854)
* Add validation to part units field

* Add "pack_units" field to the SupplierPart model

* Migrate old units to new units, and remove old field

* Table fix

* Fixture fix

* Update migration

* Improve "hook" for loading custom unit database

* Display part units column in part table

- Also allow ordering by part units
- Allow filtering to show parts which have defined units

* Adds data migration for converting units to valid values

* Add "pack_units_native" field to company.SupplierPart model

* Clean pack units when saving a SupplierPart

- Convert to native part units
- Handle empty units value
- Add unit tests

* Add background function to rebuild supplier parts when a part is saved

- Required to ensure that the "pack_size_native" is up to date

* Template updates

* Sort by native units first

* Bump API version

* Rename "pack_units" to "pack_quantity"

* Update migration file

- Allow reverse migration

* Fix for currency migration

- Handle case where no currencies are provided
- Handle case where base currency is not in provided options

* Adds unit test for data migration

* Add unit test for part.units data migration

- Check that units fields are updated correctly

* Add some extra "default units"

- each / piece
- dozen / hundred / thousand
- Add unit testing also

* Update references to "pack_size"

- Replace with "pack_quantity" or "pack_quantity_native" as appropriate

* Improvements based on unit testing

* catch error

* Docs updates

* Fixes for pricing tests

* Update unit tests for part migrations · 1b6b6d9d

* Bug fix for conversion code

* javascript updates

* JS formatting fix
2023-05-26 16:57:23 +10:00
Matthias Mair
717bb07dcf
Possible fix for git messages (#4882)
* yank git stuff out

* fix tests

* Add check for git to reduce warning logs
Fixes #4428

* reverse git removal

* and more resetting
2023-05-26 08:17:32 +10:00
Oliver
433ea4d0de
Documentation Improvements (#4894)
* Improvements for version banner

- Display at the bottom of the page
- Simplify text

* Use mkdocs version provider

* use 'navigation.instant'

* Support modern mkdocs features

- Much better navigation and improved features

* Content changes

* Add code to find previous versions

* Remove modern python syntax

* display output codes

* Hide version banner

* Extra debug message

* update terminology.md
2023-05-25 22:42:16 +10:00
Oliver
8268b9b105
Fix for data migration (#4892)
* Fix for data migration

- Catch *all* exceptions
- We don't want an unhandled exception to break data migration

* Add more exception handling

* Fix typo
2023-05-25 10:59:55 +10:00
Matthias Mair
fdd4169cd7
Improve cli experience (#4881)
* fix cli call to get a fully running invoke

* use relativ import
This is importend when imported from outside

* Add version command

* Add more information to version command

* make print easier to understand
2023-05-24 16:34:36 +10:00
Oliver
4079224658
Fix for PurchaseOrder template (#4885)
- Fixes bug which removes javascript incorrectly
2023-05-24 16:18:54 +10:00
Oliver
4d00c471e1
Change debug message for plugin events (#4884)
- Change from .info to .debug for less verbosity
2023-05-24 15:32:49 +10:00
Oliver
09e99e5f75
Remove debug message (#4883)
- Removes an old debug message which was left in by mistake
2023-05-24 13:48:38 +10:00
Matthias Mair
aa2f5e330a
Make nginx more clear that changing the port is 'dangerous' (#4880)
* Make nginx more clear that changing the port is 'dangerous'
See https://github.com/inventree/InvenTree/issues/4859#issuecomment-1560025566

* also add note to prod docker-compose
2023-05-24 09:05:16 +10:00
Oliver
91d79dc3ed
Improved error handling for email support (#4862)
* Improved error handling for email support

- Prevent email sending if email not configured
- Check for tx email address before sending

(cherry picked from commit de541f811ede030ea5eb3136132731e1dafccc31)

* Update InvenTree/email.py

Co-authored-by: Matthias Mair <code@mjmair.com>

* Update InvenTree/email.py

Co-authored-by: Matthias Mair <code@mjmair.com>

* Fix location of file email.py

* Allow dummy emails in testing

* Provide default email in testing mode

* Fix to get test working

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-05-24 07:33:31 +10:00
Oliver
96b7845d84
Fix for currency migration (#4873)
- Handle case where no currencies are provided
- Handle case where base currency is not in provided options

(cherry picked from commit b1bf086ae9)
2023-05-22 22:59:10 +10:00
Oliver
f76059b2b4
Reorganize FAQ section (#4872) 2023-05-22 20:02:42 +10:00
Oliver
59cbf17b02
Faq docker (#4871)
* Remove stat context variables

* Revert "Remove stat context variables"

This reverts commit 0989c308d0.

* Allow longer timeout for image download tests

* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* docs: Update FAQ section

- Add note regarding permissions for docker directories

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-22 17:17:59 +10:00
Oliver
5992dcdfda
Handle ValidationError when creating a new setting (#4868)
- Duplicate keys can occur in some race conditions
- Catch and pass ValidationError
2023-05-22 12:12:02 +10:00