Commit Graph

1384 Commits

Author SHA1 Message Date
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
dd5de91c23 Add middleware to report response time (and number of queries) 2019-05-20 21:46:50 +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
2e2c51b271
Merge pull request #350 from SchrodingersGat/part-pricing
Part pricing
2019-05-19 00:14:02 +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
Oliver Walters
f88e26cd5c Remove backup database file 2019-05-18 23:48:03 +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
4c82714777 Allow 5 decimal places for pricing info 2019-05-18 23:08:47 +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
3a0f60930e
Merge pull request #348 from SchrodingersGat/build-page
Build page
2019-05-18 15:40:22 +10:00
Oliver Walters
001dacc14e Display 'no stock available' warning 2019-05-18 13:24:15 +10:00
Oliver Walters
04420b7f6b Improve display of allocation page 2019-05-18 13:06:19 +10:00
Oliver Walters
a95e77c429 Pre-fill allocation count 2019-05-18 12:17:57 +10:00
Oliver Walters
34d1ef7d8d Change label size for build status 2019-05-18 09:44:16 +10:00
Oliver Walters
0ce5240361 More UI stuff for the Build page 2019-05-17 16:35:23 +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
3a3662ae14 Add part image 2019-05-17 00:31:35 +10:00
Oliver Walters
489d5de9c4 UI tweaks 2019-05-17 00:23:08 +10:00
Oliver Walters
2da3a022bf Add allocation tab 2019-05-17 00:20:48 +10:00
Oliver Walters
bf987f23f3 Add 'tabbed' page set for Build app 2019-05-17 00:14:29 +10:00