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
219c438b82
Part name uniqueness is case insensitive
2019-06-02 20:37:59 +10:00
Oliver Walters
64d541f453
Hide result types which return no results
2019-06-02 20:28:17 +10:00
Oliver Walters
0b88953706
Form field rearrangement
2019-06-02 20:07:30 +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
3427f81a34
Improve part information display
...
- Better terminology
2019-06-02 14:47:40 +10:00
Oliver Walters
8214aef0db
Add template for hover_image
2019-06-01 21:13:51 +10:00
Oliver Walters
7ac52d4d9f
Optionally select which column gets grouped
...
- Allow grouping by numerical values
2019-05-28 19:12:10 +10:00
Oliver Walters
4d518f4512
PEP
2019-05-26 16:05:54 +10:00
Oliver Walters
8715e29c31
Add ability to make variant from template
2019-05-26 16:00:27 +10:00
Oliver Walters
91a5a7f051
Simplify part model
...
- Remove 'varian't or ''revision' field
- Part name must be unique across database
2019-05-26 12:16:57 +10:00
Oliver Walters
1312148721
Filter parts by template or variant status (in API)
2019-05-26 11:15:41 +10:00
Oliver Walters
41eb195940
Thanks, PEP
2019-05-26 00:42:40 +10:00
Oliver Walters
e5bb6284db
Add variant-of to part detail view
2019-05-26 00:41:24 +10:00
Oliver Walters
2138977b07
Include template attachments in attachment count
2019-05-26 00:39:36 +10:00
Oliver Walters
d563e873ed
Change some icons
2019-05-26 00:35:52 +10:00
Oliver Walters
f3b17b2164
Add some form fields (might have to remove later)
2019-05-26 00:32:18 +10:00
Oliver Walters
21dd893c01
Display templated parts as italic in the part list
2019-05-26 00:29:17 +10:00
Oliver Walters
75b21bdd8f
Visual tweaks
2019-05-26 00:20:03 +10:00
Oliver Walters
7881a67db4
Calculate stock based on variant stock if part is a template
2019-05-26 00:01:01 +10:00
Oliver Walters
c45a506a10
Rename field part.has_variants to part.is_template
2019-05-25 23:58:31 +10:00
Oliver Walters
9c1c008f33
Show attachments for the Template part under attachments tab
2019-05-25 23:50:24 +10:00
Oliver Walters
08ac7e2a36
Rendering tweaks
2019-05-25 23:45:26 +10:00
Oliver Walters
3d57483f0e
Add a 'new varian't button
2019-05-25 23:43:06 +10:00
Oliver Walters
bbe66472ee
Display list of part variants
2019-05-25 23:40:59 +10:00
Oliver Walters
39c4611598
Add a tab for part variants
2019-05-25 23:31:23 +10:00
Oliver Walters
0e684071fa
Display message if a part is a template or a variant
2019-05-25 23:21:38 +10:00
Oliver Walters
bc778c1451
Prevent a Part from both having variants and being a variant of something else
2019-05-25 22:43:47 +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
ecfde46838
Fix error in BomItem creation
2019-05-25 21:57:59 +10:00
Oliver
aeaf4e7dc9
Merge pull request #363 from SchrodingersGat/rest-simplify
...
Rest simplify
2019-05-23 23:03:39 +10:00
Oliver Walters
c2ca5a24f8
PEP
2019-05-23 22:59:56 +10:00
Oliver Walters
5664fc5472
Detail in StockItem API now optional
2019-05-23 22:57:45 +10:00
Oliver Walters
9052ccc181
Make 'part_detail' field in SupplierPart serializer optional
2019-05-23 22:44:37 +10:00
Oliver Walters
cf5b8d0249
Optional part_detail and sub_part_detail for BOM API
...
- Significant speed boost on request
- Request the relevent information at the right place
2019-05-23 22:36:19 +10:00
Oliver Walters
d386c2a6f9
Include total stock in PartBrief serializer
2019-05-23 21:51:27 +10:00
Oliver Walters
27f956bffa
Part detail rendering improvements
2019-05-22 23:27:43 +10:00
Oliver Walters
cd7bc6cce5
Include pricing information in part supplier view
...
Also some CSS tweaks to secondary modal buttons
2019-05-22 22:11:27 +10:00
Oliver Walters
d3a5661dbd
Serializer fix
2019-05-21 15:42:52 +10:00
Oliver Walters
d1dfad591d
Pepperoni
2019-05-21 15:38:22 +10:00
Oliver Walters
988a35d237
Serialize BOMItem pricing information
...
- Account for quantity
- Prefetch required items
2019-05-21 15:15:54 +10:00
Oliver Walters
2817e6ca31
Added further part pricing
2019-05-21 14:08:40 +10:00
Oliver Walters
9d5b938ced
Don't serialize 'available_stock' in PartSerializer
2019-05-21 07:57:44 +10:00
Oliver Walters
ca9d6e6e25
PEP fixes
2019-05-21 00:54:48 +10:00
Oliver Walters
49ed17db56
Add a line
2019-05-21 00:52:17 +10:00
Oliver Walters
4b41766312
And mode
2019-05-21 00:31:34 +10:00
Oliver Walters
72aba30e81
More hungry fetching
2019-05-21 00:16:00 +10:00
Oliver Walters
157919f47a
More prefetching
...
-
2019-05-21 00:06:57 +10:00
Oliver Walters
6ae48d07c4
Cleanup pricing algorithms
2019-05-20 23:53:39 +10:00
Oliver Walters
8adb4f6c20
Further query reduction
...
- Also improved query reporting middleware
2019-05-20 23:26:27 +10:00
Oliver Walters
d15b09a5f4
Don't serialize pricing
...
- Saves MANY queries and provides drastic speedup
2019-05-20 23:03:19 +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
ee2ddbf512
Reduce some database queries by using aggregate Sum
2019-05-20 21:47:30 +10:00
Oliver Walters
70be052c74
Rebuilt migrations again (arrrrrrrrrrrrrrrrrrrrrrrrrrgh never do this)
2019-05-20 21:45:37 +10:00
Oliver Walters
34620b22b0
Add a middleware to count queries
...
- https://www.dabapps.com/blog/logging-sql-queries-django-13/
2019-05-20 18:51:57 +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
5055226490
Reduce BOM listing time to ~1.8s
2019-05-20 08:31:03 +10:00
Oliver Walters
cee1062b51
Prefetch locations - 2.6s
...
However the 'total_stock' and 'available_stock' fields are still the majority of the response time
2019-05-20 08:24:05 +10:00
Oliver Walters
6766063c8b
Reducing request time for PartList API
...
- Initial query time = 5.91s
- Prefetch related part categories = 3.64s
2019-05-20 08:13:22 +10:00
Oliver Walters
73041a3fe6
Fix div-by-zero for part pricing
2019-05-20 07:53:23 +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
a54760b219
Improve pricing display
2019-05-18 23:44:43 +10:00
Oliver Walters
ffda5a1b29
Add warning if no pricing data available
2019-05-18 23:13:18 +10:00
Oliver Walters
368193d397
Fix formatting
2019-05-18 23:09:12 +10:00
Oliver Walters
dcf79338c1
Add pop-up pricing window for part
...
- Cost to purchase from suppliers
- Cost to build from BOM
2019-05-18 23:09:08 +10:00
Oliver Walters
54ccf6c7b3
PEP
2019-05-18 23:09:04 +10:00
Oliver Walters
b64a29b897
Display build pricing information
2019-05-18 23:09:00 +10:00
Oliver Walters
2b098942b0
Fix pricing bug
...
- Include BOM item pricing in API
2019-05-18 23:08:56 +10:00
Oliver Walters
2a1fd2b03b
More complex pricing calculations
...
- Calculate BOM price for a part
- Calculate total pricing for a part (build or purchase)
- Display pricing information in BOM table
2019-05-18 23:08:51 +10:00
Oliver Walters
cdc55bb5d3
PEP fixes
2019-05-18 23:08:42 +10:00
Oliver Walters
a3d1591929
Display part pricing in Part view
...
- Calculate min_price and max_price based on provided supplier information
2019-05-18 23:08:38 +10:00
Oliver Walters
0cfb243eb3
Move SupplierPart and SupplierPriceBreak to the 'Company' app
...
- https://docs.djangoproject.com/en/2.2/ref/models/options/#django.db.models.Options.db_table
- https://stackoverflow.com/questions/3519143/django-how-to-specify-a-database-for-a-model
- And others, presumably
2019-05-18 23:08:34 +10:00
Oliver Walters
5043c354b1
Set default value for SupplierPriceBreak
...
Edit or Delete a SupplierPriceBreak
2019-05-18 23:08:30 +10:00
Oliver Walters
fc3072a459
Form for creating a new price break for a supplier part
2019-05-18 23:08:25 +10:00
Oliver Walters
1163f60b23
Return price breaks in the correct order
2019-05-18 23:08:21 +10:00
Oliver Walters
a3cd54875c
Update validator for supplier price break
2019-05-18 23:08:17 +10:00
Oliver Walters
92632b2ef7
PartAttachment attachment file is actually required!
2019-05-18 23:08:13 +10:00
Oliver Walters
a1461de297
Add supplierpricebreak model to the admin interface
2019-05-18 23:08:09 +10:00
Oliver Walters
613c96e093
Part attachment comment field is required
2019-05-18 23:08:04 +10:00
Oliver Walters
a2dbdfe794
Remove 'single_price' field from supplier part
...
- Instead we will rely entirely on the SupplierPriceBreak model
2019-05-18 23:07:58 +10:00
Oliver Walters
a95e77c429
Pre-fill allocation count
2019-05-18 12:17:57 +10:00
Oliver Walters
a2eeb7e946
Bug fix for part/stock
...
- Re-introduce the button to create a new stock item
2019-05-17 16:35:16 +10:00
Oliver Walters
117fd701cd
Refactor some code
2019-05-16 22:19:49 +10:00
Oliver Walters
0a1887477c
Create template for stock table
2019-05-16 22:15:44 +10:00
Oliver Walters
b4df96aaee
Simplify extended filters
2019-05-16 19:14:43 +10:00
Oliver Walters
fae44c3002
Bug fix for part deep-copy
...
- Don't copy an image if an image doesn't exist
2019-05-15 09:21:31 +10:00
Oliver Walters
292e29e95e
Add some more secondary modals
2019-05-15 07:50:54 +10:00
Oliver Walters
c6331255de
Fixes
2019-05-15 07:23:55 +10:00
Oliver Walters
8c92c2c2a1
Display overage values in BOM table
2019-05-15 07:23:02 +10:00
Oliver Walters
68ae38a7d7
Calculate total quantity required for a build (including overages)
2019-05-15 00:36:02 +10:00
Oliver Walters
a80c11f3ce
Add function to infer default_supplier for a Part
2019-05-15 00:22:10 +10:00
Oliver Walters
f6baf5d2ae
Add 'overage' field to BOM item
...
- Accepts absolute or percentage numbers
- Default = blank
- Now with custom validator! (for limited time only, limit one per customer)
2019-05-15 00:16:34 +10:00
Oliver Walters
f979edef8e
Prevent double loading of stock.js
2019-05-14 23:47:15 +10:00
Oliver Walters
2e5b3bfdf9
Prevent multiple loads of part.js
2019-05-14 23:44:33 +10:00
Oliver Walters
58cc1cda77
Only load api.js once
2019-05-14 23:43:16 +10:00
Oliver Walters
0ffe2666b3
Added some missing help text
2019-05-14 23:36:22 +10:00
Oliver Walters
505b7941b1
Add link to delete a part
...
- Part must first be deactivated
2019-05-14 23:33:25 +10:00
Oliver Walters
76e6094977
Add secondary modal to BOM
2019-05-14 23:30:32 +10:00
Oliver Walters
9d50f2a6ac
Toot toot all aboard the refactor tractor
...
- launchModalForm now accepts a 'secondary' parameter which is a list of secondary modals to attach
2019-05-14 23:27:45 +10:00
Oliver Walters
97c4e5acbf
Add some secondary buttons to the part-create form
2019-05-14 23:19:56 +10:00
Oliver Walters
a316681ec8
Pass object data back to modal when creating new object
2019-05-14 23:04:00 +10:00
Oliver Walters
2164cac28a
PEP
2019-05-14 18:32:20 +10:00
Oliver Walters
d1de6eb1f9
Copy across default tags when creating a new part
2019-05-14 17:32:29 +10:00
Oliver Walters
0842bd5833
Add 'default_keywords' field to a category
2019-05-14 17:30:24 +10:00
Oliver Walters
02033c2157
Add 'keywords' field to Part
...
- Shows up in search results
2019-05-14 17:23:20 +10:00
Oliver Walters
069cebb669
PEP
2019-05-13 23:03:37 +10:00
Oliver Walters
06e95819c9
Update form for deleting a BOM item
2019-05-13 23:00:04 +10:00
Oliver Walters
00b37b62db
Updated form to delete part category
2019-05-13 22:55:40 +10:00
Oliver Walters
ffa5a25fa9
Updated form for deleting part attachments
2019-05-13 22:53:58 +10:00
Oliver Walters
fcdddf6bb6
Cleaup for delete supplier part form
2019-05-13 22:52:20 +10:00
Oliver Walters
3e4d778539
Change menu ordering
2019-05-13 21:56:39 +10:00
Oliver Walters
e1e5cde60f
Renamed copyBomFrom to deepCopy
...
- Allows passing of more data (in the future) e.g. tags, etc
- Performs copy of the part image
2019-05-13 21:54:52 +10:00
Oliver Walters
00f7ece6b4
PEP fixes
2019-05-13 21:42:05 +10:00
Oliver Walters
2408318eae
Add new view to duplicate a part
...
- Allows 'deep_copy' (copies all BOM items for the duplicated part)
2019-05-13 21:41:32 +10:00
Oliver Walters
42bbf95c42
Include the sub_part ID in the BOM hash
2019-05-13 18:09:59 +10:00
Oliver Walters
f410957d8d
Refactored Stock test to use fixtures
2019-05-12 21:46:38 +10:00
Oliver Walters
e3a9a70678
Add a form/view/etc for BOM validation
2019-05-12 16:27:50 +10:00
Oliver Walters
c7f0d56be4
Don't display BOM hash any more!
2019-05-12 16:09:11 +10:00
Oliver Walters
d17e36b9f9
Add BOM checksum info panels to the BOM view
2019-05-12 13:24:58 +10:00
Oliver Walters
9149619f38
Make BOM tab badge red if the BOM is not validated
2019-05-12 13:12:04 +10:00
Oliver Walters
06deccca1c
Rename check_bom to validate_bom
2019-05-12 13:01:41 +10:00
Oliver Walters
985986a844
New functions for Part model
...
- is_bom_valid() - Tests if bom checksums match
- check_bom() function to mark the BOM as valid
2019-05-12 12:53:56 +10:00
Oliver Walters
2431ba2a04
Add new fields to Part model
...
- bom_checksum (stores checksum calculated when the BOM was checked)
- bom_checked_by (User who checked the BOM)
- bom_checked_date (When the BOM was last checked)
2019-05-12 12:47:28 +10:00
Oliver Walters
4c3032e2f0
Add function to calculate BOM hash
...
- Uses hashlib.md5
2019-05-12 12:42:20 +10:00
Oliver Walters
82fb43e1e3
PEP
2019-05-12 12:29:16 +10:00
Oliver Walters
d5dbc1b072
Display supplier part URL in table
2019-05-12 12:20:15 +10:00
Oliver Walters
1d36ea3e2e
Add a 'full_name' field for Part
...
- Combines IPN | Name | Variant
- Use this to display in most views
2019-05-12 12:16:04 +10:00
Oliver Walters
b3cca1d851
Improve form management when possible part matches are found
...
- Display the checkbox always
- Display a warning message above the form
2019-05-11 18:07:37 +10:00
Oliver Walters
19854b4709
Improve str2bool to validate checkbox return values
...
- A checked checkbox returns 'on' :|
2019-05-11 18:06:17 +10:00
Oliver Walters
2e5b0bc961
PEP
2019-05-11 12:29:51 +10:00
Oliver Walters
84d2fce8ca
Add a 'confirm_creation' input if there are possible part matches
2019-05-11 12:29:02 +10:00
Oliver Walters
d9c0d2f5e3
Update PartCreate form
...
- Display list of close matches
- Invalidate form (for now)
2019-05-11 11:55:17 +10:00
Oliver Walters
1b8ca34ddb
Added fuzzy search function for matching against part names
2019-05-11 10:36:24 +10:00
Oliver Walters
343850c4f0
Cleanup for part.views
2019-05-11 09:51:45 +10:00
Oliver Walters
7f1cdaf73f
PEP
2019-05-10 22:52:45 +10:00
Oliver Walters
8ac180a9e3
Add validator to part name
...
- Check for 'illegal' characters
- Mostly just as a test for validators!
2019-05-10 22:52:06 +10:00
Oliver Walters
68b273aae1
Fixed some more part name displays
2019-05-10 22:18:56 +10:00
Oliver Walters
f76f1f54ae
Add 'variant' field to Part model
...
- Display 'long_name' which is concatenation of name and variant
2019-05-10 22:17:13 +10:00
Oliver Walters
01778f996e
PEP fixes
2019-05-10 20:12:15 +10:00
Oliver Walters
ba2f565e35
docstring improvements
...
- Added Attribute docstring to all model objects
2019-05-10 20:11:52 +10:00
Oliver Walters
932c07287b
Button fixes
2019-05-10 08:38:50 +10:00
Oliver
793b4f8063
Merge pull request #288 from SchrodingersGat/tree-badges
...
Tree badges
2019-05-09 23:06:32 +10:00
Oliver Walters
92930766c6
Tree view now supports root URL link
2019-05-09 22:23:56 +10:00
Oliver Walters
34225193fa
Improve tree toggle icon
2019-05-09 21:46:11 +10:00
Oliver Walters
bff0f30b13
Save tree state 'per tree'
...
- Separate save state for Part and Stock tree
2019-05-09 21:41:44 +10:00
Oliver Walters
45223fb607
Display count badges in sidenav tree
...
Uses the 'tags' parameter as according to the docs - https://github.com/jonmiles/bootstrap-treeview
- Part
- Stock
2019-05-09 20:30:23 +10:00
Oliver Walters
1a115104d2
If a part has no bom items, the 'can_build' function now returns zero
2019-05-09 18:35:55 +10:00
Oliver
8bf09300bb
Merge pull request #281 from SchrodingersGat/page-title
...
Page title
2019-05-09 18:33:03 +10:00
Oliver Walters
ca6bd0a999
Add page title for company page
2019-05-09 18:17:28 +10:00
Oliver Walters
a067d9f4cd
Add page title for Part app
2019-05-09 18:13:54 +10:00
Oliver Walters
873bd182f0
Vertical alignment of button toolbars
2019-05-09 18:04:42 +10:00
Oliver
fa2bf947ab
Merge pull request #267 from SchrodingersGat/bom-img
...
BOM table improvements
2019-05-09 00:42:33 +10:00
Oliver Walters
94ad378b9d
Part and company images return the 'no image found' image if they do not have an image
2019-05-09 00:39:51 +10:00
Oliver Walters
f05e05664b
PEP fix
2019-05-08 23:33:37 +10:00
Oliver Walters
e9c904076f
Added help text for model fields
2019-05-08 23:32:57 +10:00
Oliver Walters
1f9aa7a8fc
Display thumbnail in Part 'used_in' detail view
2019-05-08 20:26:39 +10:00
Oliver Walters
58e5b10d26
Display supplier logo in part suppliers list
...
- Also add a background colour for popup image in case of transparent image file
2019-05-08 20:23:54 +10:00
Oliver Walters
0754afd5f5
Display icons in supplier_part list
...
- Bug fix for part list API query
2019-05-08 20:16:53 +10:00
Oliver Walters
0058207fad
Functionalize loadPartTable
2019-05-08 19:31:43 +10:00
Oliver Walters
2a66224952
Part image hover preview working in part-category-list
...
- Yay for CSS!
2019-05-08 19:15:41 +10:00
Oliver Walters
fb38ddb1b3
Limit choices for 'parent' field when editing PartCategory
2019-05-08 17:57:31 +10:00
Oliver Walters
ab76525da2
Initially sort part list by 'name'
2019-05-08 15:53:03 +10:00
Oliver Walters
416b5c9820
Include part image URL in Part API
2019-05-08 15:25:28 +10:00
Oliver Walters
e58bed41b0
Visual style improvements
2019-05-07 21:24:09 +10:00
Oliver Walters
9a6cf259a6
PEP fixes
2019-05-07 14:48:35 +10:00
Oliver Walters
dcbd5d819c
Enable DnD for Company image
...
- Can actually use the existing form to do partial upload!
- Generecise the drag-and-drop upload function
- Remove some (now unnecessary) Python View code
2019-05-07 14:47:31 +10:00
Oliver Walters
0969edc431
Some tweaks
...
- Add (unused) function to download an external file
- JS tweaks
2019-05-07 08:07:33 +10:00
Oliver Walters
22ff085b15
PEP fixes
2019-05-07 00:11:27 +10:00
Oliver Walters
fe4acd48a7
Add the ability to extract image URL information when drag-and-dropping image URL from a browser window
...
- Can't do anything with it yet...
- Code is almost there but leaving for now
2019-05-07 00:04:35 +10:00
Oliver Walters
3c7238f29c
Extract img URL from a drag-and-dropped image from another website
...
- https://stackoverflow.com/a/19268449
2019-05-06 22:34:38 +10:00
Oliver Walters
bb702367b6
Test that uploaded image is an image file, return error otherwise
...
- New javascript function inventreeFileUpload
2019-05-06 22:20:06 +10:00
Oliver Walters
c88149b9aa
POST image data to View
...
- https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
- https://stackoverflow.com/questions/25390598/append-called-on-an-object-that-does-not-implement-interface-formdata#25390646
2019-05-06 21:49:01 +10:00
Oliver Walters
eec0fc34d2
Provide function callback when file is dropped
...
- https://stackoverflow.com/questions/6756583/prevent-browser-from-loading-a-drag-and-dropped-file
-
2019-05-06 21:28:49 +10:00
Oliver Walters
dca26b5810
Change the display of the part thumbnail when dragging a file overhead
...
Refs:
- https://stackoverflow.com/questions/26756176/jquery-dragenter-or-dragover-to-include-children#26777526
- https://stackoverflow.com/questions/10867506/dragleave-of-parent-element-fires-when-dragging-over-children-elements
Thanks, StackOverflow!
2019-05-06 19:21:14 +10:00
Oliver Walters
02bd9c2d05
Search part by IPN
2019-05-06 11:23:55 +10:00
Oliver Walters
b9e5afa768
PEP
2019-05-05 22:35:39 +10:00
Oliver Walters
b85a4d0895
Limit choices for BomItem Part foreignkey fields
...
- Only allow 'active' Parts
2019-05-05 22:34:00 +10:00
Oliver Walters
7987fcc7cc
PEP fixes
2019-05-05 11:44:23 +10:00
Oliver Walters
aaff92ff9c
Make the star icon yellow
2019-05-05 11:21:08 +10:00
Oliver Walters
fc5fd5e477
Toggle part star status using AJAX
2019-05-05 11:18:38 +10:00
Oliver Walters
d2d248c72e
QR button code is now a template
2019-05-05 10:56:59 +10:00
Oliver Walters
bbd164407f
Display 'starred' status on the Part information page
2019-05-05 10:54:35 +10:00
Oliver Walters
b2e935382b
Override user field when creating a new PartStar
...
- Force it to be the currently logged-in user
2019-05-05 10:47:57 +10:00
Oliver Walters
3bd7c28558
Add API endpoint for viewing and deleting a PartStar entry
2019-05-05 10:36:48 +10:00
Oliver Walters
d245e58990
Only allow PartStar creation for the currently authenticated user
2019-05-05 09:14:12 +10:00
Oliver Walters
70f1097ea0
API endpoint for accessing part star information
2019-05-05 09:05:44 +10:00
Oliver Walters
86b5b8d16e
Add PartStar model to the admin interface
2019-05-05 08:50:14 +10:00
Oliver Walters
919f04044b
Enforce uniqueness constraint
2019-05-05 08:48:41 +10:00
Oliver Walters
9919bebaa2
Add PartStart model
...
- Links parts to users
2019-05-05 08:46:23 +10:00
Oliver Walters
16edcc4bd9
Add 'star' button to Part
2019-05-05 08:42:01 +10:00
Oliver Walters
8a6932e993
Improve QR code display
...
- Pretty little glyphicon button!
2019-05-05 08:39:16 +10:00
Oliver Walters
a66bc2fe72
Reload after adjusting Part attachments
2019-05-05 00:53:42 +10:00
Oliver Walters
ecb8e71d75
Fixed a missing form title
2019-05-05 00:46:11 +10:00
Oliver Walters
22afccd294
Add tests for the custom templates
2019-05-05 00:21:54 +10:00
Oliver Walters
fcc83ca7c7
Part API test suite now uses test data fixtures
2019-05-05 00:15:25 +10:00
Oliver Walters
e2ced18753
Added some more BomItem tests
2019-05-05 00:00:30 +10:00
Oliver Walters
c0e3007e4f
Add some BomItem tests
...
- Add a bom fixture
2019-05-04 23:50:24 +10:00
Oliver Walters
1f80e8c655
More tests for Part
...
- barcode
- category_path
2019-05-04 23:35:52 +10:00
Oliver Walters
3fda5a3925
Convert test_part to use fixture data
2019-05-04 23:30:41 +10:00
Oliver Walters
663cc269b4
Test recursive child count
2019-05-04 23:22:32 +10:00
Oliver Walters
ab6673caa3
Add tests for default location traversal
2019-05-04 23:20:59 +10:00
Oliver Walters
6d803d48b5
Add fixtures to the part test
...
- Make development of further tests much easier
2019-05-04 22:58:55 +10:00
Oliver Walters
bc7f3f77de
PEPEP
2019-05-04 21:57:43 +10:00
Oliver Walters
67eda51cd2
Add part category tree traversal
...
- If a category doesn't have a default_location, look at the parent category
- And so on and so on
2019-05-04 21:56:18 +10:00
Oliver Walters
71972f4454
Add function to get the default location for a part
...
- If field not specified, look at the part category
2019-05-04 19:06:39 +10:00
Oliver Walters
f270375847
Add ability to edit default_location for a PartCategory
2019-05-04 19:03:32 +10:00
Oliver Walters
4ffaad3f1a
Add a default_location to the PartCategory model
...
- If a part does not specify a default location, look at the default location of the category
2019-05-04 19:00:11 +10:00
Oliver Walters
9aa1a70f18
QR code improvements
...
- Display QR codes as links to served images
- The qr_code plugin caches these images in the background
- Make a qr_code template to push out as a modal form
- Create a QRCodeView to simplify display of QR codes
- Add option to launchModalForm() to disable the 'submit' button
Refactored QR code display for
- StockLocation
- StockItem
- Part
2019-05-04 18:46:57 +10:00
Oliver Walters
8e65c0a120
Fixes for some broken views
2019-05-04 17:20:05 +10:00
Oliver Walters
b6cace2681
Add 'options' drop-down for Part table in Category view
...
- Doesn't do anything yet
2019-05-04 16:41:45 +10:00
Oliver Walters
b1cdb7833d
Add confirmation modal to activate/deactivate a part
...
- New question modal available
2019-05-04 16:31:23 +10:00
Oliver Walters
4fe3b9d779
add docstrings
2019-05-04 11:28:23 +10:00
Oliver Walters
28600ebc79
There's always another PEP
2019-05-04 11:27:11 +10:00
Oliver Walters
b32a9ed597
Add 'About InvenTree' modal
...
- Accessible from the top-right dropdown menu
- Add InvenTree/version.py which contains helper functions
2019-05-04 11:23:30 +10:00
Oliver Walters
6c7613ba2f
Fix form title
2019-05-04 01:03:43 +10:00
Oliver Walters
4af59f0ca9
Fixed part image upload
...
- Image was being saved twice
- Don't call super().post in AjaxUpdateView
- Instead, handle properly
2019-05-04 00:38:17 +10:00
Oliver Walters
2eb825b0e6
Improved table rendering
2019-05-04 00:02:53 +10:00
Oliver
6482b54bc9
Merge pull request #205 from SchrodingersGat/qr-codes
...
Qr codes
2019-05-02 21:15:34 +10:00
Oliver Walters
5a234a1070
Added barcode for Part object
2019-05-02 20:57:53 +10:00
Oliver Walters
d49ce465e5
Removed UUID field from StockItem
...
- QR code is now created based on a JSON object
- This will make it extensible to other things such as StockLocation
- Created a helper function to make Barcode objects
2019-05-02 20:40:56 +10:00
Oliver Walters
194a0962f3
PEP fixes
2019-05-02 20:19:08 +10:00
Oliver Walters
38100520df
Add 'to_order' and 'to_build' collapsible panels
2019-05-02 20:18:34 +10:00
Oliver Walters
4d7ac870e0
Use the collapse template for the stock location list view
2019-05-02 19:02:03 +10:00
Oliver Walters
fbb120da53
Use collapse template in allocation page
2019-05-02 18:53:03 +10:00
Oliver Walters
6e8c1bcc84
Add views to Create / Edit / Delete a PartAttachment
...
- Buttons to edit or delete existing attachments
- Button to add a new attachment
- Fixed conflicting migrations
2019-05-02 17:29:21 +10:00
Oliver Walters
505191089f
Added buttons to edit and delete attachments
2019-05-02 01:06:06 +10:00
Oliver Walters
9614ac2958
Move attachments list to attachments tab
2019-05-02 01:06:06 +10:00
Oliver Walters
ad6f4e19b1
Add 'comment' field to part attachment model
2019-05-02 01:06:06 +10:00
Oliver Walters
2181c82a31
Add 'attachments' tab for Part
2019-05-02 01:05:32 +10:00
Oliver Walters
7c11d917de
Bug fixes
...
- Part creation form was setting a field as HiddenInput() rather than its widget
- Added 'comment' file to FileAttachment model
2019-05-01 09:40:49 +10:00
Oliver Walters
436d158cfe
Merge remote-tracking branch 'inventree/master' into build-allocation
...
# Conflicts:
# InvenTree/company/templates/company/tabs.html
2019-05-01 08:15:58 +10:00
Oliver Walters
b6becbc570
Rework build allocation
...
- Each item renders as a collapsible panel with overview data at the top
2019-05-01 07:48:46 +10:00
Oliver Walters
7e7ac60a1a
Tweaks
...
- Can't edit build status directly
- Refresh BOM table on reload
- Hide Company tabs that are not yet functional
2019-04-30 20:55:28 +10:00
Oliver Walters
395db4df38
Pepe fixes
2019-04-30 00:18:58 +10:00
Oliver Walters
8ec4101edd
Reduce items presented in BOM creation list
...
- Don't allow selection of parts that are already in the BOM!
2019-04-30 00:16:20 +10:00
Oliver Walters
c29827e45a
Add API endpoint and serializer for BuildItem model
2019-04-29 22:59:42 +10:00
Oliver Walters
e25579141e
Rename BuildItemAllocation to BuildItem
2019-04-29 22:30:21 +10:00
Oliver Walters
6326d6d050
Fixed spelling mistake
2019-04-29 22:21:18 +10:00
Oliver Walters
3b838d29ec
Small fixes
...
- Hide some tabs that aren't functional yet
- Hide fields instead of marking them as disabled
- Default behaviour is to allow all hosts
2019-04-29 18:35:16 +10:00
Oliver
99b386fb95
Merge pull request #185 from SchrodingersGat/active-part
...
Inactive part
2019-04-29 00:04:26 +10:00
Oliver Walters
07fbaa9dd9
Test fix
...
- Part list API handles 'category' filtering a bit differently
- Probably need to address this
2019-04-29 00:01:57 +10:00
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