Update stubs

This commit is contained in:
Trinh Anh Ngoc
2021-11-09 19:07:30 +07:00
parent af28764dd1
commit 0ae7f6d4e0

View File

@@ -1,7 +1,12 @@
from collections import defaultdict
from weakref import WeakSet
from collections.abc import Mapping from collections.abc import Mapping
from typing import Any, Optional from typing import Any, Optional
from odoo.modules.registry import Registry
from odoo.sql_db import Cursor from odoo.sql_db import Cursor
from odoo.tools import StackMap
__all__: Any __all__: Any
_logger: Any _logger: Any
@@ -44,30 +49,29 @@ class Environment(Mapping):
cr: Cursor = ... cr: Cursor = ...
uid: int = ... uid: int = ...
context: dict = ... context: dict = ...
@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 = ...
all: Any = ... all: Environments = ...
def __new__(cls, cr: Any, uid: Any, context: Any, su: bool = ...) -> Environment: ... def __new__(cls, cr: Cursor, uid: Any, context: Any, su: bool = ...) -> 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] = ..., su: Optional[Any] = ...) -> Environment: ... def __call__(self, cr: Optional[Any] = ..., user: Optional[Any] = ..., context: Optional[Any] = ..., su: 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 = ...): ...
def is_superuser(self): ... def is_superuser(self) -> bool: ...
def is_admin(self): ... def is_admin(self) -> bool: ...
def is_system(self): ... def is_system(self) -> bool: ...
@property @property
def user(self): def user(self):
return self['res.users'] return self['res.users']
@@ -94,11 +98,11 @@ 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 = ...
protected: Any = ... protected: StackMap = ...
tocompute: Any = ... tocompute: defaultdict = ...
towrite: Any = ... towrite: defaultdict = ...
def __init__(self): ... def __init__(self): ...
def add(self, env: Any) -> None: ... def add(self, env: Any) -> None: ...
def __iter__(self) -> Any: ... def __iter__(self) -> Any: ...