Update stubs

This commit is contained in:
Trinh Anh Ngoc
2023-11-20 21:15:48 +07:00
parent 5aadc64ba2
commit 7c29eaef8d
9 changed files with 4 additions and 32 deletions

View File

@@ -50,7 +50,6 @@ def returns(
model: str | None, downgrade: Callable | None = ..., upgrade: Callable | None = ...
) -> Callable[[_T], _T]: ...
def downgrade(method: Callable, value, self, args, kwargs): ...
def split_context(method: Callable, args, kwargs) -> tuple: ...
def autovacuum(method: _CallableT) -> _CallableT: ...
def model(method: _CallableT) -> _CallableT: ...
def model_create_single(method: _CallableT) -> _CallableT: ...
@@ -113,7 +112,6 @@ class Environment(Mapping[str, BaseModel]):
def not_to_compute(self, field: Field, records: _ModelT) -> _ModelT: ...
def add_to_compute(self, field: Field, records: BaseModel): ...
def remove_to_compute(self, field: Field, records: BaseModel) -> None: ...
def norecompute(self) -> Generator[None, None, None]: ...
def cache_key(self, field: Field): ...
class Transaction:

View File

@@ -70,7 +70,6 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
help: str | None
readonly: bool
required: bool
states: dict[str, list[tuple]] | None
groups: str | None
change_default: bool
related_field: Field | None
@@ -205,7 +204,6 @@ class Monetary(Field[float]):
class _String(Field[str]):
translate: Callable | bool
unaccent: bool
def __init__(self, string: str = ..., **kwargs) -> None: ...
def get_trans_terms(self, value) -> list: ...
def get_text_content(self, term): ...
@@ -433,7 +431,6 @@ class Properties(Field):
column_type: tuple[str, str]
copy: bool
prefetch: bool
unaccent: bool
write_sequence: int
store: bool
readonly: bool

View File

@@ -282,7 +282,6 @@ class BaseModel(metaclass=MetaModel):
orderby: str | None = ...,
lazy: bool = ...,
) -> list[dict[str, Any]]: ...
def _inherits_join_calc(self, alias: str, fname: str, query: Query) -> str: ...
def _field_to_sql(
self, alias: str, fname: str, query: Query | None = ...
) -> SQL: ...
@@ -375,7 +374,6 @@ class BaseModel(metaclass=MetaModel):
def _order_field_to_sql(
self, alias: str, field_name: str, direction: SQL, nulls: SQL, query: Query
) -> SQL: ...
def _generate_order_by(self, order_spec: str | None, query: Query) -> str: ...
def _flush_search(
self,
domain: list,

View File

@@ -16,7 +16,6 @@ def initialize_sys_path() -> None: ...
def get_module_path(
module: str, downloaded: bool = ..., display_warning: bool = ...
) -> str | Literal[False]: ...
def get_module_filetree(module: str, dir: str = ...) -> dict: ...
def get_resource_path(module: str, *args) -> str | Literal[False]: ...
get_module_resource = get_resource_path

View File

@@ -14,6 +14,7 @@ _SavepointT = TypeVar("_SavepointT", bound=Savepoint)
def undecimalize(symb, cr: Cursor) -> float | None: ...
DECIMAL_TO_FLOAT_TYPE: Any
real_time: Callable
re_from: Pattern
re_into: Pattern

View File

@@ -18,6 +18,7 @@ from ..tools import mute_logger, profiler
from ..tools._vendor.sessions import Session
from ..tools.profiler import Profiler
from . import case
from .form import Form as Form
from .result import OdooTestResult
_T = TypeVar("_T")

View File

@@ -1,3 +1,4 @@
from functools import wraps as wraps
from json import JSONEncoder as JSONEncoder
from typing import Callable, Generic, TypeVar
@@ -22,7 +23,6 @@ def synchronized(lock_attr: str = ...) -> Callable[[_T], _T]: ...
locked: Callable[[_T], _T]
def frame_codeinfo(fframe, back: int = ...) -> tuple[str | None, str | None]: ...
def compose(a: Callable[..., _T], b: Callable) -> Callable[..., _T]: ...
class _ClassProperty(property, Generic[_T]):
def __get__(self, cls, owner) -> _T: ...

View File

@@ -8,7 +8,6 @@ from types import FrameType, ModuleType
from typing import (
IO,
Any,
AnyStr,
Callable,
Collection,
Generic,
@@ -45,15 +44,8 @@ SKIPPED_ELEMENT_TYPES: tuple
NON_BREAKING_SPACE: str
def find_in_path(name: str) -> str: ...
def exec_command_pipe(
name: str, *args
) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def find_pg_tool(name: str) -> str: ...
def exec_pg_environ() -> dict[str, str]: ...
def exec_pg_command(name: str, *args) -> None: ...
def exec_pg_command_pipe(
name: str, *args
) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def file_path(
file_path: str, filter_ext: tuple[str, ...] = ..., env: Environment | None = ...
) -> str: ...
@@ -78,20 +70,11 @@ class PatchedWorkbook(xlwt.Workbook):
class PatchedXlsxWorkbook(xlsxwriter.Workbook):
def add_worksheet(self, name: str | None = ..., **kw) -> Worksheet: ...
def to_xml(s: str) -> str: ...
def get_iso_codes(lang: str) -> str: ...
def scan_languages() -> list[tuple[str, str]]: ...
def mod10r(number: str) -> str: ...
def str2bool(s: str, default: Any | None = ...) -> bool: ...
def human_size(sz) -> str: ...
def logged(f: _CallableT) -> _CallableT: ...
class profile:
fname: str | None
def __init__(self, fname: str | None = ...) -> None: ...
def __call__(self, f: _CallableT) -> _CallableT: ...
def detect_ip_addr() -> str: ...
DEFAULT_SERVER_DATE_FORMAT: str
DEFAULT_SERVER_TIME_FORMAT: str
@@ -105,10 +88,6 @@ def split_every(
n: int, iterable: Iterable[_T], piece_maker: Callable[[Iterable[_T]], _T1] = ...
) -> Iterator[_T1]: ...
raise_error: object
def resolve_attr(obj, attr: str, default: object = ...): ...
def attrgetter(*items): ...
def discardattr(obj, key: str) -> None: ...
def remove_accents(input_str: str) -> str: ...

View File

@@ -1,10 +1,9 @@
from re import Pattern
from typing import BinaryIO, Callable, Iterable
from typing import BinaryIO, Callable
WINDOWS_RESERVED: Pattern
def clean_filename(name: str, replacement: str = ...) -> str: ...
def listdir(dir: str, recursive: bool = ...) -> Iterable[str]: ...
def zip_dir(
path: str,
stream: str | BinaryIO,