Commit Graph
100 Commits
Author SHA1 Message Date
Oliver Walters 3bb247a135 Create an initial stockitem output when a new build is created 2020-10-20 23:27:43 +11:00
Oliver Walters 652c2dbcbe Automagically disable 'serial_numbers' field for StockItemCreate form
- Yay, ajax magic!
2020-10-20 22:37:55 +11:00
Oliver Walters 2e4613e702 Updates to build forms / etc 2020-10-20 22:37:21 +11:00
Oliver Walters 2df0f03a9a Change "ALLOCATED" to "PRODUCTION" 2020-10-20 21:10:36 +11:00
Oliver Walters ac79e131bc Add "destination" field to BuildOrder 2020-10-20 21:01:51 +11:00
Oliver Walters 28460b3023 Validate that the BuildItem quantity is an integer 2020-10-20 20:42:29 +11:00
Oliver Walters fdcef7b699 Add "install_into" field for BuildItem
- Points to which output stock item it will be going into
2020-10-20 20:37:57 +11:00
OliverandGitHub 85ac1bfb95 Merge pull request #1058 from SchrodingersGat/stock-table-ordering
Fix table sorting when groups are used.
2020-10-20 12:07:11 +11:00
Oliver Walters 73a1765a11 Fix table sorting when groups are used.
This is necessary because the field names of the tables are specified like "part_detail.IPN" and multi-level string-based object access is weird.
Luckily someone has worked out the hard part for me.

