Commit Graph
100 Commits
Author SHA1 Message Date
Oliver 798bc17311 Merge remote-tracking branch 'inventree/master' into drf-api-forms 2021-06-29 09:57:03 +10:00
OliverandGitHub 4eef3c99bc Merge pull request #1731 from matmair/allocated-sort-qty
sortable OrderAllocationTable
2021-06-29 09:31:55 +10:00
Oliver 374344d0e2 Refactor switch statement 2021-06-29 09:28:00 +10:00
Oliver 0037056ee8 Better default renderer 2021-06-29 09:26:40 +10:00
Oliver 25a01be995 Added warning message for missing model information 2021-06-29 09:25:40 +10:00
Oliver c3ef8d2dfb Fixes for model renderers 2021-06-29 09:14:26 +10:00
Oliver ed2f21f583 Display field prefix element in form 2021-06-28 21:38:42 +10:00
Oliver ac7564d069 Extract "limit_choices_to" options for relatedfields
- Specify as 'filters' for 'related field' type
- Extremely handy to be able to filter AJAX requests in a DRY manner!
2021-06-28 21:29:51 +10:00
OliverandGitHub ce731db203 Merge pull request #1729 from SchrodingersGat/api-bug-fix
Adds unit tests for HTML API endpoints
2021-06-28 21:23:36 +10:00
Oliver f0f6c7d186 Add a comment 2021-06-28 21:09:48 +10:00
Oliver 4dbd770f2d Fixed (I think?) 2021-06-28 21:08:50 +10:00
Oliver 3c1f0637dc Adds unit tests for HTML API endpoints 2021-06-28 20:42:37 +10:00
Oliver f3ed05a09e Automatically associate ''filters' with relations 2021-06-28 20:13:18 +10:00
Oliver e585079779 Callback function for fields after editing 2021-06-28 19:32:48 +10:00
Oliver fbff9bfb2d Insert buttons for secondary modals 2021-06-28 15:10:17 +10:00
Oliver 41539b75db Adds custom filters for AJAX queries 2021-06-28 14:19:05 +10:00
Oliver e2942238a9 Bug fix - check for null rather than just ! 2021-06-28 13:10:41 +10:00
Oliver ba2537d125 Refactor the way that field options are passed to a form 2021-06-28 13:03:34 +10:00
Oliver 6335372208 Store instance data when performing an "update" 2021-06-28 09:28:38 +10:00
OliverandGitHub b5086ab731 Merge pull request #1726 from matmair/bom-pricing
Bom pricing
2021-06-28 09:15:52 +10:00
Oliver 0e9b82c475 Load default values into rendered form 2021-06-27 21:58:22 +10:00
Oliver d80948369b Include 'default' value in OPTIONS request for any fields with specified default values 2021-06-27 21:44:21 +10:00
OliverandGitHub 604c136b00 Update version.py 2021-06-27 21:00:01 +10:00
OliverandGitHub 786e994e19 Update version.py
0.2.4
2021-06-27 20:58:24 +10:00
Oliver 67f76c8bca Merge remote-tracking branch 'inventree/master' into drf-api-forms 2021-06-27 09:26:23 +10:00
OliverandGitHub 42ed95c936 Merge pull request #1588 from matmair/part-import
Part import
2021-06-27 09:24:10 +10:00
OliverandGitHub 9e720ea620 Merge pull request #1700 from SchrodingersGat/api-default-values
Unit testing for default values
2021-06-27 09:01:01 +10:00
Oliver Walters 34a374ce9a Add try/except around callable default 2021-06-27 01:18:09 +10:00
Oliver Walters 0cc999410b More unit test fixes 2021-06-27 01:03:54 +10:00
Oliver Walters 7505d7b3c5 Unit test fixes 2021-06-27 00:47:12 +10:00
Oliver Walters d3e9803fd4 Remove debug statement 2021-06-27 00:25:49 +10:00
Oliver Walters 232899e0c4 Simpler implementation 2021-06-27 00:25:23 +10:00
Oliver Walters 8913b74f41 Typo fixes 2021-06-27 00:12:10 +10:00
Oliver Walters ae1a1e139f Further fixes for default API values
- Account for callable defaults
- Extra check in is_valid()
2021-06-27 00:01:40 +10:00
Oliver a0390f0821 PEP style fixes 2021-06-26 21:14:47 +10:00
Oliver b2aa38fefa Override get_initial() rather than is_valid() 2021-06-26 21:14:10 +10:00
Oliver ddbf863617 Merge remote-tracking branch 'inventree/master' into api-default-values
# Conflicts:
#	InvenTree/InvenTree/serializers.py
2021-06-26 21:04:41 +10:00
Oliver ba1c70e86b Intercept is_valid() method to set default values 2021-06-26 20:48:09 +10:00
OliverGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
3f1aca9e94 Translation merge (#1724)
* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* updated translation base

* updated translation base

* updated translation base

* updated translation base

* 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

* updated translation base

* 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

* updated translation base

* 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

* 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

* updated translation base

* updated translation base

* New Crowdin updates (#1670)

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* 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

* 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

* 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

* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* updated translation base

* updated translation base

* 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

* 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

* updated translation base

* updated translation base

* Fix: New translations django.po from Crowdin

* 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

* updated translation base

* 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

* updated translation base

* 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

* 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

* updated translation base

* Fix: New translations django.po from Crowdin

* 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

* 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

* 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

* updated translation base

* updated translation base

* updated translation base

* 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

* 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

* 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

* 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

* 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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-06-26 20:18:25 +10:00
Oliver f696bb2e2a Correctly read out boolean fields 2021-06-26 19:49:56 +10:00
Oliver 2eb7565683 Callback handler for form success 2021-06-26 19:30:57 +10:00
Oliver 9dd2765bd2 Handle returned error messages 2021-06-26 19:11:20 +10:00
Oliver e9db72017d Extract field data on submit 2021-06-26 17:54:14 +10:00
Oliver 949c7dd81b Set modal form title 2021-06-26 14:30:14 +10:00
Oliver 565631ef87 More features
- Custom renderers depending on specified model name
- Paginate API results
2021-06-26 14:09:35 +10:00
Oliver b29db6f258 Remove old debug message 2021-06-25 15:22:40 +10:00
Oliver d411728be6 Start of custom rendering support based on model 2021-06-25 13:58:36 +10:00
Oliver 4cf69a5a4c Custom rendering functions 2021-06-25 13:47:33 +10:00
Oliver 341467ae8d Fixes for base template 2021-06-25 13:47:09 +10:00
Oliver c07aeddfdb Move select2 files around 2021-06-25 13:39:06 +10:00
Oliver 9e7d1710db Fixes for select2 rendering issues 2021-06-25 13:23:29 +10:00
OliverandGitHub 76ec51a93b Merge pull request #1722 from matmair/internal-price-op
full Internal price coverage
2021-06-25 07:37:06 +10:00
Oliver b20af54b76 Create select2 instance for related field 2021-06-25 07:36:37 +10:00
Oliver 9977b0bf59 Include model name in metadata 2021-06-25 07:36:13 +10:00
Oliver c5df91efce PEP Fix 2021-06-25 00:38:28 +10:00
Oliver 970a5d5eed Include API endpoints in OPTIONS metadata 2021-06-25 00:36:22 +10:00
Oliver 04374c71c2 Annotate models with their API list view
- It will make sense, trust me
2021-06-25 00:17:58 +10:00
Oliver b273dc613b Scratch that 2021-06-24 23:15:19 +10:00
OliverandGitHub be85de4a7b Merge pull request #1719 from SchrodingersGat/test-results-fix
Fixes table data nesting
2021-06-24 13:40:09 +10:00
Oliver a12790d5ca Fixes table data nesting
Sometimes you just need a quick break
2021-06-24 13:23:12 +10:00
Oliver b350a971a4 Working on custom field info in metadata class 2021-06-24 13:12:46 +10:00
Oliver 9feef935f4 Readonly fields 2021-06-24 00:16:30 +10:00
Oliver c8085ad39d Skip nested objects 2021-06-24 00:13:40 +10:00
Oliver 9f3f07aff3 Refactor toot-toot
- Now can specify the "order" of fields
2021-06-24 00:06:27 +10:00
Oliver 1754af3d43 Adds ability to specify which fields are displayed 2021-06-24 00:00:20 +10:00
Oliver e7bc53a548 Working on a 'update' form
- Fetch existing data from the API
2021-06-23 23:51:11 +10:00
Oliver 4009ec844f Test fixes 2021-06-23 23:42:56 +10:00
Oliver 6162129e3d Support choice field 2021-06-23 23:36:38 +10:00
Oliver 1a43198cb7 actually run tests, for a change 2021-06-23 23:28:32 +10:00
Oliver 96ecd2640a Support email fields 2021-06-23 23:27:02 +10:00
Oliver d77ca8aa3a Support URL fields 2021-06-23 23:23:28 +10:00
Oliver 78232c2ca2 Refactorin' 2021-06-23 23:18:36 +10:00
Oliver b71977bb6a Add field support
- Support text field
- Support checkbox field
2021-06-23 22:59:27 +10:00
Oliver 66687a6915 Now with error messages! 2021-06-23 22:37:45 +10:00
Oliver aa02377665 Updates for field rendering 2021-06-23 22:25:53 +10:00
Oliver c387e1a6fc Working on functions to construct the various form components 2021-06-23 22:11:26 +10:00
Oliver 0d9808fbb8 Adds 'constructForm' javascript function
- Skeleton only (for now!)
2021-06-23 21:41:19 +10:00
Oliver 2c1db2a902 Further tweaks 2021-06-23 21:40:09 +10:00
Oliver b8a3117c83 Fix unit tests 2021-06-23 21:21:39 +10:00
Oliver 82a6ff7772 Adds unit testing for fancy new metadata class 2021-06-23 20:58:05 +10:00
Oliver eaa5913c8c Adds custom DRF metadata handler
- Limit available "actions" data to only what the user is allowed to do
2021-06-23 20:30:26 +10:00
Oliver 058e53459b Add simple function for determining OPTIONS 2021-06-23 20:07:56 +10:00
OliverandGitHub fcbb4c593b Merge pull request #1715 from SchrodingersGat/tweaks
Change some warnings to infos
2021-06-23 19:50:07 +10:00
Oliver f0db9bc3d5 Live update of Company image 2021-06-23 19:29:41 +10:00
Oliver 70a073be21 Live update part image 2021-06-23 19:28:23 +10:00
Oliver 2e1ad0c245 Change some warnings to infos 2021-06-23 18:54:01 +10:00
OliverandGitHub 5e338dca3f Merge pull request #1710 from SchrodingersGat/inventree-api-image-upload
Allow direct upload of images via the API
2021-06-23 11:54:01 +10:00
Oliver 36e6b9f164 Set allow_null flag on image fields 2021-06-23 11:40:37 +10:00
Oliver 5ba7aeaa27 Fixes:
- Use DRF ImageField, not FileField
- Ensure that permissions get updated correctly in 'test' mode
- Allow file upload in the APITester class
2021-06-23 10:28:21 +10:00
Oliver a866001ffe Bump API version to 6 2021-06-23 08:40:51 +10:00
Oliver 878f26c770 Enable upload of company image via the API 2021-06-23 08:39:06 +10:00
Oliver f199feb8d9 Use the part detail API for uploading a new image 2021-06-23 08:34:45 +10:00
Oliver b8e4b58df0 Catch potential error updating image that does not exist... 2021-06-22 22:23:27 +10:00
Oliver 2fc7c3d883 fix typo 2021-06-22 22:16:11 +10:00
Oliver e29594811b Allow direct upload of images via the API 2021-06-22 22:09:30 +10:00
OliverandGitHub 962badc36d Merge pull request #1682 from matmair/order-modal-show-price
Order modal show price
2021-06-22 21:27:59 +10:00
OliverandGitHub 37cbb6f6b8 Merge pull request #1709 from SchrodingersGat/python-ci-fixes
Fixes for python integration
2021-06-22 21:15:30 +10:00
Oliver 3884ab0df2 Change workflow target 2021-06-22 20:58:29 +10:00
Oliver 691888ec1e Fixes for python integration 2021-06-22 20:49:49 +10:00
OliverandGitHub e0301c56fb Merge pull request #1708 from SchrodingersGat/python-ci
Add workflow to build python bindings
2021-06-22 20:40:59 +10:00