Commit Graph

14080 Commits

Author SHA1 Message Date
Oliver Walters
39c56c985e Fix typo 2023-03-15 07:57:50 +11:00
Oliver Walters
aeca25c8af Adjust filters to limit contact options 2023-03-15 00:41:17 +11:00
Oliver Walters
cd50428685 Adds "contact" to ReturnOrder
- Implement check to ensure that the selected "contact" matches the selected "company"
2023-03-15 00:35:37 +11:00
Oliver Walters
acd5dbcac8 Database migrations
- Add new ReturnOrder modeles
- Add new 'contact' field to external orders
2023-03-15 00:00:07 +11:00
Oliver Walters
bbde4645d7 Add ability to edit return order from detail page 2023-03-14 23:49:32 +11:00
Oliver Walters
42dc9796a2 Break JS status codes into new javascript file
- Always difficult to track down where these are rendered
- Enough to warrant their own file now
2023-03-14 23:37:06 +11:00
Oliver Walters
ec03e0cc22 Add "return orders" list to company detail page 2023-03-14 23:25:31 +11:00
Oliver Walters
7e43b69ae9 More URL cleanup 2023-03-14 23:11:03 +11:00
Oliver Walters
e870dae261 URL cleanup
- Use <int:pk> instead of complex regex
2023-03-14 23:10:02 +11:00
Oliver Walters
9ae6160353 Adds detail page for ReturnOrder 2023-03-14 23:05:05 +11:00
Oliver Walters
e6e76c7a2c Fix role name (change 'returns' to 'return_order')
- Similar to existing roles for purchase_order and sales_order
2023-03-14 21:07:53 +11:00
Oliver Walters
e70d013655 Splits order.js into multiple files
- Javascript files was becoming extremely large
- Hard to debug and find code
- Split into purchase_order / return_order / sales_order
2023-03-14 20:59:01 +11:00
Oliver Walters
095c4d5d05 Adds template and JS code for manipulation of contacts
- Display a table
- Create / edit / delete
2023-03-14 20:44:08 +11:00
Oliver Walters
ab5e5cab69 Add ContactList and ContactDetail API endpoints 2023-03-14 19:40:20 +11:00
Oliver Walters
260d38c333 Add db migration for new "role" 2023-03-14 19:12:45 +11:00
Oliver
7d8837ba9a Update navbar text 2023-03-14 17:35:07 +11:00
Oliver
d39fc4f59d Update API version 2023-03-14 17:32:58 +11:00
Oliver
718ad037cf Adds basic "index" page for Return Order model 2023-03-14 17:29:44 +11:00
Oliver
ab1ed84636 Adds API endpoints for ReturnOrder
- Add list endpoint
- Add detail endpoint
- Adds required serializer models
2023-03-14 17:09:09 +11:00
Oliver
047e65cdce Refactor total_price into a mixin
- Required for PurchaseOrder and SalesOrder
- May not be required for ReturnOrder (remains to be seen)
2023-03-14 16:19:05 +11:00
Oliver
2bddba42da Adds new 'role' specific for return orders 2023-03-14 16:09:04 +11:00
Oliver
139170c26b Adds ReturnOrder and ReturnOrderAttachment models 2023-03-14 16:04:56 +11:00
Oliver
1ba51e51c3
Update BomItem 'validated' field (#4486)
* Adds new "validated" field to the BomItem model

- Previously this was dynamically calculated (very expensive)
- Now cached and updated whenever a BomItem instance is saved
- Will make the BOM API much more responsive
- Cleanup BomItem list API code also

* Adds data migration to update existing BomItem objects

* Exclude 'validated' field from BomItemResource class
2023-03-14 13:53:33 +11:00
Oliver
06f8a50956
Update task limiting (#4472)
* Add new setting to control how often we check for new version

* Improved names for settings

* Fix bug in existing backup task

* Refactor backup_task functino

- Add a helper function for running tasks at multi-day intervals

* Refactoring

* Add unit tests for new helper function

* Add multi-day holdoff to "check for updates"

* Allow initial attempt

* Add missing return

* Fixes for unit test
2023-03-09 17:46:07 +11:00
Matthias Mair
7372f2b714
V0.8.4 Missing parameters in BOM export CSV format (#4476)
Fixes #3907
2023-03-09 13:01:32 +11:00
Matthias Mair
93a2d612e2
extend part fields to fit large BOMs (#4475)
Fiexes https://github.com/inventree/InvenTree/issues/2819
2023-03-09 09:35:12 +11:00
Oliver
2edb7f2b55
Adds "stock value" calculation to stock table (#4471)
* Add part pricing data to stockitem list serializer

* Add "stock value" column to stock list table
2023-03-09 00:18:39 +11:00
Oliver
34875828d7
Report template currency updates (#4469)
* Move render_currency into helpers.py

- Add duplicate tag to report.py
- Add option for currency conversion (optional)

* Update report templates

- Use "render_currency" instead of including price_data template

* Remove 'price_data.html' template entirely
2023-03-08 23:26:26 +11:00
Oliver
beac7d15df
Bug fix for units text in part label (#4470)
- Display even if no other badges are rendered
- Fixes https://github.com/inventree/InvenTree/issues/4467
2023-03-08 23:18:22 +11:00
Oliver
2dfea9b825
Unit test speed improvements (#4463)
* Unit test speed improvements

- Move from insantiating data in setUp to setUpTestData

* Update UserMixin class for API testing

* Bunch of test updates

* Further test updates

* Test fixes

* Add allowances for exchange rate server not responding

* Fixes for group role test
2023-03-08 15:22:08 +11:00
Oliver
9c594ed52b
Part table stock filtering (#4462)
* Update PartSerializer queryset annotation

- Add 'total_stock' (in_stock + variant_stock)
- Update 'unallocated_stock' to use total_stock

* Allow API filtering by total_in_stock value

* Refactor partStockLabel method

- We'll use this in the partTable also
- Allow us to prevent further API calls

* Cleanup loadPartTable

* Refactor part variant table

* More updates to part badge function

* Bump API version

* js linting
2023-03-08 13:59:51 +11:00
simonkuehling
106c238af5
Add bulk delete for purchase order line items (#4452)
* add bulk delete for purchase order line items

* bump API version

* fix JS style

* handle parts with no linked manufacturer part correctly

* add unit test for purchase order line item bulk delete
2023-03-08 10:50:24 +11:00
Oliver
abeb85cbb3
Extend functionality of custom validation plugins (#4391)
* Pass "Part" instance to plugins when calling validate_serial_number

* Pass part instance through when validating IPN

* Improve custom part name validation

- Pass the Part instance through to the plugins
- Validation is performed at the model instance level
- Updates to sample plugin code

* Pass StockItem through when validating batch code

* Pass Part instance through when calling validate_serial_number

* Bug fix

* Update unit tests

* Unit test fixes

* Fixes for unit tests

* More unit test fixes

* More unit tests

* Furrther unit test fixes

* Simplify custom batch code validation

* Further improvements to unit tests

* Further unit test
2023-03-07 22:43:12 +11:00
Oliver
edae82caa5
New Crowdin updates (#4446)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-07 21:45:42 +11:00
Oliver
e263b2a8c0
Bug fix for rendering allocations against build outputs (#4459) 2023-03-07 21:16:53 +11:00
Oliver
ba4e264e6e
Report template updates (#4454)
* Update default purchase order report template

- Add line pricing data
- Add extra lines
- Add methods for returning total line item price
- Include total order price

* Similar updates for sales order reports
2023-03-05 23:59:54 +11:00
Oliver
5ba75c868d
total_price for orders (#4447)
* Adds unit test for counting queries on PurchaseOrderList API endpoint

- We will work to make this queryset more efficient

* PEP fixes

* Add 'total_price' fields to SalesOrder and PurchaseOrder models

* PurchaseOrder list API now has constant query count

* Data migration for updating existing PurchaseOrder and SalesOrder instances

- Calculate total_price for any existing order
- Will fail if exchange rates are not available

* Add total_price_currency to API serializers

* Render total_price in SalesOrder table

* Add ability to filter both lists by total_price field

* Update total_price whenever an order is updated

* Update total price whenever a lineitem is saved or deleted

* Add query-counting unit test for SalesOrder list API

* Calling refresh_from_db inside a save() method is *not* a good idea
2023-03-05 22:22:18 +11:00
simonkuehling
c0f405243a
Add total cost column to purchase order list (#4445)
* add total price column to purchase order list

* bump API version
2023-03-04 10:09:40 +11:00
Oliver
575d62bff4
Add mathematical operator tags to report templates (#4443) 2023-03-03 21:42:04 +11:00
Oliver
cce0fe8236
New Crowdin updates (#4436)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-03 16:35:00 +11:00
Oliver
2d7f9e3a4c
Fixes for unit tests (#4441)
(cherry picked from commit 0bbba26e6331b05696cadfb21e36617de62d999c)
2023-03-03 15:53:31 +11:00
Philipp Fruck
31f4045465
Fix parsing dict variables from env (#4438)
* fix parsing dict variables from env

The INVENTREE_SOCIAL_PROVIDERS variable has been parsed as a string from
the environment which resulted in an attribute error as dict was the
expected variable type. To circumvent this error, parsing JSON strings
as dictionary values from the environment has been added

* add unit tests for env typecasting to dict
2023-03-03 10:47:15 +11:00
Oliver
f4bb7c29c7
Settings translation text consistency (#4440) 2023-03-03 10:38:24 +11:00
Oliver
7aee97d63b
Fix rendering of purchase_price for exporting StockItem data (#4434)
* Fix rendering of purchase_price for exporting StockItem data

* Stock item quantity is a decimal field

* Update other fields
2023-03-02 14:50:04 +11:00
Oliver
db42ffcf7c
Slow tests (#4435)
* Add integration for django-slowtest

* Sample test improvement

- Reduces test from 0.7s to 0.2s

* Run CI tests with slowreport

* Fix requirements file

* Fix test command

* Fix bulk_create in unit tests

* Remove bulk_create entirely

* remove another bulk_create call

* Reduce long test from ~1000 seconds to ~1 second
2023-03-02 13:51:52 +11:00
Oliver
ec66e5351b
Translation Fixes (#4433)
* Change 'zh-cn' to 'zh-hans'

* Enforce consistent naming scheme when rendering translated javascript files

* More intelligent lookup of translated javascript files

- Ensure that the language code is lower-case (to match translated files)
- Provide fallback if specified langauge code is not found

* Replace underscore characters

* remove debug hook
2023-03-02 08:24:31 +11:00
Oliver
fdfc3e5e7e
New Crowdin updates (#4394)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-01 15:31:22 +11:00
simonkuehling
f86bea75a1
Add base part info to [Add Supplier Part] modal form (#4427)
* Add base part info to [Add Supplier Part] modal form

* fix JS style
2023-03-01 08:16:26 +11:00
simonkuehling
03e105dd95
Fix some regressions in new "Responsible" filter for build orders (#4430)
* fix responsible user/group icons with translations

* fix display of active filters after recent changes
2023-03-01 07:25:12 +11:00
simonkuehling
e9a1b57941
Add unallocated quantity to StockItem renderer (#4425)
* add unallocated quantity to StockItem renderer

* introduce parameter to switch between total quantity and available quantity
2023-02-28 12:22:27 +11:00