[16.0] refactor quotations rest api#1597
Conversation
e676a2c to
6876549
Compare
|
The last force push aimed at rebasing this PR to #1594. |
71c7fab to
b4e5b7b
Compare
c7a879b to
816d1c6
Compare
|
@paradoxxxzero fixed |
| ) | ||
|
|
||
|
|
||
| def InvalidQuotationStateErrorWrapper(func): |
There was a problem hiding this comment.
Interesting code. Creating a specific error so we can catch it and return a clean http error code is smart.
In long term, maybe we should be able to extend the "convert_exception_to_status_body"
https://github.com/OCA/rest-framework/blob/34c06aab48512b6d7bda8ec797c45ae219a2fc59/fastapi/error_handlers.py#L20 so we can just extend this and it will raise the right http error without needed a wrapper.
The issue with the wrapper is when an other endpoint do an action and you didn't have set the decoration (because you didn't expect this case) you will not have the right http error.
Note a blocking point, it's just a comment to share the idea. If you think it's an interesting one we can to a PR in fastapi to implement it.
| return self.with_context( | ||
| bypass_customer_quotation=True, | ||
| ).action_confirm() |
There was a problem hiding this comment.
This change with the previous behavior.
Indeed before this change an accepted quotation was staying in draft (as maybe we wait for extra action like the payment)
The two customer we have, for now make this difference, they want to know that the customer have accepted the quotation, but they wait for the payment to confirm the sale order.
Maybe we can add a general configuration option ? So we can activate or not this behavior.
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
* Extracts the shop_order_mode of products in a new module * Enables to choose a combined shop order mode (quotation or direct sale) * Adds a migration script to translate the products and templates order mode infos from the old to the new fields
… hacking the write.
…in a separate module
…der as a quotation
…nce API - put shopinvader_sale_state as a dependency in order to remove sale_cart because we need the field sale.order.shopinvader_state This commit introduces significant enhancements to the REST API for quotation management, including: - **Create Method:** Added a new endpoint to create quotations. - **Line Management Methods:** Implemented dedicated endpoints for adding, deleting, or updating single or multiple lines within a quotation. - **Update Extension:** Extended the existing update method to support the addition of new lines
…ic of transforming a cart to a quotation.
…tion" action in the form view of sale.order + refine module description
Use a switch button to activate / deactivate the user workflow for quotation. All the logic is now driven by the field and we no more need to manipulate the typology
Add methods triggered by the cutomer to manage the requested quotation. Ensures that methods called by customer are allowed according the the quotation state
…customer use only
Adds customer methods used to manage the quotation flow. Ensures proper http status is returned in case where the called method is not allowed according to the quotation state
…ot sent to the customer
The customer can only fill the client ref as rederence. The name is reserved for Odoo
Allows to search on quotation_state and client_order_ref
complete pot files are required to get the translations working. Indeed, when a transation file is loaded by the polib, the entry is marked as obsolete if it's not present into the pot file. obsolete entries are not loaded by odoo
…d upon creation When a quotation is created via the API client, the assigned salesperson (user_id) was not automatically added as a follower. This occurred because the Odoo core mechanism for auto-subscribing the user_id is only triggered when the 'user_id' value is explicitly present in the create values dictionary. Since the API relies on Odoo's default value computation to assign the salesperson, the auto-subscription logic was incorrectly bypassed. This commit explicitly calls message_subscribe for the assigned user_id.partner_id during the API creation flow, ensuring the salesperson receives relevant Chatter notifications as expected.
65e34cb to
137ba42
Compare
|
Can anyone allow the tests to run on this PR? |
137ba42 to
a70632f
Compare
…TTP test standards Fix a series of 422 (Unprocessable Entity) test failures caused by an upstream upgrade to Starlette/FastAPI.
…ptance Fix an AccessError on `procurement.group` when a storefront user accepts a quotation and `sale_stock` is installed.
a70632f to
7c5a35b
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 16.0 #1597 +/- ##
==========================================
+ Coverage 95.09% 95.34% +0.24%
==========================================
Files 494 519 +25
Lines 10168 10862 +694
Branches 513 544 +31
==========================================
+ Hits 9669 10356 +687
- Misses 354 355 +1
- Partials 145 151 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This PR introduces several refactorings to improve module isolation and extend the Shopinvader API:
sale_typologymodule creation: Isolates the sale order typology logic.sale_quotationextension: Updatessale_quotationto depend on the newsale_typologymodule.sale_cart_quotationmodule creation: Decouplessale_quotationfromsale_cart.shopinvader_api_quotationenhancement: Enables line creation, update, and deletion within the quotation API.shopinvader_api_cart_quotationmodule extraction: Moves the cart-to-quotation transformation logic fromshopinvader_api_quotationto its own dedicated module.