Commit Graph

822 Commits

Author SHA1 Message Date
Oliver
1243923944 Event refactoring 2022-01-10 17:28:44 +11:00
Oliver
886b1f1d72 Simplify event triggering
- add generic receivers for database actions
- exclude django_q tables, otherwise we get an infinite loop!

Ref: https://stackoverflow.com/questions/17507784/consolidating-multiple-post-save-signals-with-one-receiver/32230933#32230933
2022-01-10 17:24:53 +11:00
Oliver
13d8bf437a PEP fixes 2022-01-10 09:02:11 +11:00
Oliver
2370e41961 Add multiple triggered events for the "order" app 2022-01-10 09:01:17 +11:00
Matthias
95ee4f908f
Merge branch 'master' of https://github.com/inventree/InvenTree into sn-append 2021-12-29 23:45:19 +01:00
Matthias
2ec41b02f8
append information about next serial numbe to fnc call
Fixes #2484
2021-12-29 03:01:52 +01:00
Oliver
943b27e195 Adds "items" list to API endpoint 2021-12-20 19:29:08 +11:00
Oliver
463192e0b9 Improved table filtering for "purchase order" table (as seen from "part" view) 2021-12-07 10:33:09 +11:00
Oliver
120870712a
Merge pull request #2420 from SchrodingersGat/assigned-to-me
Assigned to me
2021-12-04 23:08:08 +11:00
Oliver
66462d0a68 Fix for APIFilter 2021-12-04 22:07:55 +11:00
Oliver
20dac08158 PEP fixes 2021-12-04 21:31:39 +11:00
Oliver
087ac0bd34 Adds filter to purchase order for "assigned to me" 2021-12-04 21:15:38 +11:00
Oliver
1667af4c07 Add autocomplete fields to "order" admin pages 2021-12-04 20:09:39 +11:00
Oliver
9e35c52b1d unit testing fixes 2021-12-04 17:30:13 +11:00
Oliver
31398b4c10 Sales order can now be completed via the API 2021-12-04 13:50:11 +11:00
Oliver
008c52ef39 Allocation by serial number now moved to the API 2021-12-04 13:08:00 +11:00
Oliver
e9796676c0 Add a progress spinner to modal forms 2021-12-04 10:44:48 +11:00
Oliver
9ba6ac423d Add shipment status to sales order page 2021-12-04 10:16:51 +11:00
Oliver
35b3bc73cc Merge remote-tracking branch 'inventree/master' into partial-shipment
# Conflicts:
#	InvenTree/order/api.py
2021-12-04 09:35:54 +11:00
Oliver
43ee4e390a API updates
- Allow filtering of POLineItem list endpoint by base part instance
- Include "order detail" in POLineItem serializer
2021-12-03 20:53:59 +11:00
Oliver
c93009876d UI changes 2021-12-03 20:14:09 +11:00
Oliver
88fce1e813 Unit test fixes 2021-12-03 18:42:36 +11:00
Oliver
6b29e60494 Fixes for migration tests 2021-12-03 11:12:49 +11:00
Oliver
3c3dd9368d Do not auto-complete salesorder when shipment is done
- User might want to add more line items?
2021-12-03 00:45:44 +11:00
Oliver
732034d9e5 Merge conflicting migrations 2021-12-03 00:43:10 +11:00
Oliver
80b615bfb7 Import fix 2021-12-03 00:08:05 +11:00
Oliver
93173ef1ee Merge remote-tracking branch 'inventree/master' into partial-shipment
# Conflicts:
#	InvenTree/order/serializers.py
2021-12-02 23:58:52 +11:00
Oliver
ecf70b6d4d Some PEP fixes 2021-12-02 23:58:02 +11:00
Oliver
e1668c8662 More stuffs:
- Allow filtering of salesorderlineitem by "completed" status
- Allow deletion of (empty) shipment
- Show which items are going to be shipped
2021-12-02 23:52:53 +11:00
Oliver
e74e7138a9 More stuff:
- Pass tracking number through when completing a shipment
- Reload tables automatically when certain actions are performed
- Limit stock items to only those with available stock
2021-12-02 21:59:59 +11:00
Oliver
d5ace1a8da Differentiate between "fully allocated" and "partially allocated" in stock item table 2021-12-02 21:46:05 +11:00
Oliver
6ec0cfc641 Merge branch 'master' into partial-shipment
# Conflicts:
#	InvenTree/company/templates/company/company_base.html
#	InvenTree/stock/templates/stock/item_base.html
2021-12-02 20:49:13 +11:00
Matthias
c2a6a8a30c
PEP fix 2021-12-02 10:01:20 +01:00
Matthias
970cec590b
only values starting with int possible -> only positive values 2021-12-02 09:06:58 +01:00
Matthias
c4f1a81c9c
fix permissions for test 2021-12-02 01:18:45 +01:00
Matthias
fc6f1b4acc
unittests to show the fix works 2021-12-01 23:45:16 +01:00
Matthias
dc65634abc
use mixin on all serializers whos models use ReferenceIndexingMixin 2021-12-01 23:36:21 +01:00
Matthias
3b5e9d3283
use BigIntegerField for a hugher range ;-) 2021-12-01 22:39:53 +01:00
Oliver
fd02197851 Refactor purchase order page 2021-11-30 20:39:28 +11:00
Oliver
7b43e3e585 Refactor sales order page 2021-11-30 20:33:41 +11:00
Oliver
bce69b7733 Removes ship_order function 2021-11-30 00:45:40 +11:00
Oliver
6963503d02 Delete old SalesOrderShip view 2021-11-30 00:44:42 +11:00
Oliver
3f9b280e17 Allow shipment numbers to be non-unique for different sales orders
- must be unique for a given sales order
2021-11-30 00:42:30 +11:00
Oliver
f3f3030b37 Adds API endpoint to "ship" a sales order shipment 2021-11-30 00:02:03 +11:00
Oliver
c6b11b5e38 New logic for completing a SalesOrderShipment 2021-11-29 23:11:21 +11:00
Oliver
da6c723184 Merge branch 'master' into partial-shipment
# Conflicts:
#	InvenTree/order/serializers.py
2021-11-29 22:59:36 +11:00
Oliver
32be39774f PEP fixes 2021-11-28 22:36:47 +11:00
Oliver
4ee55847f1 Refactor attachment tables 2021-11-28 14:21:20 +11:00
Oliver
0949bac175 serializer fixes 2021-11-28 14:21:09 +11:00
Oliver
6582fd3d04 Add 'link' field to attachment serializer 2021-11-28 12:57:37 +11:00
Oliver
e9ed7bffc9 adds a "link" field to the InvenTree attachment model
- Allows attachments to also serve as links to external files
2021-11-28 12:53:01 +11:00
Oliver
0b997dc784 Display both 'allocated' and 'fulfilled' quantity values in salesorder table 2021-11-26 23:30:34 +11:00
Oliver
8aed68a1d1 Adds "shipped" field to SalesOrderLineItem
- This is an internal tracker of quantity of items shipped
- Updated by the database logic (not by the user)
- Keeps track of how many items have been shipped against a lineitem
- Does not matter if the actual stock items are later removed from the database
2021-11-26 23:20:27 +11:00
Oliver
c943b320e6 shipment table tweaks 2021-11-26 23:02:29 +11:00
Oliver
d5e7489623 Table filters 2021-11-26 22:31:25 +11:00
Oliver
ac645b1fc7 Adds "responsible" row to purchase order table 2021-11-26 22:05:27 +11:00
Oliver
64d2674c04 Add action menu (hide for now) 2021-11-26 20:38:37 +11:00
Oliver
136fc67675 Adds data toolbar 2021-11-26 11:25:11 +11:00
Oliver
d3b9adc87a Separate "completed shipments" onto its own tab 2021-11-26 10:50:43 +11:00
Oliver
68e2b0850b Merge branch 'master' into partial-shipment
# Conflicts:
#	InvenTree/build/serializers.py
#	InvenTree/order/templates/order/so_sidebar.html
2021-11-26 08:25:51 +11:00
Oliver
e53e3b4a51
Merge pull request #2350 from matmair/matmair/issue2347
Fix sidebar translation
2021-11-23 12:57:11 +11:00
Matthias
d884e62be1
[FR] Confirm to W293
Fixes #2335
2021-11-23 00:28:23 +01:00
Matthias
d79e9a62b4
fix trans tags 2021-11-22 23:42:29 +01:00
Matthias
933c420844
fix sidebar translation
Fixes #2347
2021-11-22 20:24:22 +01:00
Oliver
521ec4f1e6 Merge branch 'master' into partial-shipment
# Conflicts:
#	InvenTree/order/serializers.py
2021-11-18 23:43:36 +11:00
Oliver
7ca36a092e convert remaining serializers 2021-11-18 23:01:19 +11:00
Oliver
d5cf2b08ac Merge remote-tracking branch 'inventree/master' into partial-shipment
# Conflicts:
#	InvenTree/InvenTree/version.py
#	InvenTree/order/models.py
2021-11-11 12:35:59 +11:00
Matthias
bae28e8207
Add setting for enabeling reports
Fixes #2278
2021-11-10 23:54:54 +01:00
Oliver
30684685f9 Add unit test to check an "empty" (null) barcode can be supplied 2021-11-09 12:07:57 +11:00
Oliver
b2ae346343 Provide model-level default function option 2021-11-08 13:30:59 +11:00
Oliver
1743111613 Check if customer exists when rendering sales order template
Fixes https://github.com/inventree/InvenTree/issues/1742
2021-11-05 11:03:38 +11:00
Oliver
ecccae1081 Merge remote-tracking branch 'inventree/master' into stock-item-forms 2021-11-03 13:34:45 +11:00
Oliver
b1c23e30f5 Fix CSS for user badges 2021-11-03 11:59:20 +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
a151a68e58 convert sale_price to string before exporting 2021-10-31 00:05:20 +11:00
Oliver
361f4498df Fix broken tables removed by conflict 2021-10-30 23:51:59 +11:00
Oliver
eaa315e726 Merge branch 'master' into partial-shipment
# Conflicts:
#	InvenTree/build/templates/build/build_base.html
#	InvenTree/order/templates/order/order_base.html
#	InvenTree/order/templates/order/sales_order_base.html
#	InvenTree/order/templates/order/sales_order_detail.html
#	InvenTree/order/templates/order/so_navbar.html
2021-10-30 23:44:06 +11:00
Oliver
3849ea8057 Rearranging buttons 2021-10-29 23:20:09 +11:00
Oliver
c04118ed8a Driving the refactor tractor around the farm 2021-10-29 22:20:06 +11:00
Oliver
b41d1aed12 Refactor admin button for:
- build order
- part detail
- stock item
- stock location
- company detail
- manufacturer-part
- purchase order
- sales order
2021-10-29 17:07:35 +11:00
Oliver
80a41affc1 More sidebar action 2021-10-29 01:20:24 +11:00
Oliver
1b5428718e Refactored sidebar for "purchase order" 2021-10-29 01:11:00 +11:00
Oliver
00a0311c63 Refactor sidebar for "sales order" page 2021-10-29 01:08:18 +11:00
Oliver
2778ff55da Remove btn-default 2021-10-28 19:57:17 +11:00
Oliver
f8ac016d60 replace labels with badges 2021-10-28 17:41:40 +11:00
Oliver
ae2c3e8293 remove "panel-inventree" references 2021-10-28 08:31:36 +11:00
Oliver
711b3ba923 remove "panel-default" 2021-10-27 23:08:15 +11:00
Oliver
53c579c992 Refactor PO and SO pages 2021-10-27 23:03:08 +11:00
Oliver
a004f293ff Replace all instances of data-toggle with data-bs-toggle 2021-10-27 22:06:30 +11:00
Oliver
82271cfcb7 Add breadcrumbs to purchase order and sales order pages
(cherry picked from commit dd5eeb7c61)
2021-10-27 20:18:09 +11:00
Oliver
75845ce1ca Merge branch 'master' into partial-shipment 2021-10-27 01:05:55 +11:00
Oliver
2eb93b5a49 Add functionality to create a new sales order shipment
- From the "New Shipment" button
- As a secondary modal from the stock allocation dialgo
2021-10-27 00:57:47 +11:00
Oliver
7252b299f7 Add modal API form to allocate stock items against a SalesOrder
- Added model renderer for SalesOrderShipment
- Some refactorin'
2021-10-27 00:41:12 +11:00
Oliver
bff9f0828a Adds API endpoint to allocate stock items against a SalesOrder
- SalesOrderAllocations are no longer created manually
- API endpoint performs data validation
- Multiple line items can be allocated at once
- Adds unit testing for new API endpoint
2021-10-26 23:51:36 +11:00
Oliver
dd5eeb7c61 Add breadcrumbs to purchase order and sales order pages 2021-10-26 22:46:30 +11:00
Oliver
c90c224ed2 Update "reference" field for shipment model
- Must be unique
- Auto-incrementing default value
- Updated migrations
2021-10-26 22:13:55 +11:00
Oliver
2d910022ac Fix for supplier price breaks
- Make "price" field an InvenTreeMoneySerializer instance
- Add client-side validation for number inputs
2021-10-26 01:55:41 +11:00
Oliver
e7c25126a4 Construct table of "shipments" 2021-10-26 00:17:17 +11:00
Oliver
e9e4d13541 Add list and detail API endpoints for SalesOrderShipment
- Filter by order
- Filter by "shipped" status
- SalesOrderShipment serializer includes information on items allocated to that shipment
2021-10-25 23:34:58 +11:00
Oliver
9fcc55d71d Admin page for new model 2021-10-25 22:50:10 +11:00
Oliver
d31f2be955 Make "shipment" field required for a SalesOrderAllocation
- Deleting a "Shipment" will delete any "Allocation" objects which reference it
- Improve existing data migration for new shipment model
2021-10-25 22:47:41 +11:00
Oliver
ce5b47460a Added data migration for existing SalesOrder instances
- If a SalesOrder is "PENDING" or there are allocations available, a shipment is created
2021-10-25 22:35:27 +11:00
Oliver
2f7e0974b7 Add 'shipment' foreign-key field to SalesOrderAllocation model 2021-10-25 17:42:56 +11:00
Oliver
f00ec26efd Create SalesOrderShipment model 2021-10-25 13:09:06 +11:00
Oliver
5f6e67086f Add "reload" button for salesorderlineitem table 2021-10-24 19:35:23 +11:00
Oliver
6ebb956c8d Fix generation of API documentation
- Can't use get_object_or_404 in API views!
2021-10-17 22:32:03 +11:00
Oliver
a97a918860 cut out the fat
(removing dead code for outdated form views)
2021-10-17 21:46:33 +11:00
Oliver
ccaa7d2683 Merge branch 'master' into build-output-complete 2021-10-16 13:18:35 +11:00
Oliver
b60296e494 Add some more unit tests 2021-10-16 13:16:19 +11:00
Oliver
bf47b57c82 working on updating build output tables 2021-10-14 23:46:21 +11:00
Oliver
be6f417dff Random button cleanup 2021-10-14 23:13:12 +11:00
Oliver
54dd05a24d Add an API serializer to complete build outputs 2021-10-14 23:13:01 +11:00
Oliver
2c9bbb051a Add some unit tests
- Saving a model automatically updates the reference_int field
- Data migrations are correctly applied
2021-10-14 19:12:23 +11:00
Oliver
d0f60766e0 exclude new field from admin view 2021-10-14 18:57:02 +11:00
Oliver
d3d1d2f577 Auto-rebuild the reference field for the SalesOrder on save 2021-10-14 18:00:17 +11:00
Oliver
068b54f666 Data migration for PurchaseOrder and SalesOrder models 2021-10-14 17:58:09 +11:00
Oliver
7ce0f817aa Add a 'reference_int' field to the models, to be used as a secondary index 2021-10-14 17:45:43 +11:00
Oliver
e46875b0a3 Apply same fix to PurchaseOrder and SalesOrder lists 2021-10-14 14:31:25 +11:00
Oliver
64cf916c50 Add a form to select export format 2021-10-07 13:33:10 +11:00
Oliver
d391c5059b Adds button to sales order page to export to file 2021-10-07 13:21:30 +11:00
Oliver
996ccbe5bd Adds view for exporting sales order 2021-10-07 13:16:25 +11:00
Oliver
535d45bce4 Remove outdated Views / Forms 2021-10-06 20:19:29 +11:00
Oliver
336b05aa4e Exclude sales order allocations when searching stock 2021-10-06 17:42:00 +11:00
Oliver
4d13674452 Migrate views to use the API forms architecture:
- SalesOrderAllocationEdit
- SalesOrderAllocationDelete
2021-10-06 17:16:01 +11:00
Oliver
b8b4c60c43 Fix API endpoints for so-allocation detail 2021-10-06 17:02:03 +11:00
Oliver
0b7811b7e0 Add API endpoint for SalesOrderAllocation model
- Increment API version number
2021-10-06 16:54:40 +11:00
Oliver
4d8bec9663 Fix rendering of row sub tables 2021-10-06 16:38:13 +11:00
Oliver
4d2cf233b3 Move the "loadSalesOrderLineItemTable" code to order.js 2021-10-06 16:14:39 +11:00
Oliver
93c53315cc Unit test fixes 2021-10-05 17:35:10 +11:00
Oliver
dd760bfecd Add filtering by "completed" status for purchase order line items 2021-10-05 17:15:41 +11:00
Oliver
5e951ef64b Add 'filtering' for purchase order line item table 2021-10-05 16:57:33 +11:00
Oliver
87f1bd87e7 Add button to receive selected items 2021-10-05 16:52:24 +11:00
Oliver
8684b55582 PEP fixes 2021-10-05 16:39:18 +11:00
Oliver
05d8f2b216 Remove outdated unit test case 2021-10-05 16:35:11 +11:00
Oliver
1ea9b6f4cf PEP fixes 2021-10-05 16:10:00 +11:00
Oliver
dd4428464d Receiving items against a purchase order now makes use of the API forms
- Delete old unused code
- Improve serializer validation
2021-10-05 16:05:18 +11:00
Oliver
b75e817447 Construct bare-bones API form 2021-10-05 14:57:50 +11:00
Oliver
e39f1c320c Merge remote-tracking branch 'inventree/master' into auto-allocation-improvements 2021-10-05 12:53:47 +11:00
Oliver
99503a60d3 Fix for "barcode" field in purchase order receive serializer
- Allow blank values!
2021-10-05 12:16:41 +11:00
Oliver
ddcfc8996c Further fixes for API / serializer classes
- Correctly catch and re-throw errors
- Provide request to serializer context
2021-10-05 12:12:37 +11:00
Oliver
29588ff2c5 Refactor the POReceive API endpoint
- Lessons learned from the build allocate
- Use serializer.save() directly
2021-10-05 11:20:43 +11:00
Oliver
dd4db6442e PEP fixes 2021-10-05 00:45:49 +11:00
Oliver
5ded23fd99 Fixes for serializer validation
- Note: use the validate() function!
- Ref: https://www.django-rest-framework.org/api-guide/serializers/
- override serializer.save() functionality for simpler operation
2021-10-04 23:44:23 +11:00
Oliver
8c78d3b8ea Add unit test 2021-10-03 01:03:40 +10:00
Oliver
6d448d8475 Handle internal django errors when receiving purchase order items via the API
(cherry picked from commit 9355c68024)
2021-10-03 00:24:09 +10:00
Oliver
b9b23a3853 bug fix 2021-09-08 14:14:14 +10:00
Oliver
1a21576f28 Adds separate option for "prevent_new_stock" to stock_table 2021-09-08 12:57:42 +10:00
Oliver
8368798280 Move po-line-item-table into javascript file
- for better linting
2021-09-08 12:51:49 +10:00
Oliver Walters
f38bf6e20a Adds unit testing for barcode field 2021-09-07 23:34:14 +10:00