Update stubs

This commit is contained in:
Trinh Anh Ngoc
2024-07-08 15:53:46 +07:00
parent 257cc1fb74
commit e5eb1dd8c1
9 changed files with 17 additions and 12 deletions

View File

@@ -61,10 +61,8 @@ class Environment(Mapping[str, BaseModel]):
uid: int = ... uid: int = ...
context: dict[str, Any] = ... context: dict[str, Any] = ...
su: bool = ... su: bool = ...
args: tuple[Cursor, int, dict, bool]
def reset(self) -> None: ... def reset(self) -> None: ...
uid_origin: int | None uid_origin: int | None
all: Transaction
transaction: Transaction transaction: Transaction
registry: Registry registry: Registry
cache: Cache cache: Cache

View File

@@ -121,9 +121,9 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ... def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records: _ModelT, value) -> None: ... def write(self, records: _ModelT, value) -> None: ...
@overload @overload
def __get__(self, record: BaseModel, owner) -> _FieldValueT: ... def __get__(self, record: BaseModel, owner: Any | None = ...) -> _FieldValueT: ...
@overload @overload
def __get__(self: _FieldT, records: None, owner) -> _FieldT: ... def __get__(self: _FieldT, records: None, owner: Any | None = ...) -> _FieldT: ...
def mapped(self, records: BaseModel): ... def mapped(self, records: BaseModel): ...
def __set__(self, records: BaseModel, value): ... def __set__(self, records: BaseModel, value): ...
def recompute(self, records: BaseModel) -> None: ... def recompute(self, records: BaseModel) -> None: ...

View File

@@ -75,11 +75,12 @@ class Stream:
max_age: int | None max_age: int | None
immutable: bool immutable: bool
size: int | None size: int | None
public: bool
def __init__(self, **kwargs) -> None: ... def __init__(self, **kwargs) -> None: ...
@classmethod @classmethod
def from_path(cls, path: str, filter_ext: tuple[str, ...] = ...) -> Stream: ... def from_path(
@classmethod cls, path: str, filter_ext: tuple[str, ...] = ..., public: bool = ...
def from_attachment(cls, attachment) -> Stream: ... ) -> Stream: ...
@classmethod @classmethod
def from_binary_field(cls, record: BaseModel, field_name: str) -> Stream: ... def from_binary_field(cls, record: BaseModel, field_name: str) -> Stream: ...
def read(self) -> bytes: ... def read(self) -> bytes: ...
@@ -115,7 +116,6 @@ class FilesystemSessionStore(sessions.FilesystemSessionStore):
class Session(MutableMapping): class Session(MutableMapping):
can_save: bool can_save: bool
is_dirty: bool is_dirty: bool
is_explicit: bool
is_new: bool is_new: bool
should_rotate: bool should_rotate: bool
sid: str sid: str

View File

@@ -314,13 +314,17 @@ class BaseModel(metaclass=MetaModel):
self, fields: Collection[str] | None = ..., load: str = ... self, fields: Collection[str] | None = ..., load: str = ...
) -> list[dict[str, Any]]: ... ) -> list[dict[str, Any]]: ...
def update_field_translations( def update_field_translations(
self, field_name: str, translations: dict[str, Any] self,
field_name: str,
translations: dict[str, Any],
source_lang: str | None = ...,
) -> bool: ... ) -> bool: ...
def _update_field_translations( def _update_field_translations(
self, self,
field_name: str, field_name: str,
translations: dict[str, Any], translations: dict[str, Any],
digest: Callable | None = ..., digest: Callable | None = ...,
source_lang: str | None = ...,
) -> bool: ... ) -> bool: ...
def get_field_translations( def get_field_translations(
self, field_name: str, langs: list[str] | None = ... self, field_name: str, langs: list[str] | None = ...

View File

@@ -31,9 +31,9 @@ def domain_combine_anies(domain: list, model: BaseModel) -> list: ...
def prettify_domain(domain: list, pre_indent: int = ...) -> str: ... def prettify_domain(domain: list, pre_indent: int = ...) -> str: ...
def normalize_leaf(element): ... def normalize_leaf(element): ...
def is_operator(element) -> bool: ... def is_operator(element) -> bool: ...
def is_leaf(element, internal: bool = ...) -> bool: ... def is_leaf(element) -> bool: ...
def is_boolean(element) -> bool: ... def is_boolean(element) -> bool: ...
def check_leaf(element, internal: bool = ...) -> None: ... def check_leaf(element) -> None: ...
def get_unaccent_wrapper(cr: Cursor) -> Callable[[Any], str]: ... def get_unaccent_wrapper(cr: Cursor) -> Callable[[Any], str]: ...
class expression: class expression:

View File

@@ -1,6 +1,7 @@
import datetime import datetime
from typing import Iterator, Tuple, TypeVar from typing import Iterator, Tuple, TypeVar
import babel
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
_DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime) _DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime)
@@ -21,3 +22,4 @@ def json_default(obj) -> str: ...
def date_range( def date_range(
start: datetime.datetime, end: datetime.datetime, step: relativedelta = ... start: datetime.datetime, end: datetime.datetime, step: relativedelta = ...
) -> Iterator[datetime.datetime]: ... ) -> Iterator[datetime.datetime]: ...
def weeknumber(locale: babel.Locale, date: datetime.date) -> Tuple[int, int]: ...

View File

@@ -22,3 +22,4 @@ def float_split(value: float, precision_digits: int) -> tuple[int, int]: ...
def json_float_round( def json_float_round(
value: float, precision_digits: int, rounding_method: str = ... value: float, precision_digits: int, rounding_method: str = ...
) -> float: ... ) -> float: ...
def float_invert(value: float) -> float: ...

View File

@@ -26,6 +26,7 @@ def add_banner(
logo: bool = ..., logo: bool = ...,
thickness: float = ..., thickness: float = ...,
) -> BytesIO: ... ) -> BytesIO: ...
def reshape_text(text: str) -> str: ...
class OdooPdfFileReader(PdfFileReader): class OdooPdfFileReader(PdfFileReader):
def getAttachments(self) -> Iterable[tuple[Any, Any]]: ... def getAttachments(self) -> Iterable[tuple[Any, Any]]: ...

View File

@@ -45,7 +45,6 @@ class PeriodicCollector(Collector):
name: str name: str
active: bool active: bool
frame_interval: float frame_interval: float
thread: Thread
last_frame: FrameType | None last_frame: FrameType | None
def __init__(self, interval: float = ...) -> None: ... def __init__(self, interval: float = ...) -> None: ...
def run(self) -> None: ... def run(self) -> None: ...