Commit Graph

14301 Commits

Author SHA1 Message Date
Oliver
f1031efa93
CSS fix for 2FA token (#5000)
- Enforce white background for the QR code
2023-06-09 01:09:12 +10:00
Matthias Mair
e807339c55
respect timezone when handeling git commit times (#4997) 2023-06-08 22:00:54 +10:00
Oliver
bae1c239e8
Fix for forms.js (#4996)
- Fixes subtle bug introduced in recent javascript linting fix
- Prevented error messages from displaying on modal forms
- The whole thing needs to be razed and rebuilt
2023-06-08 21:30:10 +10:00
Oliver
842d7a93d5
Fix for faulty data migrations (#4987)
* Update part.migrations.0112

- Add custom migration class which handles errors

* Add unit test for migration

- Ensure that the new fields are added to the model

* Update reference to PR
2023-06-08 21:12:57 +10:00
Matt Brown
a4b4df5ff4
Place uninstalled items back in stock (#4994)
reset the consumed_by field as well as belongs_to, so an uninstalled
item can be reused.

Fixes: #4992
2023-06-08 20:22:50 +10:00
Oliver
81413e02c4
Update CONTRIBUTING.md (#4988)
Add notes about "migration" tag
2023-06-07 22:15:59 +10:00
Matthias Mair
d7d3d8aa26
Currency migrations - stop migrations when defaults change (#4975)
* make currency choices independend

* replace hard coded default currency

* use function for psql?

* use callable default

* revert some fields

* also migrat all currency codes
2023-06-07 20:05:37 +10:00
Oliver
192c1ecb21
Add note on SSO behind proxy (#4985) 2023-06-07 11:55:02 +10:00
Oliver
a3150d9cb3
Refactor label API code (#4978)
* Refactor label API code

- Add common base class for serializers

* More import cleanup
2023-06-06 18:49:19 +10:00
Oliver
f65281c801
Migration bug fix 2 (#4977)
* Additional migration fix:

- In #4961 we did not notice that the migration files had been renamed
- There is still a chance that a production db (running from master) has a corrupted set of migrations
- Check if the duplicate columns already exist
- If they do, delete them first

* Typo fix

* Add PR reference
2023-06-06 15:45:24 +10:00
Oliver
ba24ff570a
SSO bug fix (#4972)
* Catch SSO error

- If social application is not assigned to at least one site, errors happen
- Check if at least one site is enabled

* Docs updates

* Typo fix
2023-06-05 21:03:16 +10:00
Oliver
3ba1d10fc4
New Crowdin updates (#4950)
* 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

* 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-06-05 20:04:16 +10:00
Oliver
a4be6bc90b
New tags (#4971)
- feature
- experimental
2023-06-05 19:41:42 +10:00
Matthias Mair
58a33c2e67
[FR] Switch from git to dulwich (#4966)
* [FR] Switch from pure git to dulwich Fixes #4942

* fix lenght

* change length again

* change length again
2023-06-05 19:27:46 +10:00
dependabot[bot]
2ed7eefa27
Bump cryptography from 40.0.1 to 41.0.0 (#4955)
* Bump cryptography from 40.0.1 to 41.0.0

Bumps [cryptography](https://github.com/pyca/cryptography) from 40.0.1 to 41.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/40.0.1...41.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump everything

* do not build for linux/arm/v7
see https://github.com/inventree/InvenTree/pull/4955#issuecomment-1575909025

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2023-06-05 19:27:27 +10:00
Oliver
d8965c6c2b
Prevent div-by-zero error (#4967)
- Div-by-zero could occur when calculating how many items can be built for a part
- Might result if (somehow) the BomItem has a quantity of zero
2023-06-05 13:40:50 +10:00
Oliver
45ec7b9728
Enable and disable plugins via the API (#4964)
* Cleanup plugin settings page

- Template adjustments

* Activate plugin directly via API

* Update plugin activate endpoint

- Allow plugin to be deactivated also
- Default value = True if not provided

* Update front-end / js

- Allow same JS method to either enable or disable a plugin

* Hide info for plugins which are not active

* remove duplicated column

* Tweak serializer docstring

* Fix typo

* Add extra data to plugin serializer

- is_builtin
- is_sample

* Some backend cleanup

- Don't stringify null values
- Don't replace None with "Unavailable"

* front-end table for rendering plugins

* Change default sorting

- Show active plugins first

* Fix button callback

* Remove old template

* JS linting

* More linting
2023-06-05 12:19:56 +10:00
Matthias Mair
0c47552199
Add openssf badge (#4558) 2023-06-04 00:47:06 +10:00
Oliver
2ca9e0e574
Fix for improper migrations (#4961)
- Order of migrations had been changed
- Resulted in conflicting database state
- Never ever do this!
- Ref: https://github.com/inventree/InvenTree/pull/4898
2023-06-04 00:26:18 +10:00
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