Update stubs

This commit is contained in:
Trinh Anh Ngoc
2021-11-09 21:40:54 +07:00
parent d4f5ad1eba
commit 4d7dc51a44
6 changed files with 29 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
from . import addons as addons, api as api, cli as cli, conf as conf, fields as fields, http as http, loglevels as loglevels, models as models, netsvc as netsvc, osv as osv, release as release, service as service, sql_db as sql_db, tools as tools from . import addons as addons, api as api, cli as cli, conf as conf, fields as fields, http as http, loglevels as loglevels, models as models, netsvc as netsvc, osv as osv, release as release, service as service, sql_db as sql_db, tools as tools
from odoo.tools.translate import _ as _ from .tools.translate import _ as _
from typing import Any, Optional from typing import Any, Optional
__path__: Any __path__: Any

View File

@@ -1,7 +1,10 @@
from collections import Mapping from collections import Mapping
from weakref import WeakSet
from typing import Any, Optional from typing import Any, Optional
from odoo.sql_db import Cursor from .modules.registry import Registry
from .sql_db import Cursor
__all__: Any __all__: Any
_logger: Any _logger: Any
@@ -63,27 +66,26 @@ class Environment(Mapping):
uid: int = ... uid: int = ...
context: dict = ... context: dict = ...
_local: Any = ... _local: Any = ...
@property envs: Environments = ...
def envs(cls) -> Environments: ...
@classmethod @classmethod
def manage(cls) -> None: ... def manage(cls) -> None: ...
@classmethod @classmethod
def reset(cls) -> None: ... def reset(cls) -> None: ...
registry: Any = ... registry: Registry = ...
cache: Any = ... cache: Cache = ...
_cache_key: Any = ... _cache_key: Any = ...
_protected: Any = ... _protected: Any = ...
dirty: Any = ... dirty: Any = ...
all: Any = ... all: Environments = ...
def __new__(cls, cr: Any, uid: Any, context: Any) -> Environment: ... def __new__(cls, cr: Cursor, uid: Any, context: Any) -> Environment: ...
def __contains__(self, model_name: Any): ... def __contains__(self, model_name: Any) -> bool: ...
def __getitem__(self, model_name: Any): ... def __getitem__(self, model_name: Any): ...
def __iter__(self) -> Any: ... def __iter__(self) -> Any: ...
def __len__(self): ... def __len__(self) -> int: ...
def __eq__(self, other: Any) -> Any: ... def __eq__(self, other: Any) -> bool: ...
def __ne__(self, other: Any) -> Any: ... def __ne__(self, other: Any) -> bool: ...
def __hash__(self) -> Any: ... def __hash__(self) -> int: ...
def __call__(self, cr: Optional[Any] = ..., user: Optional[Any] = ..., context: Optional[Any] = ...) -> Environment: ... def __call__(self, cr: Optional[Cursor] = ..., user: Optional[Any] = ..., context: Optional[Any] = ...) -> Environment: ...
def ref(self, xml_id: Any, raise_if_not_found: bool = ...): ... def ref(self, xml_id: Any, raise_if_not_found: bool = ...): ...
@property @property
def user(self): def user(self):
@@ -113,8 +115,8 @@ class Environment(Mapping):
def cache_key(self, field: Any): ... def cache_key(self, field: Any): ...
class Environments: class Environments:
envs: Any = ... envs: WeakSet = ...
cache: Any = ... cache: Cache = ...
todo: Any = ... todo: Any = ...
mode: bool = ... mode: bool = ...
recompute: bool = ... recompute: bool = ...

View File

@@ -1,9 +1,7 @@
import datetime import datetime
from dateutil.relativedelta import relativedelta as relativedelta
from typing import Any, Optional from typing import Any, Optional
from odoo.tools import date_utils from .tools import date_utils
DATE_LENGTH: Any DATE_LENGTH: Any
DATETIME_LENGTH: Any DATETIME_LENGTH: Any

View File

@@ -1,11 +1,9 @@
import werkzeug.wsgi
import werkzeug.contrib.sessions import werkzeug.contrib.sessions
from datetime import date as date import werkzeug.wsgi
from odoo import fields as fields
from typing import Any, Optional, Union from typing import Any, Optional, Union
from odoo.api import Environment from .api import Environment
from odoo.sql_db import Cursor from .sql_db import Cursor
_logger: Any _logger: Any
rpc_request: Any rpc_request: Any

View File

@@ -1,10 +1,11 @@
from collections import MutableMapping
from typing import Any, Optional, List, Dict, Generator
from . import api, fields from . import api, fields
from .api import Environment from .api import Environment
from .modules.registry import Registry from .modules.registry import Registry
from .sql_db import Cursor from .sql_db import Cursor
from .tools.safe_eval import safe_eval as safe_eval
from collections import MutableMapping
from typing import Any, Optional, List, Dict, Generator
_logger: Any _logger: Any
_schema: Any _schema: Any

View File

@@ -2,9 +2,9 @@ import collections
import unittest import unittest
from typing import Any, Optional from typing import Any, Optional
from odoo.api import Environment from ..api import Environment
from odoo.modules.registry import Registry from ..modules.registry import Registry
from odoo.sql_db import Cursor from ..sql_db import Cursor
_logger: Any _logger: Any
ADDONS_PATH: Any ADDONS_PATH: Any