diff --git a/shopinvader_api_sale/__init__.py b/shopinvader_api_sale/__init__.py index 78ebce7be9..62a5d54f85 100644 --- a/shopinvader_api_sale/__init__.py +++ b/shopinvader_api_sale/__init__.py @@ -1,2 +1 @@ from . import routers -from . import schemas diff --git a/shopinvader_api_sale/routers/sales.py b/shopinvader_api_sale/routers/sales.py index b7f6e651fe..d550fb76ac 100644 --- a/shopinvader_api_sale/routers/sales.py +++ b/shopinvader_api_sale/routers/sales.py @@ -18,9 +18,7 @@ ) from odoo.addons.fastapi.schemas import Paging from odoo.addons.fastapi.utils import FilteredDomainAdapter -from odoo.addons.shopinvader_schema_sale.schemas import Sale - -from ..schemas import SaleSearch +from odoo.addons.shopinvader_schema_sale.schemas import Sale, SaleSearch sale_router = APIRouter(tags=["sales"]) diff --git a/shopinvader_api_sale/schemas.py b/shopinvader_api_sale/schemas.py deleted file mode 100644 index ad0ed878f8..0000000000 --- a/shopinvader_api_sale/schemas.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2023 Akretion (https://www.akretion.com). -# @author Sébastien BEAU -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - - -from odoo.addons.extendable_fastapi import StrictExtendableBaseModel - - -class SaleSearch(StrictExtendableBaseModel): - name: str | None = None - - def to_odoo_domain(self): - if self.name: - return [("name", "ilike", self.name)] - else: - return [] diff --git a/shopinvader_schema_sale/schemas/sale_order.py b/shopinvader_schema_sale/schemas/sale_order.py index 4ca3534de0..beee1655cc 100644 --- a/shopinvader_schema_sale/schemas/sale_order.py +++ b/shopinvader_schema_sale/schemas/sale_order.py @@ -48,3 +48,13 @@ def from_sale_order(cls, odoo_rec): invoicing=InvoicingInfo.from_sale_order(odoo_rec), note=odoo_rec.note or None, ) + + +class SaleSearch(StrictExtendableBaseModel): + name: str | None = None + + def to_odoo_domain(self): + if self.name: + return [("name", "ilike", self.name)] + else: + return []