Skip to content

[IMP] base_rest_pydantic: compatibility pydantic v2 and pydantic v1 #493

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

Draft
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base_rest_pydantic/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"installable": True,
"external_dependencies": {
"python": [
"pydantic<2",
"pydantic",
]
},
}
2 changes: 1 addition & 1 deletion base_rest_pydantic/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from odoo.addons.base_rest import restapi

from pydantic import BaseModel, ValidationError, validate_model
from pydantic.v1 import BaseModel, ValidationError, validate_model


def replace_ref_in_schema(item, original_schema):
Expand Down
2 changes: 1 addition & 1 deletion base_rest_pydantic/tests/test_from_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from odoo.exceptions import UserError
from odoo.tests.common import SavepointCase

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from .. import restapi

Expand Down
2 changes: 1 addition & 1 deletion base_rest_pydantic/tests/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from odoo.tests.common import SavepointCase

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from .. import restapi

Expand Down
Loading