Skip to content

Commit

Permalink
[18.0][MIG] fastapi: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cormaza committed Nov 20, 2024
1 parent 7f2b580 commit 5353ef2
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 429 deletions.
633 changes: 316 additions & 317 deletions fastapi/README.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fastapi/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Odoo FastAPI",
"summary": """
Odoo FastAPI endpoint""",
"version": "17.0.3.0.1",
"version": "18.0.1.0.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"maintainers": ["lmignon"],
Expand Down
1 change: 1 addition & 0 deletions fastapi/models/fastapi_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def _get_routing_info(self):
f"{self.root_path}/<path:application_path>",
],
"save_session": self.save_http_session,
"readonly": False,
# csrf ?????
}

Expand Down
4 changes: 2 additions & 2 deletions fastapi/routers/demo_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Annotated

from psycopg2 import errorcodes
from psycopg2.errors import OperationalError
from psycopg2.errors import SerializationFailure

from odoo.api import Environment
from odoo.exceptions import AccessError, MissingError, UserError, ValidationError
Expand Down Expand Up @@ -138,7 +138,7 @@ async def retrying_post(
return JSONResponse(content={"retries": tryno, "file": file.decode("utf-8")})


class FakeConcurrentUpdateError(OperationalError):
class FakeConcurrentUpdateError(SerializationFailure):
@property
def pgcode(self):
return errorcodes.SERIALIZATION_FAILURE
208 changes: 102 additions & 106 deletions fastapi/static/description/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions fastapi/views/fastapi_endpoint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<field name="name">fastapi.endpoint.tree (in fastapi)</field>
<field name="model">fastapi.endpoint</field>
<field name="arch" type="xml">
<tree decoration-warning="not registry_sync" decoration-muted="not active">
<list decoration-warning="not registry_sync" decoration-muted="not active">
<field name="active" column_invisible="1" />
<field name="registry_sync" column_invisible="1" />
<field name="name" />
Expand All @@ -104,7 +104,7 @@
icon="fa-refresh"
invisible="registry_sync"
/>
</tree>
</list>
</field>
</record>

Expand All @@ -122,7 +122,7 @@
<record model="ir.actions.act_window" id="fastapi_endpoint_act_window">
<field name="name">FastAPI Endpoint</field>
<field name="res_model">fastapi.endpoint</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
Expand Down
2 changes: 2 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
httpx
odoo-addon-endpoint_route_handler@git+https://github.com/OCA/web-api.git@refs/pull/69/head#subdirectory=endpoint_route_handler

0 comments on commit 5353ef2

Please sign in to comment.