Skip to content

Commit

Permalink
[IMP] api: add and enhance several endpoints
Browse files Browse the repository at this point in the history
Added docstring, clarified the purpose and improved of multiple endpoints to enhance the user experience and maintain consistency in the application.

1. `/create_schedule_activity_invoice`: Improved error handling for creating scheduled activities related to invoices.
2. `/get_states_mexico`: Enhanced the endpoint to retrieve the list of states in Mexico, including better error handling and more detailed responses.
3. `/get_inventory_by_sku`: Updated the endpoint to retrieve inventory details based on SKU, ensuring accurate and detailed inventory information is returned. Filter inventory by location.
4. `/get_inventory`: Improved the retrieval of inventory details for all products with a SKU, adding more detailed responses. Filter inventory by location.
5. `/send_message_sale_order`: Added functionality to post messages to sale orders, with better logging and error handling.
6. `/create_schedule_activity`: Enhanced the creation of scheduled activities related to sale orders, including additional validation and detailed responses.
7. `/confirm_sale_order`: Simplified the process of confirming sale orders and added detailed logging and responses.
8. `/send_invoice_by_email/<int:invoice_id>`: Improved the functionality for sending invoices by email, ensuring better user feedback and error handling.
9. `/stamp_invoice/<int:invoice_id>`: Enhanced the invoice stamping process, including detailed error messages and success responses.
10. `/download_invoice/<int:invoice_id>`: Streamlined the invoice download process to generate and deliver PDFs more efficiently.
11. `/get_shipping_info/<model("sale.order"):order>`: Added functionality to retrieve detailed shipping information for sale orders, including delivery address details and shipping records.
12. `/register_payment_invoice/<model("account.move"):invoice>`: Improved the payment registration process for invoices, ensuring accurate logging and error handling.
13. `/invoice_sale_order`: Enhanced the process of invoicing sale orders, including better handling of invoice creation and posting.
14. `/update_sale_order`: Improved the update process for sale orders, including validation and detailed logging.
15. `/create_sale_order`: Enhanced the creation process for sale orders with better validation and handling of optional fields.
16. Unify scheduling and address endpoints
17. `/delivery_address`: Improved the process for creating or updating delivery addresses, including better handling of address formatting and validation.
18. `/address_invoice`: Enhanced the process for creating or updating billing addresses, ensuring better validation and error handling.
19. `/update_contact`: Improved the contact update process, including better validation and detailed logging.
20. `/create_contact`: Enhanced the contact creation process with better search logic and validation based on email, phone, or store name (contact name).
21. doc: add README.rst for module documentation
22. Filter inventory by location and SKU
23. Unify scheduling and address endpoints

These changes improve the overall robustness and maintainability of the system by ensuring that each endpoint handles data consistently and provides meaningful feedback to users.

Closes #24
Closes #25
  • Loading branch information
JAntonioSalas committed May 24, 2024
1 parent 4c2dd16 commit 51c6765
Show file tree
Hide file tree
Showing 7 changed files with 871 additions and 0 deletions.
61 changes: 61 additions & 0 deletions hantec_api_ecommerce/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

Hantec Ecommerce
-------

Summary
-------

This module provides comprehensive tools to manage sales orders, invoices, shipping information, and customer contacts in Odoo. It includes endpoints for creating and updating various entities, enhancing the overall efficiency and reliability of business processes.


Authors and Maintainers
-----------------------

- Authors:
- C&O PROJECTS AND SOLUTIONS

- Maintainers:
- C&O PROJECTS AND SOLUTIONS

Development Status
------------------

The current development status of this module is:

- Development Status: **Beta**

License
-------

This module is licensed under the OEEL-1 (Odoo Enterprise Edition License v1.0)

Changelog
---------

Version 15.0.0

- Changed the phone suffix length from 4 to 5 in the `create_contact` endpoint to ensure correct matching of existing contacts.
- Changed response type for `/get_states_mexico endpoint`

Version 15.0.0

- Initial release with the following features:
- Added `/create_schedule_activity_invoice` endpoint.
- Added `/get_states_mexico` endpoint.
- Added `/get_inventory_by_sku` endpoint.
- Added `/get_inventory` endpoint.
- Added `/send_message_sale_order` endpoint.
- Added `/create_schedule_activity` endpoint.
- Added `/confirm_sale_order` endpoint.
- Added `/send_invoice_by_email/<int:invoice_id>` endpoint.
- Added `/stamp_invoice/<int:invoice_id>` endpoint.
- Added `/download_invoice/<int:invoice_id>` endpoint.
- Added `/get_shipping_info/<model("sale.order"):order>` endpoint.
- Added `/register_payment_invoice/<model("account.move"):invoice>` endpoint.
- Added `/invoice_sale_order` endpoint.
- Added `/update_sale_order` endpoint.
- Added `/create_sale_order` endpoint.
- Added `/delivery_address` endpoint.
- Added `/address_invoice` endpoint.
- Added `/update_contact` endpoint.
- Added `/create_contact` endpoint.
3 changes: 3 additions & 0 deletions hantec_api_ecommerce/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

from . import models
from . import controllers
12 changes: 12 additions & 0 deletions hantec_api_ecommerce/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Hantec API Ecommerce",
"summary": "Hantece API Ecommerce",
"version": "15.0.0",
"author": "C&O PROJECTS AND SOLUTIONS",
"license": "OEEL-1",
"category": "Sales Managment",
"depends": ["sale_management"],
"installable": True,
"development_status": "Production/Stable",
"maintainers": ["C&O PROJECTS AND SOLUTIONS"],
}
2 changes: 2 additions & 0 deletions hantec_api_ecommerce/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

from . import main
Loading

0 comments on commit 51c6765

Please sign in to comment.