Commit Graph

14020 Commits

Author SHA1 Message Date
Oliver
eccd3be150
Client side currency conversion (#4293)
* Automatically update exchange rates when base currency is updated

* Adds API endpoint with currency exchange information

* Add unit testing for new endpoint

* Implement javascript code for client-side conversion

* Adds helper function for calculating total price of a dataset

* javascript cleanup

* Add functionality to sales order tables

* JS linting

* Update API version

* Prevent auto currency updates under certain conditions
2023-02-02 22:47:35 +11:00
Oliver
9a289948e5
Include stock item purchase price in pricing cache (#4292)
* Add setting to control pricing calculation from stock items

* Bug fix for displaying a "null" setting

* Add new fields to PartPricing model

* Add code for calculation of min/max stock item costs

* Update pricing display to use stock item pricing

* Add unit testing for new pricing features

* Automatically update pricing when stock item is created or edited

* Increment API version

* Improvements for price rendering

* Update based on feedback:

- Roll stock item pricing into purchase pricing
- Simplify models
- Update unit tests
2023-02-02 21:23:16 +11:00
Oliver
df4209801a
Prevent duplicate groups in reference format fields (#4291) 2023-02-02 11:32:47 +11:00
Oliver
4f029d4d81
Improvements for part creation API endpoint (#4281)
* Refactor javascript for creating a new part

* Simplify method of removing create fields from serializer

* Fix bug which resulted in multiple model instances being created

* remove custom code required on Part model

* Reorganize existing Part API test code

* Add child serializer for part duplication options

* Part duplication is now handled by the DRF serializer

- Improved validation options
- API is self-documenting (no more secret fields)
- More DRY

* Initial stock is now handled by the DRF serializer

* Adds child serializer for adding initial supplier data for a Part instance

* Create initial supplier and manufacturer parts as specified

* Adding unit tests

* Add unit tests for part duplication via API

* Bump API version

* Add javascript for automatically extracting info for nested fields

* Improvements for part creation form rendering

- Move to nested fields (using API metadata)
- Visual improvements
- Improve some field name / description values

* Properly format nested fields for sending to the server

* Handle error case for scrollIntoView

* Display errors for nested fields

* Fix bug for filling part category

* JS linting fixes

* Unit test fixes

* Fixes for unit tests

* Further fixes to unit tests
2023-02-02 09:24:16 +11:00
Matthias Mair
c6df0dbb2d
[BUG] Increase worker-timeout to account for install times (#4285)
Fixes #4284
2023-02-01 10:25:10 +11:00
Oliver
06eb3a81b6
Force builtin plugins to be active (#4276)
* Force builtin plugins to be active

- Not setting the "active" flag can cause ambiguous errors
- e.g. some settings don't work if the plugin is inactive
- By design, builtin plugins are always "active" anyway
- This PR just forces the active field to True

* Fix unit tests
2023-01-29 15:44:04 +11:00
Oliver
50eb81f495
Do not auto-fill target_date for line items (#4275)
* Improve help_text for target_date field on lineitem model(s)

* Don't auto-fill target_date for purchase order line item(s)

* Refactor function to create new sales order line item

* Add migration file

* JS linting
2023-01-29 14:24:38 +11:00
Matthias Mair
ed9f93a2d6
Add cli to package installs (#4274)
* Add cli to package installs

adds an optional call to the command line to run invoke commands easiert

* Add libffi7

needed for ffi / cli operations
2023-01-29 12:39:27 +11:00
Matthias Mair
1fce1fa695
Plugin settings refactor (#4185)
* make plugin urls def cleaner

* rename plugin managment endpoints

* Add setting to plugin edpoint

* docstring

* [FR] Add API endpoint to activate plugins
Fixes #4182

* fix API syntax

* Fix plugin detail lookup for deactivated plugins

* fix API metadata lookup

* fix for api url change

* use slug as error reference

* fix get action

* add tests for activating plugins

* Add tests for check_plugin
2023-01-27 16:45:14 +11:00
Oliver
83eaa6ef79
Bug fix for creating Part or Company via API (#4264)
- If specified, the "remote_image" field is passed through to the __init__ method
- Throws a 500 error
- Solution is to explicitly ignore the provided field
2023-01-27 14:50:41 +11:00
Oliver
cb518ddde6
Tweak SSO settings page (#4263)
Group SSO related settings together
2023-01-27 01:21:53 +11:00
Oliver
26f71b3fac
Improve translation source text (#4254)
* Improve translation source text

* Add migration file for translation
2023-01-26 22:34:30 +11:00
Oliver
c838bddc19
Handle case where function is called with empty user (#4259) 2023-01-26 22:34:19 +11:00
Matthias Mair
8df5649b6f
[FR] Add API endpoint to activate plugins (#4186)
* make plugin urls def cleaner

* rename plugin managment endpoints

* [FR] Add API endpoint to activate plugins
Fixes #4182

* fix for api url change

* bump API version
2023-01-26 07:05:09 +11:00
Michael
3d5be5a5c7
Fixed error in default BOM report (#4257)
* Enable rendering of table in Notes markdown into reports

* fixed style problems

* Fixed error in default BOM report

* Delete bla

ups, left over
2023-01-26 07:04:07 +11:00
Matthias Mair
e870b0c9b6
[FR] Simple API endpoint to change own user metadata (#4151)
* [FR] Simple API endpoint to change own user metadata
Fixes #3979

* add tests

* fix tests

* add owner api tests

* add debug statments

* run all tests

* disable owner endpoint test for now

* spellfix
2023-01-25 13:04:06 +11:00
Oliver
2d3570c923
New Crowdin updates (#4191)
* 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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-25 12:49:08 +11:00
Matthias Mair
0e0d961205
[FR] Add last updated column for supplier parts (#4214)
* Move to updated Meta mixin

* [FR] Add last updated column for supplier parts
Fixes #3327

* add updated to table

* bump API version

* add missing migration

* incremetn api ;-)
2023-01-25 12:18:52 +11:00
Matthias Mair
af0bc90e48
[BUG] Plugin Schedule do not update when beeing changed + plugin testing (#4243)
* Add test for api_call

* Add coverage for LocateMixin

* no cov for no url

* make sure changed details get updated

* restructure code

* Test that changes in schedules are reflected
Fixes #4239
2023-01-25 09:41:20 +11:00
Matthias Mair
428e939b1d
[FR] Add "priority" field to BuildOrder (#4225)
* [FR] Add "priority" field to BuildOrder
Fixes #3059

* Add priority to the frontend

* add field to serializer

* bump version
2023-01-25 09:37:05 +11:00
bloemp
61e5244789
Bom export with substitute part numbers (#4203)
* Added BOM export option to export substitute part numbers

* Small documentation fix

* Fixed the behaviour for multiple lines with different amount of substitutes

* Changed UI naming to "alternative parts"
2023-01-25 09:35:26 +11:00
bloemp
8316086c61
Fix for returning stock from the customer to a specified location (#4208)
* Fix for returning stock from the customer to a specified location

When returning stock from the customer, the allocations of that stock
are freed. If the new stock location is the same as the parent stock,
merge the stock back into the parent.

* Added tests for allocateToCustomer and return_from_customer

* Added additional test that checks total stock

* Fixed typos
2023-01-25 09:34:15 +11:00
bloemp
6e234e4a14
Fixed type in settings page (#4213)
After this change, the Crowdin key will also change and the following
languages need to be updated

ES
msgstr "Eliminar Noficiaciones"

FR
msgstr "Supprimer les noficiations"

HU
msgstr "Értesítések törlése"

NO
msgstr "Slett varsler"
2023-01-25 09:32:54 +11:00
bloemp
11f147fd34
Reload purchase order table after part order (#4219)
* Reload purchase order table after part order

When on the part page, going to the "Purchase order" sidebar tab.
You can order the part by pressing the "Order Part" button.
After a succefull order, the form closes but the table on the page
was never refreshed.

* Fixed a js styling check error
2023-01-25 09:32:17 +11:00
Matthias Mair
1862904a2f
[BUG] Quick Installer: INVENTREE_DB_PORT errors (#4224)
Fixes #4222
2023-01-25 09:31:55 +11:00
Matthias Mair
642c76390e
Rewording templates (#4235)
* Rewording FR

* Spellcheck bug report

* Spellcheck install

* fix file ending
2023-01-25 09:31:35 +11:00
miggland
da8da81b0a
Update receive items help text to reflect reality (#4230) 2023-01-25 09:31:11 +11:00
bloemp
2a6440843f
Make sure that print label dialog has a submit button. (#4240)
Steps to reproduce problem:
Go to a screen that has a modal without a submit button like "Show QR code" of the Sublocation overview.
Close the QR code modal and after that go to the "Print label" option.
It will no longer show a submit button.
2023-01-25 09:30:47 +11:00
Matthias Mair
c78e712a16
Fix debian 11 detection on installer (#4241)
* Fix debian 11  detection
Fixes #4236

* compile installer script

* fix typo
2023-01-25 09:30:14 +11:00
Matthias Mair
2dae60292e
Fix typos/naming (#4242)
* fix usage of InvenTree name

* small typo fix

* rename notification plugin
all builtins should be named inventree...
2023-01-25 09:29:50 +11:00
Matthias Mair
1960e662a7
[BUG] Fix ownership (#4244)
* Reenable ownership tests

* [BUG] Stock item ownership results in stock item being read-only
Fixes #4229

* rebuild ownership tests

* jsut test stock stuff for now

* move ownership check to Owner

* fix assertation with lazy objects

* test all of stock

* Add edit checks

* remove old tests

* run full coverage again

* fix test
2023-01-25 09:28:36 +11:00
Matthias Mair
e730b5c24c
Remove total lines badge from README (#4193)
seems to not work currently
2023-01-10 16:17:43 +11:00
bloemp
49630e295d
Initialize target date for new PO line and SO line (#4170)
* Initialize date for new PO line or SO line

Set new PO/SO line initial date to that of the PO/SO it belongs to.

* Changed date formatting to render_date  template tag

* Reverted the change to format the date with the render_date template tag
2023-01-10 09:07:54 +11:00
Oliver
385ed8277d
Configuration options for dbbackup (#4190)
* Configuration options for dbbackup

Ref: https://github.com/inventree/InvenTree/discussions/4179

* DBBACKUP_SEND_EMAIL is always False

* Cleanup settings file

* Make backup step optional during update

* Change update operation to perform backup by default
2023-01-10 07:54:25 +11:00
Oliver
ee2290da28
Gunicorn options (#4192)
* Add option for controlling gunicorn timeout

* Adds gunicorn timeout as docker env variable
2023-01-10 07:53:57 +11:00
Matthias Mair
ac92471dcb
[SSO] Separate settings for local and social signup (#4171)
* [SSO] Separate settings for local and social signup
Fixes #4166

* make registration setting configruable

* extend docstring

* add setting to settigns screen

* update check ref

* both settign most be checked
2023-01-10 00:20:05 +11:00
Oliver
0ed2aa3a4d
Change default value for auto-backup setting (#4189) 2023-01-10 00:02:50 +11:00
Oliver
b9b26307b1
New Crowdin updates (#4140)
* 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

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.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-01-09 21:10:56 +11:00
Matthias Mair
ccf784d36c
Dep updates (#4176)
* test bumping deps

* bump dep file

* readd old pointer

* update pre-commit

* update req

* update dev req
2023-01-09 08:23:43 +11:00
Matthias Mair
be859183a5
[FR] Enable restrictions on allowed domains for signup (#4172)
* [FR] Enable restrictions on allowed domains for signup
Fixes #4168

* raise permission errors

* add setting to page

* move checks to clean_email

* remove unneeded check

* simplify

* log error to database

* factor settings fnc call out

* Add validation before setting save

* add before_save to accepted tokens
2023-01-09 08:22:50 +11:00
Oliver
41318e4056
SSO tweaks (#4169)
* Slight tweaks to login settings page

* Cleanup login screen

* Custom socialaccount connect page

- Better rendering, just looks nicer etc

* Add custom account templates

- signup_closed
- social signup

* Catch potential email errors when signing up new user

* Add custom template for authentication error

* Bug fix for account base.html
2023-01-08 07:51:16 +11:00
Matthias Mair
82bdd7780d
[FR] Simplify / optimize setting loading (#4152)
* [FR] Simplify / optimize setting loading
Cache config.yaml data on load and use cached  for get_settings
Fixes #4149

* move the cache setting to config

* add docstring

* spell fix

* Add lookup where settings come from
Fixes #3982

* Fix spelling
2023-01-07 23:24:20 +11:00
Matthias Mair
0e96654b6a
[FR] Move URL endpoints to API namespace (#4163)
* Move endpoints
[FR] Move download URL endpoints to API namespace
Fixes #3927

* rename endpoint ref name and update js

* update endpoint name and js

* rename endpoint and fix js

* add docstring
2023-01-07 23:23:38 +11:00
Oliver
942086741e
Label api refactor (#4165)
* Add generic mixin classes for label printing API

* Extend refactor to StockLocationLabel class

* Refactor part label printing
2023-01-07 23:22:44 +11:00
Oliver
09e02755ca
Logic fix for build calculation (#4161)
- Fixes logic for "required_parts_to_complete_build" method
2023-01-07 01:04:57 +11:00
Oliver
34bb40d439
Catch potential error when refreshing part pricing (#4154) 2023-01-06 11:14:25 +11:00
Oliver
f070c64534
Adds concurrency config for docker CI workflow (#4160) 2023-01-06 10:40:50 +11:00
Matthias Mair
d448689d66
BUG: Fix settings lookup (#4147)
* Load plugin settings also from env

[BUG ]PLUGIN setting only work when set in config file
Fixes #4146

* formatting fix

* use 'INVENTREE_' prefix everyhwere for envs

* make more settings 'env'-able
2023-01-05 06:49:27 +11:00
Bben
6a0efb0365
Add Date input for table filter (#4067)
* Add Date input for table filter

* Update filters.js

* Update filters.js

* Expiry date filter on stock item

* JS whitespace

* Timezone from JS

* Move to timestamp timezoned

* Revert to YYYY-MM-DD iso format

* Remove setting/ getFilterSettings from addTableFilter
2023-01-05 06:48:16 +11:00
Matthias Mair
d50bf60826
Issues with maintenance_mode.txt (#4148)
* Issues with maintenance_mode.txt
Fixes #3618

* Update django-maintenance-mode to fix maintenante mode problems

Issues with maintenance_mode.txt
Fixes #3618
2023-01-05 06:46:59 +11:00