diff --git a/odoo-stubs/__init__.pyi b/odoo-stubs/__init__.pyi index b7c3df8..1c79de1 100644 --- a/odoo-stubs/__init__.pyi +++ b/odoo-stubs/__init__.pyi @@ -14,19 +14,6 @@ SUPERUSER_ID: int def registry(database_name: Optional[Any] = ...): ... -from . import addons -from . import conf -from . import loglevels -from . import modules -from . import netsvc -from . import osv -from . import release -from . import service -from . import sql_db -from . import tools -from . import models -from . import fields -from . import api -from . import cli -from . import http +from . import (addons, exceptions, conf, loglevels, modules, netsvc, osv, release, + service, sql_db, tools, models, fields, api, cli, http) from .tools.translate import _ as _ diff --git a/odoo-stubs/api.pyi b/odoo-stubs/api.pyi index 59133d2..d42a9bc 100644 --- a/odoo-stubs/api.pyi +++ b/odoo-stubs/api.pyi @@ -5,6 +5,8 @@ from collections import Mapping from typing import Any, Optional +from .sql_db import Cursor + class Params: args: Any = ... kwargs: Any = ... @@ -37,6 +39,9 @@ def guess(method: Any): ... def call_kw(model: Any, name: Any, args: Any, kwargs: Any): ... class Environment(Mapping): + cr: Cursor = ... + uid: int = ... + context: dict = ... def envs(cls): ... @classmethod def manage(cls) -> None: ... diff --git a/odoo-stubs/http.pyi b/odoo-stubs/http.pyi index 1ae394d..b1e28dc 100644 --- a/odoo-stubs/http.pyi +++ b/odoo-stubs/http.pyi @@ -1,6 +1,14 @@ +# Stubs for odoo.http (Python 3) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + from typing import Any, Optional, Union -import werkzeug.wsgi +from werkzeug.contrib.sessions import Session +import werkzeug.wrappers + +from .api import Environment +from .sql_db import Cursor rpc_request: Any rpc_response: Any @@ -16,17 +24,17 @@ def local_redirect(path: Any, query: Optional[Any] = ..., keep_hash: bool = ..., def redirect_with_hash(url: Any, code: int = ...): ... class WebRequest: - httprequest: Any = ... - httpresponse: Any = ... + httprequest: werkzeug.wrappers.Request = ... + httpresponse: Response = ... disable_db: bool = ... endpoint: Any = ... endpoint_arguments: Any = ... auth_method: Any = ... def __init__(self, httprequest: Any) -> None: ... @property - def cr(self): ... + def cr(self) -> Cursor: ... @property - def uid(self): ... + def uid(self) -> int: ... @uid.setter def uid(self, val: Any) -> None: ... @property @@ -34,10 +42,12 @@ class WebRequest: @context.setter def context(self, val: Any) -> None: ... @property - def env(self): ... + def env(self) -> Environment: ... context: Any = ... + @property def lang(self): ... - def session(self): ... + @property + def session(self) -> OpenERPSession: ... def __enter__(self): ... uid: Any = ... def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ... @@ -96,7 +106,7 @@ def routing_map(modules: Any, nodb_only: Any, converters: Optional[Any] = ...): class AuthenticationError(Exception): ... class SessionExpiredException(Exception): ... -class OpenERPSession(werkzeug.contrib.sessions.Session): +class OpenERPSession(Session): inited: bool = ... modified: bool = ... rotate: bool = ... diff --git a/odoo-stubs/models.pyi b/odoo-stubs/models.pyi index 56c2545..224a319 100644 --- a/odoo-stubs/models.pyi +++ b/odoo-stubs/models.pyi @@ -1,3 +1,7 @@ +# Stubs for odoo.models (Python 3) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + from collections import MutableMapping from typing import Any, Optional, List, Union, Sequence, Tuple, Dict, Generator