New models#27
Closed
DDRMin wants to merge 7 commits into
Closed
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements new models and updates related logic to replace the WarehouseSupplier model with a new SupplierProduct model. The key changes include:
- Removal of WarehouseSupplier and migration of its logic/data into the SupplierProduct model.
- Updates in views, serializers, admin, and URL configurations to reference the new model.
- Adjustments in data population and migrations to support the new supplier-related functionality.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| warehouse_managment/warehouse/settings.py | Updated commented and active database configuration. |
| warehouse_managment/warehouse/views.py | Replaced WarehouseSupplier with SupplierProduct and updated business logic accordingly. |
| warehouse_managment/warehouse/urls.py | Revised supplier product endpoint paths and inline comments. |
| warehouse_managment/warehouse/serializers.py | Added SupplierProductSerializer. |
| warehouse_managment/warehouse/models.py | Introduced the new SupplierProduct model with updated unique constraints. |
| warehouse_managment/warehouse/migrations/0004_supplierproduct_delete_warehousesupplier.py | Migration creating SupplierProduct model and deleting WarehouseSupplier. |
| warehouse_managment/warehouse/admin.py | Updated admin registration for the new SupplierProduct. |
| warehouse_managment/product/views.py | Adjusted endpoints to use SupplierProduct with required parameter changes. |
| warehouse_managment/product/urls.py | Added endpoints for supplier and product queries using the new model. |
| warehouse_managment/product/serializers.py | Removed SupplierProductSerializer now handled in warehouse serializers. |
| warehouse_managment/product/models.py | Removed the SupplierProduct model, as it is now maintained under warehouse. |
| warehouse_managment/product/migrations/0003_delete_supplierproduct.py | Migration for deleting the old SupplierProduct model in product app. |
| warehouse_managment/product/management/commands/populate_all_data.py | Updated data generation to accommodate SupplierProduct and updated WarehouseInventory usage. |
| warehouse_managment/product/admin.py | Removed SupplierProduct admin registration. |
Comments suppressed due to low confidence (1)
warehouse_managment/warehouse/urls.py:49
- The URL pattern should not start with a leading slash; removing it will align with Django conventions.
path("/supplier-product/add_or_update/", add_supplier_product, name="update_supplier_product"),
| path('order/handle/', handle_order_status, name='handle_order_status'), | ||
| # POST endpoint to add or update a supplier product | ||
|
|
||
| # POST endpoint to add a supplier product enrty or update an existing one with supplier_price, lead_time_days or maximum_stock |
There was a problem hiding this comment.
Typo in the comment: 'enrty' should be corrected to 'entry'.
Suggested change
| # POST endpoint to add a supplier product enrty or update an existing one with supplier_price, lead_time_days or maximum_stock | |
| # POST endpoint to add a supplier product entry or update an existing one with supplier_price, lead_time_days or maximum_stock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.