Ref: https://stackoverflow.com/questions/6393943/convert-javascript-string-in-dot-notation-into-an-object-reference
2020-10-20 11:54:54 +11:00
OliverandGitHub d242e04e64 Merge pull request #1055 from SchrodingersGat/build-reference
Build reference
2020-10-20 09:03:25 +11:00
Oliver Walters a2ee172058 Updates tables for PurchaseOrder and SalesOrder 2020-10-20 08:45:17 +11:00
Oliver Walters 5a6697866f Update translations 2020-10-20 08:41:13 +11:00
Oliver Walters 406d7bcf80 Load build order prefix setting 2020-10-20 08:41:08 +11:00
Oliver Walters 7aa473712f Remove unused setting page 2020-10-20 08:32:00 +11:00
Oliver Walters 226a91718b Add a simple unit test for the settings model 2020-10-20 08:29:06 +11:00
Oliver Walters c6e61c20fe Generate default settings for all InvenTreeSetting object 2020-10-20 08:24:23 +11:00
Oliver Walters 98d20bceeb Change "Build Title" to "Description" 2020-10-20 00:26:26 +11:00
Oliver Walters e8a0095e50 Add some options for the build order settings page
- Not editable yet
2020-10-20 00:24:33 +11:00
Oliver Walters a5639c380f Add regex validator to build order reference field 2020-10-20 00:13:43 +11:00
Oliver Walters 06040f94ee Remove "description" field from InvenTreeSettings key:value fields 2020-10-20 00:02:54 +11:00
Oliver Walters 92c1e3c1a5 Update settings pages 2020-10-19 23:50:39 +11:00
Oliver Walters c13cee2407 Fixes for unit testing 2020-10-19 23:31:52 +11:00
Oliver Walters 9b7a9a3ee0 Update formatting of order pages 2020-10-19 23:23:16 +11:00
Oliver Walters b5d15aab08 Add function to "predict" next build order reference value 2020-10-19 23:22:09 +11:00
Oliver Walters 5405ad566e Add 'reference' to API serializer 2020-10-19 22:53:40 +11:00
Oliver Walters 0b7cf9e7f3 Add "reference" to build order forms 2020-10-19 22:49:28 +11:00
Oliver Walters a8d47c54f9 Upate admin interface 2020-10-19 22:40:19 +11:00
Oliver Walters 934078a42c Add "Reference" field to Build model 2020-10-19 22:36:14 +11:00
OliverandGitHub 416cfb99da Merge pull request #1053 from SchrodingersGat/modal-errors
Modal errors
2020-10-19 22:19:10 +11:00
Oliver Walters 6b99d923d7 Change "status code" to "error code" 2020-10-19 16:44:33 +11:00
Oliver Walters 396b7dba73 Extra error information when a modal dialog fails 2020-10-19 16:42:53 +11:00
OliverandGitHub 957c538136 Merge pull request #1052 from SchrodingersGat/barcode-add
Change text for barcode
2020-10-19 16:31:47 +11:00
Oliver Walters 647e2cf64d Change text for barcode 2020-10-19 16:06:18 +11:00
OliverandGitHub ce1cce99bb Merge pull request #1051 from SchrodingersGat/po-stock-list
Display table of items received against a particular purchase order
2020-10-19 11:55:25 +11:00
Oliver Walters 634410294b Display table of items received against a particular purchase order
- Adds new tab to "Purchase Order" view
- Adds ability to filter StockList API by purchase_order ID
2020-10-19 11:40:57 +11:00
OliverandGitHub 2dc9109b11 Merge pull request #1047 from eeintech/add_ipn_supplier_part_str
Added IPN to Supplier Part string representation (global)
2020-10-19 11:21:34 +11:00
OliverandGitHub 529c4052ff Merge pull request #1038 from mpdgraev/fix_int_barcode
fix error when submitting some non-dict barcodes
2020-10-19 00:01:38 +11:00
OliverandGitHub 7edd08035f Merge pull request #1049 from SchrodingersGat/api-default-location
Update creation of StockItem via API
2020-10-18 22:49:09 +11:00
Oliver Walters 3c175a6c8d Update creation of StockItem via API
- If no location is specified, but a default location exists for the part, use that
- If a location is specified (even if it is null) then the specified value is used instead
2020-10-18 22:24:45 +11:00
OliverandGitHub 83077514cb Merge pull request #1041 from eeintech/api_default_location
Added part 'default_location' to serializer
2020-10-18 22:01:35 +11:00
OliverandGitHub 4d4f0e5cfc Merge pull request #1044 from eeintech/stock_permissions
Fixed insertion of backslash in the Stock barcode button group
2020-10-18 21:11:09 +11:00
OliverandGitHub ca8472ac23 Merge pull request #1037 from SchrodingersGat/tz-support
Add support for setting timezone in config.yaml
2020-10-08 21:35:36 +11:00
Oliver Walters 3d60bccae0 Add support for setting timezone in config.yaml 2020-10-08 21:02:38 +11:00
OliverandGitHub 26ee3032f6 Merge pull request #1036 from SchrodingersGat/bom-quantity-export
Normalize quantity field when exporting BOM
2020-10-08 14:21:50 +11:00
Oliver Walters 8b16304e84 Custom 404 page 2020-10-08 14:09:08 +11:00
Oliver Walters b595f3b732 Normalize quantity field when exporting BOM 2020-10-08 14:05:55 +11:00
OliverandGitHub 305920d1ac Merge pull request #1030 from eeintech/stock_permissions
Stock permissions
2020-10-07 14:11:52 +11:00
OliverandGitHub ec4bc357df Merge pull request #1031 from eeintech/fix_superuser_permission
Fixed context permissions for superuser with no group assigned
2020-10-07 13:40:59 +11:00
OliverandGitHub 279b50d977 Merge pull request #1029 from SchrodingersGat/sales-order-permissions
Sales order permissions
2020-10-06 20:44:01 +11:00
Oliver Walters 8b37229e4b The real translations are the ones we made along the way 2020-10-06 20:31:38 +11:00
Oliver Walters b80e4302ba Update permissions for build app 2020-10-06 20:29:16 +11:00
Oliver Walters 2325b1e4ba Unit test fixes 2020-10-06 20:10:14 +11:00
Oliver Walters 9abb211cdf Update template permissions 2020-10-06 20:09:55 +11:00
Oliver Walters 1c97aaf87a Set permissions for order views 2020-10-06 19:46:53 +11:00
OliverandGitHub 606c62078f Merge pull request #1024 from SchrodingersGat/part-permissions
Permissions
2020-10-06 18:29:05 +11:00
Oliver Walters ab454e5ba4 More template changes: perms -> roles 2020-10-06 16:46:13 +11:00
Oliver Walters 88f73443ee Yet more style fixes 2020-10-06 16:43:39 +11:00
Oliver Walters 77a2b6de8b Merge branch 'part-permissions' of https://github.com/SchrodingersGat/InvenTree into part-permissions 2020-10-06 16:03:33 +11:00
Oliver Walters b3e4efd96e Unit testing fixes 2020-10-06 16:03:19 +11:00
OliverandGitHub e076470305 Merge branch 'master' into part-permissions 2020-10-06 12:35:45 +11:00
Oliver Walters d691b15f4b Fix conflicts 2020-10-06 12:34:30 +11:00
Oliver Walters 11d31960c7 Change modal form permissions to use new "role" strategy 2020-10-06 11:42:16 +11:00
Oliver Walters c740cce5e4 PEP fixes 2020-10-06 11:31:04 +11:00
Oliver Walters dc2c9aa662 Add InvenTreeRoleMixin
- Simplifies permission requirements for views
- e.g. 'part.view' rather than 'part.view_partcategory'
2020-10-06 11:29:38 +11:00
Oliver Walters d2e2e7511f Update templates: Change perms to roles 2020-10-06 10:07:39 +11:00
Oliver Walters fa21d66c41 Fix logic for global context object 'roles'
- User may be a part of multiple groups
- Roles are additive across groups
2020-10-06 09:54:37 +11:00
Oliver Walters 23aee234f0 Change index page to use roles rather than perms to determine user permissions 2020-10-06 09:32:05 +11:00
Oliver Walters 556ffa1099 Change label for permissions to match django permission names 2020-10-06 09:28:05 +11:00
Oliver Walters 8b2189daca Add global context 'roles'
- Access via template e.g. {% if roles.part.view %}
- Always True if the user is a superuser
2020-10-06 09:27:22 +11:00
OliverandGitHub e74bfb90a5 Merge pull request #1025 from eeintech/fixed_group_redundant_saves
Fixed Group model permissions redundant saves
2020-10-06 07:40:44 +11:00
Oliver Walters 3f59ce3f93 Update unit tests
- requires the user to actually have the necessary permissions!
2020-10-06 01:30:36 +11:00
Oliver Walters 16d720b62c Update permission requirements for API
- Automatically use model permissions by default!
-
2020-10-06 00:36:55 +11:00
Oliver Walters 8ee16d6f98 update translation files 2020-10-06 00:20:57 +11:00
Oliver Walters ba4c829b10 Add permission requirements in various part templates 2020-10-06 00:20:45 +11:00
Oliver Walters afadd51a14 Fix permissions in views.py
Silly, "add" not "create"
2020-10-06 00:19:44 +11:00
Oliver Walters 66bdce3d04 Hide elements on the PartCategory page, based on permissions 2020-10-05 23:53:24 +11:00
Oliver Walters 4d49cb029f Change part views to require permissions
Also adds custom 403 page
2020-10-05 23:49:32 +11:00
OliverandGitHub 796e89c921 Merge pull request #1023 from SchrodingersGat/index-permissions
Change what elements the user can see on the index page
2020-10-05 23:19:13 +11:00
Oliver Walters 3e9c7cda21 Change what elements the user can see on the index page, based on permissions! 2020-10-05 23:11:55 +11:00
OliverandGitHub e5960f6ce4 Merge pull request #1022 from SchrodingersGat/permission-fixes
Fixes for role permissions
2020-10-05 23:04:50 +11:00
Oliver Walters 806a7f961d Fixes for role permissions
- Fixed a strange interaction if multiple rulesets referred to the same models
- Order of operations was incorrect.
- Now is good? Yes!
2020-10-05 22:57:05 +11:00
OliverandGitHub 731c796254 Merge pull request #1011 from SchrodingersGat/navbar-permissions
Hide main elements of navigation bar based on user permissions
2020-10-05 11:17:41 +11:00
OliverandGitHub dc41231fcc Merge pull request #1018 from SchrodingersGat/group-roles
Roles and Permissions
2020-10-05 11:16:52 +11:00
OliverandGitHub cc05220263 Merge pull request #1020 from SchrodingersGat/stock-building
Add "is_building" field to StockItem model
2020-10-05 10:08:40 +11:00
Oliver Walters 898c604b3b Fix incorrect permission names
- Uses the app_model name, *NOT* the name of the database table
- Adds extra tests to ensure that permissions get assigned and removed correctly
2020-10-05 08:55:15 +11:00
Oliver Walters 095ef51991 Cleanup unit testing 2020-10-05 08:29:36 +11:00
Oliver Walters bce7eb1aad update translation files 2020-10-05 01:02:36 +11:00
Oliver Walters 13cd8624b2 Fix permissions 2020-10-05 01:01:56 +11:00
Oliver Walters 48e050d317 Add some more unit tests and validation code for the StockItem model
- Ensure that the build part matches the stockitem part!
2020-10-05 00:49:00 +11:00
Oliver Walters 3ee7be1d58 Add "optional" field to BomItem
- Defaults to False
- Indicates that the BomItem is "optional" for a build
- Will be used in the future when calculating if a Build output is fully allocated!
2020-10-05 00:42:09 +11:00
Oliver Walters c1595396c4 Unit testing: fix PEP issues 2020-10-05 00:29:31 +11:00
Oliver Walters fe3a72c6cc Add some unit testing 2020-10-05 00:29:06 +11:00
Oliver Walters 26d113e8ad Update IN_STOCK_FILTER to reject stock items which have is_building set to True 2020-10-05 00:14:04 +11:00
Oliver Walters ee28b4eea5 Add "is_building" field to StockItem model
- This will be set to TRUE until a stock item has been completed
2020-10-05 00:12:42 +11:00
OliverandGitHub 7f3ce9b0b1 Merge pull request #1019 from SchrodingersGat/installed-stock-improvements
Improvements for the "Installed Items" tab for StockItem display
2020-10-05 00:09:23 +11:00
Oliver Walters 62734c4b72 Add a custom template for the install item form 2020-10-05 00:01:01 +11:00
Oliver Walters 3fe0886207 Remove a debug statement 2020-10-04 23:49:01 +11:00
Oliver Walters 852da6d696 Fix form validation 2020-10-04 23:48:15 +11:00
Oliver Walters 42a75a8238 Add hidden input to the InstallStockForm form
- keeps track of "part" object
- so we can filter the stock_items queryset if the form validation fails
- Is there a more djangonic way of doing this??
2020-10-04 23:45:52 +11:00
Oliver Walters 46f459b4c7 Better display of stock table 2020-10-04 23:34:02 +11:00