Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] api: Code improvements and restructuring
- Moved the logic of retrieving shipping information from the controller to the sale.order model to improve code maintainability. - Added the method get_shipping_info in the sale_order.py model to handle the retrieval of detailed shipping information, including address and picking data. Updated the controller to call the new model method, ensuring a cleaner and more modular design. - Added a route to retrieve states by country, which enhances the flexibility of the application in handling different countries dynamically. Implemented the get_inventory and get_inventory_by_sku methods in the controller to provide comprehensive inventory data based on SKUs. - Ensured that __init__.py and __manifest__ files include EOF. - Get the sales order through the sales order model. - Combined get_inventory and get_inventory_by_sku endpoints into a single endpoint in the controller. This unified approach simplifies the API and improves code maintainability. Implemented logic to handle both GET (all products with SKUs) and POST (specific product by SKU) requests in the same method. - Refactored the endpoint for scheduling activities related to invoices to use the invoice.activity_schedule method. These changes improve the modularity, readability, and maintainability of the codebase, making it easier to manage and extend in the future. Closes #25
- Loading branch information