Commit Graph

54 Commits

Author SHA1 Message Date
Oliver 4c9d4add2c
Table custom buttons (#5075)
* Add generic implementation for barcode actions

- Commonize code against tables
- Cleaner UI
- Better code
- Will make future react refactor easier

* Add permissions.js

- Separate .js file for dynamically checking permissions

* Update stock table to use client-side actions

* API endpoint for bulk category adjustment

* Bug fix for purchase_order.js

- Prevent some really strange API calls

* Refactor actions for part table

- Now done dynamically

* Refactor actions for the attachment tables

* Refactor actions for build output table

* Increment API version

* Cleanup janky button

* Refactor supplier part table

* Refactor manufacturer part table

* Remove linkButtonsToSelection

- no longer needed
- Cleanup, yay!

* Cleanup purchase order line table

* Refactor BOM table buttons

* JS linting

* Further cleanup

* Template cleanup

- remove extra div elements

* js linting

* js fix
2023-06-20 07:45:35 +10:00
Oliver 2e8fb2a14a
Stock status change API (#5064)
* Add API endpoint for changing stock item status

- Change status for multiple items simultaneously
- Reduce number of database queries required

* Perform bulk update in serializer

* Update 'updated' field

* Add front-end code

* Bump API version

* Bug fix and unit test
2023-06-18 07:40:47 +10:00
Oliver 327381357b
Adds ability to partially scrap build outputs (#4846)
* BuildOrder updates:

- Use batch code generation when creating a new build output
- Allow partial scrapping of build outputs

* Fixes for stock table

* Bump API version

* Update unit tests
2023-05-18 14:04:57 +10:00
Oliver b2ceac2c4a
[Feature] Scrap Build Outputs (#4800)
* Update docs for status codes

* Adds API endpoint for scrapping individual build outputs

* Support 'buildorder' reference in stock tracking history

* Add page for build output documentation

* Build docs

* Add example build order process to docs

* remove debug statement

* JS lint cleanup

* Add migration file for stock status

* Add unit tests for build output scrapping

* Increment API version

* bug fix
2023-05-13 22:19:35 +10:00
Oliver 27aa16d55d
[Feature] Add RMA support (#4488)
* Adds ReturnOrder and ReturnOrderAttachment models

* Adds new 'role' specific for return orders

* Refactor total_price into a mixin

- Required for PurchaseOrder and SalesOrder
- May not be required for ReturnOrder (remains to be seen)

* Adds API endpoints for ReturnOrder

- Add list endpoint
- Add detail endpoint
- Adds required serializer models

* Adds basic "index" page for Return Order model

* Update API version

* Update navbar text

* Add db migration for new "role"

* Add ContactList and ContactDetail API endpoints

* Adds template and JS code for manipulation of contacts

- Display a table
- Create / edit / delete

* 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

* Fix role name (change 'returns' to 'return_order')

- Similar to existing roles for purchase_order and sales_order

* Adds detail page for ReturnOrder

* URL cleanup

- Use <int:pk> instead of complex regex

* More URL cleanup

* Add "return orders" list to company detail page

* Break JS status codes into new javascript file

- Always difficult to track down where these are rendered
- Enough to warrant their own file now

* Add ability to edit return order from detail page

* Database migrations

- Add new ReturnOrder modeles
- Add new 'contact' field to external orders

* Adds "contact" to ReturnOrder

- Implement check to ensure that the selected "contact" matches the selected "company"

* Adjust filters to limit contact options

* Fix typo

* Expose 'contact' field for PurchaseOrder model

* Render contact information

* Add "contact" for SalesOrder

* Adds setting to enable / disable return order functionality

- Simply hides the navigation elements
- API is not disabled

* Support filtering ReturnOrder by 'status'

- Refactors existing filter into the OrderFilter class

* js linting

* More JS linting

* Adds ReturnOrderReport model

* Add serializer for the ReturnOrderReport model

- A little bit of refactoring along the way

* Admin integration for new report model

* Refactoring for report.api

- Adds generic mixins for filtering queryset (based on updates to label.api)
- Reduces repeated code a *lot*

* Exposes API endpoints for ReturnOrderReport

* Adds default example report file for ReturnOrder

- Requires some more work :)

* Refactor report printing javascript code

- Replace all existing functions with 'printReports'

* Improvements for default StockItem test report template

- Fix bug in template
- Handle potential errors in template tags
- Add more helpers to report tags
- Improve test result rendering

* Reduce logging verbosity from weasyprint

* Refactor javascript for label printing

- Consolidate into a single function
- Similar to refactor of report functions

* Add report print button to return order page

* Record user reference when creating via API

* Refactor order serializers

- Move common code into AbstractOrderSerializer class

* Adds extra line item model for the return order

- Adds serializer and API endpoints as appropriate

* Render extra line table for return order

- Refactor existing functions into a single generic function
- Reduces repeated JS code a lot

* Add ability to create a new extra line item

* Adds button for creating a new lien item

* JS linting

* Update test

* Typo fix

(cherry picked from commit 28ac2be35b)

* Enable search for return order

* Don't do pricing (yet) for returnorder extra line table

- Fixes an uncaught error

* Error catching for api.js

* Updates for order models:

- Add 'target_date' field to abstract Order model
- Add IN_PROGRESS status code for return order
- Refactor 'overdue' and 'outstanding' API queries
- Refactor OVERDUE_FILTER on order models
- Refactor is_overdue on order models
- More table filters for return order model

* JS cleanup

* Create ReturnOrderLineItem model

- New type of status label
- Add TotalPriceMixin to ReturnOrder model

* Adds an API serializer for the ReturnOrderLineItem model

* Add API endpoints for ReturnOrderLineItem model

- Including some refactoring along the way

* javascript: refactor loadTableFilters function

- Pass enforced query through to the filters
- Call Object.assign() to construct a superset query
- Removes a lot of code duplication

* Refactor hard-coded URLS to use {% url %} lookup

- Forces error if the URL is wrong
- If we ever change the URL, will still work

* Implement creation of new return order line items

* Adds 'part_detail' annotation to ReturnOrderLineItem serializer

- Required for rendering part information

* javascript: refactor method for creating a group of buttons in a table

* javascript: refactor common buttons with helper functions

* Allow edit and delete of return order line items

* Add form option to automatically reload a table on success

- Pass table name to options.refreshTable

* JS linting

* Add common function for createExtraLineItem

* Refactor loading of attachment tables

- Setup drag-and-drop as part of core function

* CI fixes

* Refactoring out some more common API endpoint code

* Update migrations

* Fix permission typo

* Refactor for unit testing code

* Add unit tests for Contact model

* Tests for returnorder list API

* Annotate 'line_items' to ReturnOrder serializer

* Driving the refactor tractor

* More unit tests for the ReturnOrder API endpoints

* Refactor "print orders" button for various order tables

- Move into "setupFilterList" code (generic)

* add generic 'label printing' button to table actions buttons

* Refactor build output table

* Refactoring icon generation for js

* Refactoring for Part API

* Fix database model type for 'received_date'

* Add API endpoint to "issue" a ReturnOrder

* Improvements for stock tracking table

- Add new status codes
- Add rendering for SalesOrder
- Add rendering for ReturnOrder
- Fix status badges

* Adds functionality to receive line items against a return order

* Add endpoints for completing and cancelling orders

* Add option to allow / prevent editing of ReturnOrder after completed

* js linting

* Wrap "add extra line" button in setting check

* Updates to order/admin.py

* Remove inline admin for returnorderline model

* Updates to pass CI

* Serializer fix

* order template fixes

* Unit test fix

* Fixes for ReturnOrder.receive_line_item

* Unit testing for receiving line items against an RMA

* Improve example report for return order

* Extend unit tests for reporting

* Cleanup here and there

* Unit testing for order views

* Clear "sales_order" field when returning against ReturnOrder

* Add 'location' to deltas when returning from customer

* Bug fix for unit test
2023-03-29 10:35:43 +11:00
Oliver ba406a4da9 Refactorin'
- Add the "download" button into the "filters" list
- Cuts down on boilerplate code
2022-03-03 21:16:27 +11:00
Oliver f6b3760bb5 Make UI elements more consistent
Ref: https://github.com/inventree/InvenTree/issues/2692
2022-03-02 00:05:02 +11:00
Oliver 552ca8e5c4 Adds javascript function to merge multiple stock items together 2021-12-20 22:09:08 +11:00
Oliver 4a453b0a35 Assign multiple stock items to a customer at one 2021-12-09 00:33:45 +11:00
Oliver aaf27d4098 Adds new buttons to create a new stock item 2021-11-03 07:27:58 +11:00
Oliver 360f0406b5 CSS updates
- Add template for filter lists
- Filter lists now layout horizontally
- Change flex-row to flex-wrap
2021-11-01 08:38:24 +11:00
Oliver a004f293ff Replace all instances of data-toggle with data-bs-toggle 2021-10-27 22:06:30 +11:00
Oliver 1a21576f28 Adds separate option for "prevent_new_stock" to stock_table 2021-09-08 12:57:42 +10:00
Oliver 533a3aa368 Refactor StockItem pages 2021-07-15 22:19:13 +10:00
eeintech a63d5012f0 Purchase order fixes 2021-04-28 13:16:40 -04:00
Oliver Walters 38eea21f4f Enable printing of multiple stock location labels 2021-04-20 20:06:13 +10:00
Oliver Walters a0e7d37a19 Add setting for enabling / disabling test reports 2021-02-04 21:15:19 +11:00
Oliver Walters 5e5bced0c7 Optionally include javascript code based on barcode feature 2021-01-28 21:51:34 +11:00
Oliver Walters 4641123cd8 Allow multiple stock items to be checked into a location using table selection 2021-01-28 21:47:39 +11:00
Oliver Walters 436207b315 Merge remote-tracking branch 'inventree/master' into batch-reports
# Conflicts:
#	InvenTree/templates/stock_table.html
2021-01-18 23:23:58 +11:00
Oliver Walters 697a338700 Add a smattering of unit tests 2021-01-18 22:14:38 +11:00
Oliver Walters 6a7c722efc Stock table button cleanup 2021-01-18 21:52:20 +11:00
Oliver Walters 952da19600 Print test report for multiple stock items at once 2021-01-18 21:42:55 +11:00
eeintech 72c7ceb553 Merged master and updated stock_table.html 2021-01-17 13:11:59 -05:00
eeintech 7d5571ba5b Merged changes from master 2021-01-14 08:52:56 -05:00
Oliver Walters 0134597747 Merge remote-tracking branch 'inventree/master' into label-api
# Conflicts:
#	InvenTree/locale/de/LC_MESSAGES/django.po
#	InvenTree/locale/en/LC_MESSAGES/django.po
#	InvenTree/locale/es/LC_MESSAGES/django.po
2021-01-14 23:56:23 +11:00
Oliver Walters aac835f634 Add menu item to set stock status for multiple items 2021-01-14 13:41:38 +11:00
eeintech b6135fda74 Updated templates and a lot of manual testing 2021-01-12 13:16:04 -05:00
Oliver Walters bdc7367e29 Add endpoint for printing labels 2021-01-09 20:43:48 +11:00
eeintech de1dfdcc38 Improved naming of new setting and variables 2020-12-02 13:38:53 -05:00
eeintech c66ac2579e Updated StockItem create/edit view with ownership control 2020-12-02 13:25:33 -05:00
eeintech 8dac6bb982 Updated template stock item logic and added to stock locations 2020-12-01 17:41:03 -05:00
Oliver Walters d06b4d7c9f Merge remote-tracking branch 'inventree/master' into build-fixes
# Conflicts:
#	InvenTree/InvenTree/urls.py
#	InvenTree/locale/de/LC_MESSAGES/django.mo
#	InvenTree/locale/de/LC_MESSAGES/django.po
#	InvenTree/locale/en/LC_MESSAGES/django.po
#	InvenTree/locale/es/LC_MESSAGES/django.po
#	InvenTree/part/templates/part/bom.html
#	InvenTree/templates/js/build.js
#	InvenTree/templates/js/table_filters.js
#	InvenTree/templates/stock_table.html
#	tasks.py
2020-10-28 22:25:14 +11:00
Oliver Walters d0b7d91ca4 Update multiple templates with fontawesome icons 2020-10-28 18:30:38 +11:00
Oliver Walters 646fe40950 Require either serial or batch number to be set for trackable part 2020-10-27 22:00:38 +11:00
Oliver Walters d2e2e7511f Update templates: Change perms to roles 2020-10-06 10:07:39 +11:00
Oliver Walters ba4c829b10 Add permission requirements in various part templates 2020-10-06 00:20:45 +11:00
Oliver Walters 81864a6ab8 Fix button layout for stock table 2020-10-01 00:00:37 +10:00
Oliver Walters 32cde5d8f1 Fixx css for multiple button groups 2020-09-13 20:56:05 +10:00
Oliver Walters dddaa102b3 Layout improvements 2020-04-11 14:19:21 +10:00
Oliver Walters 64f8034a4c Many more refactoring 2020-04-11 14:14:45 +10:00
Oliver Walters 613dd9d471 Add (very rough) function to add new custom table filters
- The javascript needs a LOT of work!
2020-04-11 00:45:18 +10:00
Oliver Walters 5d141a0b98 Display a list of filters for Stock table
- Delete a filter by pressing "X" button
2020-04-10 16:46:34 +10:00
Oliver Walters 33ffa2f75f Add option to make stock-table read-only
- Default table is not read-only
2020-03-18 20:37:25 +11:00
Oliver Walters 7dcc94b106 Filter purchaseorder API by supplier part 2020-02-12 12:44:52 +11:00
Oliver Walters 33d21594da Create new stock item from supplierpart stock page
- Allow stock-item-create form to have supplierpart passed as initial data
- Add some translations too
2020-02-12 11:32:01 +11:00
Oliver Walters 56255a98d8 Add a menu item to delete multiple stock items 2019-11-16 19:28:47 +11:00
Oliver Walters ddb041fe44 Filter by category too 2019-09-09 19:59:56 +10:00
Oliver Walters 3d5542181a Move "Export" button onto stock table 2019-09-08 23:40:51 +10:00
Oliver Walters ee5722857f Re-add 'new stock item' button 2019-06-18 22:13:54 +10:00