-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
176 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# generated from manifests external_dependencies | ||
extendable_pydantic | ||
fastapi | ||
pydantic |
1 change: 1 addition & 0 deletions
1
setup/shopinvader_api_address/odoo/addons/shopinvader_api_address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../shopinvader_api_address |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
setup/shopinvader_schema_address/odoo/addons/shopinvader_schema_address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../shopinvader_schema_address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import services | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Shopinvader Api Address", | ||
"summary": """ | ||
Adds profile and address Fastapi""", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "ACSONE SA/NV,Odoo Community Association (OCA)", | ||
"website": "https://github.com/shopinvader/odoo-shopinvader", | ||
"depends": [ | ||
"fastapi", | ||
"shopinvader_schema_address", | ||
"extendable_fastapi", | ||
], | ||
"data": [], | ||
"demo": [], | ||
"external_dependencies": {"python": ["fastapi", "extendable_pydantic", "pydantic"]}, | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import fast_api_endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from fastapi import APIRouter | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class FastapiEndpoint(models.Model): | ||
|
||
_inherit = "fastapi.endpoint" | ||
|
||
app: str = fields.Selection( | ||
selection_add=[("address", "Address Endpoint")], ondelete={"address": "cascade"} | ||
) | ||
|
||
@api.model | ||
def _get_fastapi_routers(self): | ||
if self.app == "address": | ||
return [address_api_router] | ||
return super().get_fastapi_routers() | ||
|
||
|
||
# create a router | ||
address_api_router = APIRouter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ This file is optional, it should explain how to configure | ||
the module before using it; it is aimed at advanced users. ] | ||
|
||
To configure this module, you need to: | ||
|
||
#. Go to ... | ||
|
||
.. figure:: ../static/description/image.png | ||
:alt: alternative description | ||
:width: 600 px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Firstname Lastname <[email protected]> (optional company website url) | ||
* Second Person <[email protected]> (optional company website url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ This file is optional and contains additional credits, other than | ||
authors, contributors, and maintainers. ] | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* Company 1 name | ||
* Company 2 name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ This file must be max 2-3 paragraphs, and is required. ] | ||
|
||
This module extends the functionality of ... to support ... | ||
and to allow you to ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ The change log. The goal of this file is to help readers | ||
understand changes between version. The primary audience is | ||
end users and integrators. Purely technical changes such as | ||
code refactoring must not be mentioned here. | ||
|
||
This file may contain ONE level of section titles, underlined | ||
with the ~ (tilde) character. Other section markers are | ||
forbidden and will likely break the structure of the README.rst | ||
or other documents where this fragment is included. ] | ||
|
||
11.0.x.y.z (YYYY-MM-DD) | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* [BREAKING] Breaking changes come first. | ||
(`#70 <https://github.com/OCA/repo/issues/70>`_) | ||
* [ADD] New feature. | ||
(`#74 <https://github.com/OCA/repo/issues/74>`_) | ||
* [FIX] Correct this. | ||
(`#71 <https://github.com/OCA/repo/issues/71>`_) | ||
|
||
11.0.x.y.z (YYYY-MM-DD) | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ This file must only be present if there are very specific | ||
installation instructions, such as installing non-python | ||
dependencies. The audience is systems administrators. ] | ||
|
||
To install this module, you need to: | ||
|
||
#. Do this ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ Enumerate known caveats and future potential improvements. | ||
It is mostly intended for end-users, and can also help | ||
potential new contributors discovering new features to implement. ] | ||
|
||
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ This file must be present and contains the usage instructions | ||
for end-users. As all other rst files included in the README, | ||
it MUST NOT contain reStructuredText sections | ||
only body text (paragraphs, lists, tables, etc). Should you need | ||
a more elaborate structure to explain the addon, please create a | ||
Sphinx documentation (which may include this file as a "quick start" | ||
section). ] | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import address_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from fastapi import Depends | ||
|
||
from odoo.api import Environment | ||
|
||
from odoo.addons.fastapi.depends import odoo_env, paging | ||
from odoo.addons.fastapi.schemas import PagedCollection, Paging | ||
from odoo.addons.shopinvader_schema_address.schema.address import Address | ||
|
||
from ..models.fast_api_endpoint import address_api_router | ||
|
||
|
||
@address_api_router.get("/", response_model=PagedCollection[Address]) | ||
def get_address( | ||
paging: Paging = Depends(paging), | ||
env: Environment = Depends(odoo_env), # use authenticated_partner_env | ||
) -> PagedCollection[Address]: | ||
"""Get the list of Address""" | ||
count = env["res.partner"].search_count([]) | ||
partners = ( | ||
env["res.partner"].sudo().search([], limit=paging.limit, offset=paging.offset) | ||
) | ||
return PagedCollection[Address]( | ||
total=count, | ||
items=[Address.from_orm(rec) for rec in partners], | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import schema | ||
from . import schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
|
||
This module extends the functionality of ... to support ... | ||
and to allow you to ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters