Oliver Walters
05333e7e7d
PEP fixes
2019-04-28 23:58:14 +10:00
Oliver Walters
87411293cf
docstring improvements
2019-04-28 23:57:29 +10:00
Oliver Walters
bc12af5994
Remove the 'supplier_part' field when first creating a Part object
...
- As the Part does not yet exist, there are no matching SupplierPart objects
2019-04-28 23:55:21 +10:00
Oliver Walters
4e3702384b
Limit SupplierPart option in Part edit form
...
- Only allow selection of SupplierPart that match the Part being edited
2019-04-28 23:50:35 +10:00
Oliver Walters
6612e91aec
Remove ability to delete part via API
2019-04-28 23:41:47 +10:00
Oliver Walters
73f672495d
Use API to mark part as active/inactive
2019-04-28 23:40:26 +10:00
Oliver Walters
492d705b39
Hide inactive parts in parts list
2019-04-28 23:22:54 +10:00
Oliver Walters
1a66a12d57
Enable Part API to filter by active status
2019-04-28 23:15:30 +10:00
Oliver Walters
495d414d54
Hide some options if a part is not active
2019-04-28 23:12:59 +10:00
Oliver Walters
260d890052
If a part is not active, display an INACTIVE Message on part page
2019-04-28 23:08:54 +10:00
Oliver Walters
c2a35b6656
Add 'active' field to Part model
2019-04-28 23:00:38 +10:00
Oliver Walters
ba49b080b0
Some small tweaks
2019-04-28 11:46:53 +10:00
Oliver
e5e6480099
Merge pull request #181 from SchrodingersGat/supplier-parts
...
Supplier parts
2019-04-28 11:28:32 +10:00
Oliver Walters
1171953e65
Limit SupplierPart options in CreateBomItem form
...
- If Part is selected, limit the options in supplier_part field
- Only allow supplier_parts which map back to the same part
2019-04-28 11:24:26 +10:00
Oliver Walters
a9fbbc3a37
Remove references to get_object_or_404
...
- Properly handle DoesNotExist errors
2019-04-28 11:09:19 +10:00
Oliver Walters
624c5094c5
Prevent editing of SupplierPart fields if initial values are provided
2019-04-28 10:57:32 +10:00
Oliver Walters
cd438f0569
Add generic method for retriving GET or POST params
2019-04-28 09:53:42 +10:00
Oliver Walters
e5fc43a00f
Fix improper references to template_name for ajax forms
...
- Should be ajax_template_name
2019-04-28 09:00:54 +10:00
Oliver Walters
9b77340782
Change field ordering for SupplierPart form
...
- Import fields first!
2019-04-28 08:55:29 +10:00
Oliver Walters
2108ee2eb7
Update makefile
2019-04-28 08:42:17 +10:00
Oliver Walters
d55ea1a982
PEP fixes
2019-04-28 01:09:48 +10:00
Oliver Walters
aa04941bf1
Add module-level docstrings for each app
2019-04-28 01:05:45 +10:00
Oliver Walters
ed3ae30248
Documentation for Part app
2019-04-27 22:18:07 +10:00
Oliver Walters
241f9783ad
Added further testing for Part/Bom API
2019-04-27 14:50:49 +10:00
Oliver Walters
95be2755f4
Adjust SupplierPart supplier foreignkey
...
- Limit choices to 'is_supplier'
2019-04-27 13:10:21 +10:00
Oliver
d70137dcbd
Merge pull request #167 from SchrodingersGat/api-tests
...
Api tests
2019-04-27 01:07:53 +10:00
Oliver Walters
f111a42058
Added API tests for Part API
...
- Uses DRF APITestCase class
2019-04-27 01:03:11 +10:00
Oliver
165264bd0e
Merge pull request #166 from SchrodingersGat/copy-button
...
Move 'duplicate' button to the Part options drop-down
2019-04-26 23:44:01 +10:00
Oliver Walters
69b34a0ff2
Move 'duplicate' button to the Part options drop-down
2019-04-26 23:39:33 +10:00
Oliver Walters
529beb3d58
Abstract DRF serializer validation
...
- Subclass InvenTree.InvenTreeModelSerializer
- Ensures model data is checked too (after serializer checks are performed)
2019-04-26 23:34:15 +10:00
Oliver Walters
e57a8cdcd1
Fix rendering of BOM table view
...
- Edit and delete rows now works
2019-04-26 23:32:22 +10:00
Oliver Walters
cec61655cf
Fix table rendering for 'used_in' view
2019-04-26 23:12:06 +10:00
Oliver Walters
dee10e4922
Fix rendering of part supplier table
2019-04-26 23:04:08 +10:00
Oliver Walters
accec07fe9
BOM serializer now validates against model
...
- Need to call instance.clean()
- https://stackoverflow.com/questions/40697648/django-dry-model-form-serializer-validation
2019-04-26 22:36:44 +10:00
Oliver Walters
da540e1b26
Improve BOM API endpoint
...
- Origin at /api/bom
- Add detail view
- Add create power to list view
2019-04-26 21:44:38 +10:00
Oliver Walters
4e3b8bdd92
Remove draft feature from Part RUD endpoint
2019-04-26 21:44:38 +10:00
Oliver Walters
6f7082a919
Peppy
2019-04-26 21:44:38 +10:00
Oliver Walters
9b4e86f36a
Add ability to create a new supplierpart from the API
2019-04-26 21:44:37 +10:00
Oliver Walters
907bccf748
Add SupplierPart detail API
...
- RUD view
2019-04-26 21:44:37 +10:00
Oliver Walters
5ee339bb27
Add 'delete' button for supplier parts
2019-04-26 21:44:37 +10:00
Oliver Walters
1112e5e3e2
PEP fixes
2019-04-25 18:50:22 +10:00
Oliver Walters
2ab8276672
better coverage for part/models
...
- Increase from 57% to 67%
2019-04-25 17:51:02 +10:00
Oliver Walters
f36f02b27f
Tests for stock app
...
- Increase coverage of Stock/models.py to 84%
2019-04-25 17:30:44 +10:00
Oliver Walters
7b68310d73
PEP fixes
2019-04-25 03:20:25 +10:00
Oliver Walters
e6617fef80
reverse URL lookup for BomItem and SupplierPart
...
- created empty test files
2019-04-25 01:05:08 +10:00
Oliver Walters
0bc5617825
Reverse url lookup for Part model
2019-04-25 01:00:01 +10:00
Oliver Walters
f9db3b680d
Reverse lookup for part category URL
...
- Added some test cases for PartCategory model
2019-04-25 00:28:40 +10:00
Oliver Walters
0cdf660a80
Merge remote-tracking branch 'inventree/master' into delete-old-forms
...
# Conflicts:
# InvenTree/part/views.py
2019-04-18 23:51:58 +10:00
Oliver Walters
456164f1d9
PEP fixes
2019-04-18 23:47:04 +10:00
Oliver Walters
4f51258cf8
Removed old forms in Part
2019-04-18 23:39:05 +10:00
Oliver Walters
8040ad8a6a
Add function to duplicate stock item
2019-04-18 23:28:46 +10:00
Oliver Walters
05beb26c82
Change form title if part is being copied
2019-04-18 23:22:58 +10:00
Oliver Walters
6de58edd41
Add button on part page to duplicate part
...
- Opens modal form
- Takes user to created page
2019-04-18 23:17:21 +10:00
Oliver Walters
deaaa48b7d
Add ability to 'copy' a part
...
- Launch a PartCreate form
- initialize form data with the existing part (if it exists!)
- use model_to_dict to pass data around
2019-04-18 23:12:29 +10:00
Oliver Walters
a0b6900eb8
Disable buttons that require row selection, until a selection has been made
...
- Stock table
2019-04-18 22:35:51 +10:00
Oliver Walters
5d887f3785
Remove 'simple-history'
...
- Might re-add it later on
2019-04-18 21:28:09 +10:00
Oliver Walters
18c48e9191
Split part details display into two columns
2019-04-18 08:33:25 +10:00
Oliver Walters
fd3f6ec21e
Add stock item filtering by sub-category
2019-04-18 08:33:12 +10:00
Oliver
6b05078fd2
Merge pull request #133 from SchrodingersGat/part-files
...
Part files
2019-04-18 00:23:09 +10:00
Oliver Walters
3bac4fc9ee
Added some pepper
2019-04-18 00:20:49 +10:00
Oliver Walters
e707eb3a2b
Provide download link for part attachments
...
- Better upload management for attachment files (separated based on part ID)
2019-04-18 00:14:53 +10:00
Oliver Walters
d9d4e0043a
Display list of part attachments
2019-04-18 00:01:19 +10:00
Oliver Walters
00199c26de
Add part attachments to the admin interface
2019-04-17 23:58:13 +10:00
Oliver Walters
cb7e98aa1c
Add extra BOM export format options
...
- Uses tablib (already used by django-import-export plugin)
- Needs cleanup but works well
- Problem exporting XLSX data (needs work!)
2019-04-17 23:52:15 +10:00
Oliver Walters
963883acd6
Consolidated function to adjust stock
...
- Add / remove / stocktake
- Handle forms and tables properly
2019-04-17 23:17:04 +10:00
Oliver Walters
ba1b8d9181
Created js function to load stock table
...
- Avoid duplication of code
2019-04-17 22:59:52 +10:00
Oliver Walters
b9b8b5ee12
Update model for StockItem
2019-04-17 18:34:21 +10:00
Oliver Walters
86c31e8c0d
Allow regex searching on part name
2019-04-17 08:19:40 +10:00
Oliver Walters
19a11eac1a
PEP fixes
2019-04-17 07:49:46 +10:00
Oliver Walters
52c3a63c61
Updated SupplierPriceBreak page
2019-04-17 00:48:01 +10:00
Oliver Walters
150bc1e674
Add API interface for SupplierPriceBreak
2019-04-17 00:35:49 +10:00
Oliver Walters
a3b544e2a4
typo fix
2019-04-17 00:21:11 +10:00
Oliver Walters
5cd837be07
Limit supplierpart part link to purchasable parts only
2019-04-17 00:14:22 +10:00
Oliver Walters
cd0b6a6511
Updated Supplier models
...
- Added cost calculation for supplier part
- Added more validators and help text
2019-04-17 00:09:39 +10:00
Oliver Walters
01bdf2f19b
PEP fixes
2019-04-16 22:32:43 +10:00
Oliver Walters
7eea9d1a20
Launch a modal to select BOM download format
...
- This will have to change! A client-side hack for now..
- Work out a better way to do this!
2019-04-16 21:46:12 +10:00
Oliver Walters
be60fbcc25
More cleanup for modal forms
...
- Require 'ajax_template_name' to be set or weird things happen!
2019-04-16 21:25:20 +10:00
Oliver Walters
c706f00733
Skeletong for exporting BOM in different formats
2019-04-16 14:22:27 +10:00
Oliver Walters
29f33a8eec
Move button locations into bootstrap-table headers
...
- part category
- stock location
- build list
- company list
- supplier part list
2019-04-16 11:46:07 +10:00
Oliver Walters
338a30b50e
API endpoint for build list
...
- Changed part/build table to bootstrap table (ajax)
2019-04-16 08:31:43 +10:00
Oliver Walters
94b280eed3
Move button groups into the table toolbar next to search box
...
- part stock list
- part bom list
2019-04-16 08:13:05 +10:00
Oliver Walters
a4467fee21
Remove bootstrap-editable
...
- Revert to using modal django forms
2019-04-16 07:53:30 +10:00
Oliver Walters
bafce641a7
Limit sub-part choices to consumable parts only
2019-04-16 01:45:16 +10:00
Oliver Walters
bad46f85f4
Edit / delete / add BOM items
...
- Remove x-editable inline editing
- Uses only bootstrap-table and modal forms
- Hide the 'part' field in the bom item edit
2019-04-16 01:41:01 +10:00
Oliver Walters
6e2b111b9c
Add 'consumable' field to Part
...
- Indicates that a part can be used to make other parts
- This is the inverse of 'buildable'
- Add this field to the serializer and edit forms
- Display parameter on part info page
- BOM edit window only requests sub-parts that are marked as 'consumable'
- Also added option to edit 'units' field for part
2019-04-16 00:01:52 +10:00
Oliver Walters
ca96c8e22b
Better query param parsing
2019-04-15 23:30:17 +10:00
Oliver Walters
3d9a1acc2e
Don't render full category information in part API
...
- Lots of data duplication!
- Just send the category ID (and the category name)
-
2019-04-15 22:52:53 +10:00
Oliver Walters
ac0b28a06c
Simplify part filtering
2019-04-15 22:39:28 +10:00
Oliver Walters
7e78f0aa67
Changed query param from '1' to 'True'
2019-04-15 22:36:50 +10:00
Oliver Walters
a5e3af97ed
Move table functionality to external script
2019-04-15 22:28:29 +10:00
Oliver Walters
b522ca5b29
Don't render editable items when ont in editing mode
2019-04-15 18:41:48 +10:00
Oliver Walters
ec98f7829e
Add context flag to enable editing mode
...
- pass ?edit=1 to the BOM
- Display page differently if in editing mode
-
2019-04-15 18:32:15 +10:00
Oliver Walters
e370cb8d3c
Add note field to BomItem serializer
2019-04-14 22:20:11 +10:00
Oliver Walters
d5186fc615
Add 'note' field to BOM item model
2019-04-14 18:26:11 +10:00
Oliver Walters
9e5eed5d5e
Move the export_bom function to the part model
2019-04-14 12:34:14 +10:00
Oliver Walters
b8e28c003d
Provide download link to export BOM file
...
- Helper function for generating temporary file (in memory) for exporting
2019-04-14 12:34:14 +10:00
Oliver Walters
b58c49e066
Create BOM export form
...
- Select output format
2019-04-14 12:34:13 +10:00
Oliver Walters
14de111130
Allow better passthrough of context variables for non-form views
2019-04-14 12:34:13 +10:00
Oliver Walters
0cc59540ef
Generate modal form to export BOM
...
- Doesn't do anything yet
- Extends AjaxView
2019-04-14 12:34:13 +10:00
Oliver Walters
2202dfd55d
Peppy fixes
2019-04-14 12:30:06 +10:00
Oliver Walters
00c21d521e
Always display category
...
- Display full category path
2019-04-14 12:25:21 +10:00
Oliver Walters
9d98c429d6
Complex filtering for parts
...
- Allow filtering against child categories
- Could potentially be slooow
2019-04-14 11:59:07 +10:00
Oliver Walters
cf374252c1
PEP fixes for /part
2019-04-14 09:25:46 +10:00
Oliver Walters
2d21bf0626
Part BOM list now shows how many of each sub-item are available
...
- If there are enough to build the available quantity is shown in green
- Otherwise, shown in orange
2019-04-12 22:09:50 +10:00
Oliver Walters
8a3706dd76
Added MPN field to supplier part lists
2019-04-12 21:54:53 +10:00
Oliver Walters
25f1d643b8
Add indicator to show no stock in part listing
2019-04-12 21:21:50 +10:00
Oliver Walters
c67dc6f56e
Initial updates required to run under django 2.2
...
- Change to middleware.py
- Change some URLs formatting
- Fix django version at 2.2
2019-04-12 20:44:22 +10:00
Oliver
7644617af0
Better string formatting for models
...
Allows for easier searching in drop-downs for ForeignKeys
2018-05-09 00:17:39 +10:00
Oliver
2c953c73fa
Stock tracking tweaks
...
- Ability to stocktake for entire part
- Enforce addition of notes to stockAdjust modal
2018-05-09 00:06:35 +10:00
Oliver
47aa3c8a45
Login / Logout views
...
Information found here - https://simpleisbetterthancomplex.com/tutorial/2016/06/27/how-to-use-djangos-built-in-login-system.html
2018-05-08 23:00:27 +10:00
Oliver
002c047105
Added count/add/remove to Part Stock Detail Page
2018-05-08 22:14:18 +10:00
Oliver
3b6ef3f008
Added stocktake / add / remove actions to StockItemDetail page
2018-05-08 22:14:03 +10:00
Oliver
3f1c6e2059
Simplified modal calls
...
- Default modal target supplied (can be overridden in options)
2018-05-08 19:55:39 +10:00
Oliver
c5155d5ac7
Move modal JS file
...
- Loaded by base.
2018-05-08 19:40:29 +10:00
Oliver
fdf214626c
Further assorted updates
...
What, you need more commit details?! Pah
2018-05-07 23:40:17 +10:00
Oliver
425db5fd39
Tweaked part stock page
2018-05-07 21:51:08 +10:00
Oliver
deccdce6d9
Part view updates
2018-05-07 08:41:19 +10:00
Oliver
a7abf9731b
Add link to stock-item in part-stock view
2018-05-06 22:28:50 +10:00
Oliver
c1e7e95fc0
UI improvements
...
Consolidated detail pages with OPTIONS drown down
(rather than multiple single buttons)
2018-05-06 22:09:15 +10:00
Oliver
366e03456e
Hide 'tracking' tab for now
2018-05-06 19:27:34 +10:00
Oliver
19ce05931c
Re-added missing "New Part" button
2018-05-06 19:21:33 +10:00
James Newlands
01da57f0cf
If part has no category, page rendered an extra curly brace in JS that caused syntax error.
2018-05-05 21:22:47 +10:00
Oliver
41e031d4b4
Draft API endpoint RUD class
...
- RUD = Retrieve / Update / Destroy
- When issuing an Update command, the validity is checked but the model object is only saved if the POST data has "_is_final": true
2018-05-05 01:26:01 +10:00
Oliver
7e4b0630b6
Part category API
2018-05-04 23:54:57 +10:00
Oliver
4f63d12837
Consolidated 'Part' app views
...
- Improved templating
- Part tree open/close status stored to session
2018-05-04 18:55:55 +10:00
Oliver
389908c67a
Moved sidenav into block
2018-05-04 17:51:55 +10:00
Oliver
bc716e25f7
Fixed bugs in Inventree/views.py
...
- Need to pass request.FILES to the form! (duh!)
- Prevent form data from being saved twice
2018-05-03 23:40:27 +10:00
Oliver
68cf6919a7
Updated part views
...
- Allocation table now uses bootstrap-table
- Added checkbox column to supplier table (no function yet)
2018-05-03 23:39:08 +10:00
Oliver
f995f54390
More API / JSON stuff
...
- SupplierPart JSON API
- Part supplier list
- Company part list
2018-05-03 00:47:03 +10:00
Oliver
49287c0c61
Part 'used-in' view now uses API
...
- Ajax calls to JSON API
- BootstrapTable
2018-05-03 00:25:01 +10:00
Oliver
0f3150c705
Part stock table now uses API / BootstrapTable
2018-05-02 23:54:28 +10:00
Oliver
1d63147380
Reload BOM table without refreshing enitre page
2018-05-02 23:46:08 +10:00
Oliver
7d21c4ef1c
BOM now uses DRF / ajax
2018-05-02 23:42:57 +10:00
Oliver
be0797c6e6
Bootstrap table to company list
2018-05-02 23:17:24 +10:00
Oliver
1899d8f3e9
Stock location part list now uses bootstrap table
...
- Serializers within serializers!
2018-05-02 23:08:45 +10:00
Oliver
211edb23bb
Removed footable
...
- Now using bootstrap-table
2018-05-02 22:22:43 +10:00
Oliver
024fe04e0e
Implemented bootstrap-table for parts list
2018-05-02 22:18:58 +10:00
Oliver
45510b1adc
Add category info to part serializer
2018-05-02 20:57:04 +10:00
8cfbf2657e
Removed unused maths tag
2018-05-01 10:03:20 +10:00
Oliver
a2ff1d16f3
Introspection of build allocation
...
Yay for dicts
2018-04-30 22:45:11 +10:00
Oliver
b24ddac0b8
Part stuff
2018-04-30 22:30:15 +10:00
Oliver
f988c9af87
Tweaks for part page(s)
2018-04-30 01:16:57 +10:00
Oliver
bee760d184
Deleted extraneous form code
2018-04-30 00:59:36 +10:00
Oliver
5c902397e3
CSS fixes for .notificaiton-area and .alert
2018-04-30 00:29:39 +10:00
Oliver
a9c20f5d95
Added modal form success messages
...
- More to be done, just a start
- Create / edit / delete
2018-04-30 00:23:02 +10:00
Oliver
46dea22cd4
Simplified part stock display
2018-04-29 22:07:58 +10:00
Oliver
feb45513f7
Prevent serial number for stock item with quantity > 1
2018-04-29 13:20:02 +10:00
Oliver
9ea3d7bf71
Build tab shows active builds
2018-04-29 13:11:31 +10:00
Oliver
aca0d236ee
Javascript consolidation
2018-04-29 12:25:07 +10:00
Oliver
8d0789c37c
Implemented tree view
...
Using library bootstrap-treeview
- part category tree
- stock location tree
- Currenly is functional but looks terrible
2018-04-28 23:22:12 +10:00