Commit Graph

506 Commits

Author SHA1 Message Date
Oliver Walters
20755a6dac Rendering of decimal value on stockitem page 2019-11-19 09:10:47 +11:00
Oliver Walters
6e90ac367e Massaging unit tests
- Decimal fields are useful but VERY ANNOYING to use
- Needed to fix some test cases
2019-11-19 08:59:56 +11:00
Oliver Walters
400941c10f Change item quantity field from PositiveInteger to Decimal
- Allow 'partial' quantity e.g. '0.45kg'
- Need to change some maths functions as Decimal type is pernickity
2019-11-19 08:49:54 +11:00
Oliver Walters
81a226c760 Added translation strings for stock.models 2019-11-19 08:46:25 +11:00
Oliver Walters
16f3dfb678 Removed old migration file 2019-11-16 20:39:10 +11:00
Oliver Walters
b7473be8ef Update stock adjustment dialog 2019-11-16 20:29:05 +11:00
Oliver Walters
2261973331 Ability to delete multiple stock items 2019-11-16 20:19:10 +11:00
Oliver Walters
789515e39d Add translations for the StockItem detail page 2019-11-16 20:14:08 +11:00
Oliver Walters
0effb584b9 Remove 'active' field
- Will work this change in at a later date
2019-11-16 20:13:51 +11:00
Oliver Walters
339126b27a Add new field "active" to StockItem model
- True by default
- Set to 'false' to mark a stockitem as 'deleted'
2019-11-16 19:41:36 +11:00
Oliver Walters
3e2a5263a5 Add stock information for top-level stock page 2019-09-27 09:59:14 +10:00
Oliver Walters
7c1615a2b6 Fix user recording when serializing stock 2019-09-24 07:59:59 +10:00
Oliver Walters
41c07fc423 Save user who created a stock item
- Handled differently for batch or serialized parts
2019-09-24 07:54:18 +10:00
Oliver Walters
6f54091354 Improve display of stock location 2019-09-20 00:03:59 +10:00
Oliver Walters
b3ea2bfb9a Update badges 2019-09-19 23:38:15 +10:00
Oliver Walters
3c98cd87a7 Use localStorage rather than sessionStorage for storing user prefs
- Also create some helper functions
2019-09-19 23:29:03 +10:00
Oliver Walters
cb77506111 Simplify 2019-09-17 20:19:05 +10:00
Oliver Walters
4a0be0dfb8 Simplify 2019-09-17 20:15:50 +10:00
Oliver Walters
194ae49914 Export full_name for parts 2019-09-15 22:23:34 +10:00
Oliver Walters
204cd967aa Include status label text when exporting stocktake data 2019-09-15 20:14:27 +10:00
Oliver Walters
03043e67c7 Perform full validation when importing data 2019-09-15 19:58:05 +10:00
Oliver Walters
9c84e9076f Consolidate stock export code
- Now defined in stock.admin as StockItemResource
- Much more control over format of exported data
- Exported data can be re-imported!
2019-09-15 19:29:18 +10:00
Oliver Walters
70e07470db Custom URL validators for more fields 2019-09-14 00:08:49 +10:00
Oliver Walters
8578a3b8d1 Add searching to other admin views 2019-09-13 23:32:49 +10:00
Oliver Walters
cb5db332d3 Manager for import/export of StockItem data 2019-09-13 23:00:21 +10:00
Oliver Walters
23b814569a Manager for importing StockLocation data 2019-09-13 22:44:50 +10:00
Oliver Walters
53c5324df6 Fix uniqueness test for stock item 2019-09-09 08:49:27 +10:00
Oliver Walters
108382cc89 Prefecth related data for stock export
- Example export reduced from 1,024 queries to 7
2019-09-09 08:17:26 +10:00
Oliver Walters
11c946be4d Export human-readable status code 2019-09-09 00:02:08 +10:00
Oliver Walters
231a669fe5 Export stock based on supplier 2019-09-08 23:53:09 +10:00
Oliver Walters
3d5542181a Move "Export" button onto stock table 2019-09-08 23:40:51 +10:00
Oliver Walters
8817b4d692 Icer button rendering for PurchaseOrder page 2019-09-08 23:27:54 +10:00
Oliver Walters
9212d6047f Add supplier information to exported data 2019-09-08 23:10:13 +10:00
Oliver Walters
cc452bc270 Export stock data 2019-09-08 23:01:16 +10:00
Oliver Walters
faf8b9f2f0 Form / view for downloading stocktake info 2019-09-08 22:37:27 +10:00
Oliver Walters
f4e71d6055 Add a buttony-boy
(cherry picked from commit 69ac5d870a2f1bc9589cd9b23212d3b51cf92c80)
2019-09-08 20:55:19 +10:00
Oliver Walters
2c969ef1c6 View for exporting stocktake / stock list
(cherry picked from commit bdad2d6178a14322ef225d08b13db86b6d7d0909)
2019-09-08 20:55:06 +10:00
Oliver Walters
dac61eafa2 Fixed tests
- Tree classes now need extra configuration in the fixture
- Check for null pk when cleaning a tree node
2019-09-08 19:41:54 +10:00
Oliver Walters
0d6a3d3b28 BOM table now refreshes the table rather than the page 2019-09-08 19:24:47 +10:00
Oliver Walters
b554af5f10 Fix display of location list 2019-09-08 19:21:40 +10:00
Oliver Walters
3eb3c43e5c Change foreign keys to TreeForeignKey 2019-09-08 19:19:39 +10:00
Oliver Walters
678157aac4 Update StockLocation and PartCategory models
- Use the MPTT functionality once more
2019-09-08 19:13:13 +10:00
Oliver Walters
2f11fccb73 Migrate InvenTreeTree to using MPTT model 2019-09-08 14:08:49 +10:00
Oliver Walters
023c386f5e Display a warning message if delete_on_deplete is set 2019-09-07 21:18:32 +10:00
Oliver Walters
b4bbd43bae Fix 404 if a stock item is completely depleted 2019-09-07 21:15:14 +10:00
Oliver Walters
7fd4359007 Add new option to move-stock form
- Set the destination as the default location for parts being moved
2019-09-05 19:59:00 +10:00
Oliver Walters
906766cc0e Bug fix - ensure pk is set to None 2019-09-01 23:28:28 +10:00
Oliver Walters
7db938eda0 Show the build item on the stock-item page (if applicable) 2019-09-01 23:24:27 +10:00
Oliver Walters
3cef5c93ce Improve stock item splitting 2019-09-01 23:18:08 +10:00
Oliver Walters
90a342fad8 Add a reference to a build for a stock item 2019-09-01 23:09:40 +10:00
Oliver Walters
094e8cdc23 PEP 2019-08-30 00:15:16 +10:00
Oliver Walters
891f4f9f17 Another test 2019-08-30 00:14:54 +10:00
Oliver Walters
6f8c3454f3 Tests for stock serialization form 2019-08-30 00:06:46 +10:00
Oliver Walters
34bfdea4b5 Test another invalid serialization 2019-08-29 23:50:33 +10:00
Oliver Walters
0fba236eef Stock locations are now persistent 2019-08-29 15:52:32 +10:00
Oliver Walters
937bcd41d6 Fix tests for stock serialization 2019-08-29 07:37:44 +10:00
Oliver Walters
4db345d0c2 Perfom serialization 2019-08-28 22:47:46 +10:00
Oliver Walters
76ec44d770 Form improvements 2019-08-28 22:04:04 +10:00
Oliver Walters
6c5b09efd4 Provide initial data 2019-08-28 21:50:44 +10:00
Oliver Walters
7575a39b7f Add form / view for serializing a stock item
- Back end doesn't do anything yet
2019-08-28 21:46:26 +10:00
Oliver Walters
3b8f5872ac Add button to serialize stock 2019-08-28 21:21:26 +10:00
Oliver Walters
43967e302b Add ablity to serialize an existing quantity of stock
- Do not have to serialize all the stock
- Add tests
- Add function to copy entire stock transaction history
2019-08-28 21:12:16 +10:00
Oliver Walters
bc03ae53bd Changes for clean of StockItem 2019-08-28 20:01:38 +10:00
Oliver Walters
88b90281f5 Do not enforce serialization when creating a stock item 2019-08-28 19:56:35 +10:00
Oliver Walters
c81f8e6d87 Add 'new supplier part' button to stock item creation form 2019-08-15 13:17:33 +10:00
Oliver Walters
f9fa16a397 Fix remove-row button in stock-adjust form 2019-08-14 13:29:51 +10:00
Oliver Walters
a36d99b3e7 PEP fixes 2019-08-09 20:14:47 +10:00
Oliver Walters
bd61c89094 Tests for stock app views 2019-08-09 20:13:23 +10:00
Oliver Walters
c8bf20ad41 Add part hover image 2019-07-25 11:08:22 +10:00
Oliver Walters
fe7392f152 Prevent stock adjustments for serialized stock items 2019-07-25 11:05:09 +10:00
Oliver Walters
94c0102742 Improve validation logic for StockItem
- Allow tracked items to exist without a serial number (e.g. non-serialized tracked items)
2019-07-25 11:04:45 +10:00
Oliver Walters
42e1370e92 Bug fix 2019-07-25 10:36:59 +10:00
Oliver Walters
3058b895dd Prevent auto-delete of stock items which have a serial number 2019-07-24 20:24:12 +10:00
Oliver Walters
33fe4d186d Include more fields when splitting stock 2019-07-24 19:48:37 +10:00
Oliver Walters
a42371598c Fix part deletion template
- Display list of stock items which will be thusly deleted
2019-07-23 11:55:51 +10:00
Oliver Walters
b546b5e0cc Create separate entries for each unique serial number 2019-07-23 11:45:03 +10:00
Oliver Walters
d82d8f5cd1 Re-implement item saving for non-tracked parts 2019-07-23 11:31:29 +10:00
Oliver Walters
9e5eadd6c3 Set serial numbers when creating a new stock item 2019-07-23 10:31:34 +10:00
Oliver Walters
23d03d6b9b Build completion now handles unique serial numbers
Provide a method to test if a serial number matches for a given part
2019-07-22 15:55:36 +10:00
Oliver Walters
8ca14efa53 Delete stock tracking entries 2019-07-22 10:46:42 +10:00
Oliver Walters
c27e8e809a Endpoint for editing a stock tracking entry 2019-07-18 08:55:57 +10:00
Oliver Walters
bb799d98be Add ability to create new stock tracking note for a stock item 2019-07-16 00:10:24 +10:00
Oliver Walters
310d4b5f07 Added descriptive help text 2019-07-15 23:53:25 +10:00
Oliver Walters
d800ed715e Add (optional) URL to stock tracking info 2019-07-15 22:33:00 +10:00
Oliver Walters
c9bee19b8a Remove thingy 2019-07-15 19:26:41 +10:00
Oliver Walters
23d19d6784 Remove old debug messages 2019-07-11 23:07:52 +10:00
Oliver
1f9e6f4a68
Merge pull request #411 from SchrodingersGat/bom-upload
BOM upload
2019-07-10 15:17:58 +10:00
Oliver Walters
20ec36d3ea Enforce authentication for API access 2019-07-08 19:20:00 +10:00
Oliver Walters
b185abbb87 Catch case in which a request.GET is not available
(cherry picked from commit 9296c0ba0f8c4914cd04b820c6172f8c3a794750)
2019-07-08 09:41:20 +10:00
Oliver Walters
047d2f2f4c Include part revision in stock API / table 2019-06-28 09:35:29 +10:00
Oliver Walters
d6fcf85cd2 Set part category for multiple parts at once 2019-06-25 19:15:39 +10:00
Oliver Walters
d5119e1aff Replace some cog icons 2019-06-20 21:28:00 +10:00
Oliver Walters
1fc39d56df Add 'new stock location' button to top-level locatino 2019-06-19 18:50:05 +10:00
Oliver Walters
fefbcf2ed9 Clean up buttons for stock location 2019-06-19 18:49:05 +10:00
Oliver Walters
c0e66dd9a0 Added pretty buttons to stock item page 2019-06-18 23:56:00 +10:00
Oliver Walters
16b6ae8d61 Fixed up some stupid recursion on the Tree model template 2019-06-18 00:59:54 +10:00
Oliver Walters
642660d76e Improved speed of stock tree 2019-06-18 00:09:42 +10:00
Oliver Walters
3405fb93a9 Peppy fixes 2019-06-15 19:42:09 +10:00
Oliver Walters
1290e7f289 Implement POST for receiving items
- Create new StockItem in the correct location
2019-06-15 19:39:57 +10:00
Oliver Walters
ff6df9741f Perform model validation on API serializers
If you have a class, why not subclass it?!
2019-06-13 23:03:58 +10:00
Oliver Walters
222c9f1876 Allow quantity editing via /api/stock/ endpoint
- Allows creation of a new StockItem with a specified quantity
2019-06-13 22:58:02 +10:00
Oliver Walters
f731c45ce8 Replace other choice fields with commonized status code 2019-06-04 23:38:52 +10:00
Oliver Walters
782ad57f52 Re-enable image hovering where appropriate 2019-06-03 22:03:22 +10:00
Oliver Walters
7a3b186a0c Fix double loading of modals.html 2019-06-03 21:51:59 +10:00
Oliver Walters
ba26acd487 Rename some fields
- Oops didn't think that through, gotta go through and fix the data now...
2019-06-02 19:46:30 +10:00
Oliver Walters
fd2e2a71f9 Add search results for part-category and stock-location 2019-06-02 19:15:05 +10:00
Oliver Walters
6e7f354a23 Add a 'LOST' status code for stockitem 2019-06-02 13:53:54 +10:00
Oliver Walters
013a85e6f7 Better dispaly of stock status
- Send status text in JSON
- Only display status if it is not "OK"
2019-06-02 13:53:11 +10:00
Oliver Walters
6982b2f0c2 Making PEP happy 2019-06-02 12:47:40 +10:00
Oliver Walters
802ff35cf3 Remove some now unused forms / views / etc 2019-06-02 12:45:44 +10:00
Oliver Walters
2ee35ec062 Stock counting now works 2019-06-02 12:20:26 +10:00
Oliver Walters
d365d7cc44 remove from stock now works 2019-06-02 12:15:44 +10:00
Oliver Walters
1b3ffada6d Add-stock is now working 2019-06-02 12:13:22 +10:00
Oliver Walters
8dd9034563 Remove 'destination' field if we are not moving stock
- Allow different stock adjustment actions
2019-06-02 12:00:39 +10:00
Oliver Walters
d1ff115f74 Simplifiy js and improve template / form 2019-06-02 11:47:21 +10:00
Oliver Walters
c7503b4f9f Consolidated form/view into single 'stock-adjust' endpoint 2019-06-02 11:37:04 +10:00
Oliver Walters
fe31205017 Stock movement now works! 2019-06-02 11:27:03 +10:00
Oliver Walters
0b54baf6db POST the stock adjustment method back as a hidden form input 2019-06-02 11:15:12 +10:00
Oliver Walters
1b7762470d catch a ValueError 2019-06-02 11:14:56 +10:00
Oliver Walters
96f6f6068e Return message on succses 2019-06-02 11:05:40 +10:00
Oliver Walters
20963f83d9 Better error reporting for quantity 2019-06-02 11:00:28 +10:00
Oliver Walters
c228a4998c Extract stock items from POST and return to form 2019-06-02 10:25:19 +10:00
Oliver Walters
e278bdbb90 Improve filtering for stock items 2019-06-02 09:14:45 +10:00
Oliver Walters
011f5a5efd Delete rows interactively from stock adjustment form 2019-06-01 22:04:03 +10:00
Oliver Walters
6a04c8cbd3 Update stock_move form template 2019-06-01 21:16:59 +10:00
Oliver Walters
3869bc27c9 Whoops, that form was being used.
Created a copy of the form for multiple-item-stock-movements
2019-05-30 09:01:16 +10:00
Oliver Walters
d321947026 Add stock item fields for each item passed to the form 2019-05-29 22:38:42 +10:00
Oliver Walters
0e3f74ef31 Pass list of selected stock items to the view 2019-05-29 22:24:22 +10:00
Oliver Walters
0ce6c5f7d5 Redirect non-ajax forms to / 2019-05-29 22:24:17 +10:00
Oliver Walters
2b4cb4d3e0 Beginning to move the stocktake forms server side 2019-05-29 22:24:11 +10:00
Oliver Walters
6a30485a4e Initial work toward fixing stock issues 2019-05-29 01:03:21 +10:00
Oliver Walters
1232a6cf17 PEP fixes 2019-05-28 22:01:52 +10:00
Oliver Walters
8c583750a2 Update the stock list API
- Custom data serialization is MUCH faster (~400ms compared to 3s)
- Cache location queries
- Flatten related field data
- Update stock table javascript to match
2019-05-28 21:45:27 +10:00
Oliver Walters
4218cf8b45 Client-side grouping
- Cusomizations made to bootstrap-table-group-by.js
- Group by part name
- Display total stock count per group
- Only group if there are more than 1 item in the group
- Groups send checkbox signals through appropriately!
2019-05-28 17:21:29 +10:00
Oliver Walters
64403f824a And deltaco some code that went along with it 2019-05-27 22:46:17 +10:00
Oliver Walters
7de4ee80f1 Deltaco some dead code 2019-05-27 22:44:38 +10:00
Oliver Walters
5a9c19492b Design an aggregation filter for stock items
- If 'aggregate=1' is sent to the stock API, aggregate the returned stock items by part and location
- Suprisingly this actually works right out of the gate
2019-05-27 22:44:13 +10:00
Oliver Walters
f3b17b2164 Add some form fields (might have to remove later) 2019-05-26 00:32:18 +10:00
Oliver Walters
6603d6e9ed PEP fixes 2019-05-26 00:22:05 +10:00
Oliver Walters
c45a506a10 Rename field part.has_variants to part.is_template 2019-05-25 23:58:31 +10:00
Oliver Walters
75d38489d7 Add ability to filter stock by variants for a templated part 2019-05-25 23:26:46 +10:00
Oliver Walters
d70110690b Validate uniqueness for StockItems
- If the Part is a variant of a template, ensure that the serial numbers are unique across all instances of the template
- Prevent instantiation of a StockItem for a part which has variants
2019-05-25 23:09:04 +10:00
Oliver Walters
1a2fb9e170 Add 'has_variants' and 'variant_of' field for Part
- StockItem cannot point to a part which is a template part
2019-05-25 22:27:36 +10:00
Oliver Walters
5664fc5472 Detail in StockItem API now optional 2019-05-23 22:57:45 +10:00
Oliver Walters
18ff80312b Fixes 2019-05-20 22:53:01 +10:00
Oliver Walters
4bde00d925 AND AGAIN
Use --fake to force the migration
2019-05-20 22:24:18 +10:00
Oliver Walters
70be052c74 Rebuilt migrations again (arrrrrrrrrrrrrrrrrrrrrrrrrrgh never do this) 2019-05-20 21:45:37 +10:00
Oliver Walters
fc75ab7420 Reduce response time for stock list
Initial time - 6.2s
After prefetch - 4.3s
2019-05-20 08:44:52 +10:00
Oliver Walters
9ddedc6915 Restart migrations
- Easier to delete all the migrations and start again :'(
2019-05-19 00:11:41 +10:00
Oliver Walters
a8846dc515 Hopefully fix the thingy 2019-05-18 23:52:22 +10:00