-
Notifications
You must be signed in to change notification settings - Fork 104
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_delivery_carrier: FastAPI services #1479
[16.0][MIG] shopinvader_api_delivery_carrier: FastAPI services #1479
Conversation
6d04350
to
90196b1
Compare
4328f2f
to
4175e9f
Compare
c5eda37
to
97148ca
Compare
97148ca
to
41db857
Compare
@@ -0,0 +1,19 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> |
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.
shouldn't RR go to their own module?
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.
This was done for principal modules, but not everywhere (for eg. RR are in shopinvader_api_sale_loyalty
).
@lmignon what's your opinion about 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.
It's fine to get it here. We try to get a proper security declaration by api.... This addon comes with its own security group. If a same alc is defined multiple time across different addon we could create a common addon but is-it really better to get one addon for one ACL?
cls.partner = cls.env["res.partner"].create( | ||
{"name": "FastAPI Delivery Carrier Demo"} | ||
) | ||
cls.user_with_rights = cls.env["res.users"].create( |
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.
always set no_reset_password
in ctx when creating users (or use new_test_user from odoo.tests.common)
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.
Done (using new_test_user
)
|
||
|
||
@delivery_carrier_router.get("/{uuid}/delivery_carriers") | ||
@delivery_carrier_router.get("/current/delivery_carriers") |
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.
I keep seeing this current
... what's the point of it? I know it comes from the cart endpoint but I don't get why we need a specific key to default to the last used cart.
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.
Because the default route @delivery_carrier_router.get("/delivery_carriers")
is used to return all delivery carriers, not only the ones applicable to the current cart.
41db857
to
f565433
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)
Thank you @marielejeune
This PR has the |
Modules moved to odoo-shopinvader-carrier shopinvader/odoo-shopinvader-carrier#8 |
Migration of
shopinvader_delivery_carrier
to FastAPI services.shopinvader_delivery_carrier
contains the Shopinvader logic related to delivery.shopinvader_api_delivery_carrier
contains all FastAPI schemas and services:delivery_carrier
router, with a route to search ondelivery.carrier
, filtering by country and/or zipcode.delivery
router, with a route to search on all pickings related to the user.set_carrier
route under thecart
router, to set the carrier on the cart.sync
route under thecart
router that removes the carrier on the cart everytime a new transaction is synchronized.Features & changes
This is a migration to version 16 of
shopinvader_delivery_carrier
but combined with a rewriting to FastAPI, which means that some features are not integrated (yet?). Here is a summary of the differences:shopinvader.backend
to configure which delivery order states are visible. This configuration was used to filter the visible pickings on the front side.The notion of shopinvader backend is not kept in v16 and we don't need this configuration for now, so we don't preserve it here.
deliveries
to download thestock.action_report_delivery
report. We didn't keep this feature for now.Here the route is authenticated so the partner will never be anonymous.