-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG] shopinvader_api_quotation #1471
base: 16.0
Are you sure you want to change the base?
[16.0][MIG] shopinvader_api_quotation #1471
Conversation
4d5fd86
to
7b117d1
Compare
7b117d1
to
0ee3dd1
Compare
9b3416e
to
a809af8
Compare
a809af8
to
23cf892
Compare
@matthieusaison be carefull when you do a rebase, you have drop my commit :'(. |
…and add download report
- change behaviour so you can use it without shopinvader context - remove typology in favor of a quotation_state - rework backend UI to make it more human understandable - adapt test
Co-authored-by: David Beal <[email protected]>
6506c60
to
0c7f30f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (code review). Thanks for the rebase
@lmignon let's merge it ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this proposal. Some comments...
def _compute_available_for_quotation(self): | ||
for record in self: | ||
record.available_for_quotation = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastienbeau What's the purpose of this compute method (and the field behind)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose is to make visible or not on the website if the button "request quotation", but we can remove this compute field and simply "inherit" the Schema sale to return something different
@@ -0,0 +1 @@ | |||
This module handle the model and view for product and sale.order needs for shopinvader-api-quotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should define the context and the 'why' of this addon. This description doesn't provide the minimal information to know when to use it.
"quotation_state": "waiting_acceptation", | ||
} | ||
) | ||
with self._create_test_client(router=quotation_router) as test_client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the quotation_router
router is already defined as the default one into your setUpClass
method.
with self._create_test_client(router=quotation_router) as test_client: | |
with self._create_test_client() as test_client: |
"quotation_state": "waiting_acceptation", | ||
} | ||
) | ||
with self._create_test_client(router=quotation_router) as test_client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with self._create_test_client(router=quotation_router) as test_client: | |
with self._create_test_client() as test_client: |
"quotation_state": "waiting_acceptation", | ||
} | ||
) | ||
with self._create_test_client(router=quotation_router) as test_client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with self._create_test_client(router=quotation_router) as test_client: | |
with self._create_test_client() as test_client: |
cart = self.env["sale.order"]._create_empty_cart( | ||
self.default_fastapi_authenticated_partner.id | ||
) | ||
with self._create_test_client(router=cart_router) as test_client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with self._create_test_client(router=cart_router) as test_client: | |
with self._create_test_client() as test_client: |
"quotation_state": "waiting_acceptation", | ||
} | ||
) | ||
with self._create_test_client(router=quotation_router) as test_client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with self._create_test_client(router=quotation_router) as test_client: | |
with self._create_test_client() as test_client: |
partner: Annotated[ResPartner, Depends(authenticated_partner)], | ||
) -> FileResponse: | ||
"""Download document.""" | ||
filename, pdf = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO use report method merged here : https://github.com/shopinvader/odoo-shopinvader/pull/1489/files#diff-8661a778244e3a221d47f4c85ae9f1e05f275980e48ad3824616e3f10aab4556L118
Co-authored-by: Laurent Mignon (ACSONE) <[email protected]>
from odoo.addons.shopinvader_api_cart.routers import cart_router | ||
from odoo.addons.shopinvader_schema_sale.schemas.sale import Sale | ||
|
||
|
||
@cart_router.post("/{uuid}/request_quotation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To not break extension mechanism from odoo, you must define a new router and explain into your readme that your new router must be mounted at the same point as the initial cart router as I did it for the shopinvader_api_sale_loyalty
addon in 2c20ea8
Superseded by #1573 |
Continuation of this PR: #1447
In this PR we split model and views in sale_quotation module.
And add shopinvader_sale_state in dependency (#1448)
depend on