diff --git a/odoo-stubs/api.pyi b/odoo-stubs/api.pyi index c56a903..7238171 100644 --- a/odoo-stubs/api.pyi +++ b/odoo-stubs/api.pyi @@ -61,10 +61,8 @@ class Environment(Mapping[str, BaseModel]): uid: int = ... context: dict[str, Any] = ... su: bool = ... - args: tuple[Cursor, int, dict, bool] def reset(self) -> None: ... uid_origin: int | None - all: Transaction transaction: Transaction registry: Registry cache: Cache diff --git a/odoo-stubs/fields.pyi b/odoo-stubs/fields.pyi index 29280d2..9f2c63e 100644 --- a/odoo-stubs/fields.pyi +++ b/odoo-stubs/fields.pyi @@ -121,9 +121,9 @@ class Field(Generic[_FieldValueT], metaclass=MetaField): def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ... def write(self, records: _ModelT, value) -> None: ... @overload - def __get__(self, record: BaseModel, owner) -> _FieldValueT: ... + def __get__(self, record: BaseModel, owner: Any | None = ...) -> _FieldValueT: ... @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 __set__(self, records: BaseModel, value): ... def recompute(self, records: BaseModel) -> None: ... diff --git a/odoo-stubs/http.pyi b/odoo-stubs/http.pyi index d8cce96..12f6b72 100644 --- a/odoo-stubs/http.pyi +++ b/odoo-stubs/http.pyi @@ -75,11 +75,12 @@ class Stream: max_age: int | None immutable: bool size: int | None + public: bool def __init__(self, **kwargs) -> None: ... @classmethod - def from_path(cls, path: str, filter_ext: tuple[str, ...] = ...) -> Stream: ... - @classmethod - def from_attachment(cls, attachment) -> Stream: ... + def from_path( + cls, path: str, filter_ext: tuple[str, ...] = ..., public: bool = ... + ) -> Stream: ... @classmethod def from_binary_field(cls, record: BaseModel, field_name: str) -> Stream: ... def read(self) -> bytes: ... @@ -115,7 +116,6 @@ class FilesystemSessionStore(sessions.FilesystemSessionStore): class Session(MutableMapping): can_save: bool is_dirty: bool - is_explicit: bool is_new: bool should_rotate: bool sid: str diff --git a/odoo-stubs/models.pyi b/odoo-stubs/models.pyi index c5d5437..ea77ebc 100644 --- a/odoo-stubs/models.pyi +++ b/odoo-stubs/models.pyi @@ -314,13 +314,17 @@ class BaseModel(metaclass=MetaModel): self, fields: Collection[str] | None = ..., load: str = ... ) -> list[dict[str, Any]]: ... 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: ... def _update_field_translations( self, field_name: str, translations: dict[str, Any], digest: Callable | None = ..., + source_lang: str | None = ..., ) -> bool: ... def get_field_translations( self, field_name: str, langs: list[str] | None = ... diff --git a/odoo-stubs/osv/expression.pyi b/odoo-stubs/osv/expression.pyi index b29aed0..8cca2fb 100644 --- a/odoo-stubs/osv/expression.pyi +++ b/odoo-stubs/osv/expression.pyi @@ -31,9 +31,9 @@ def domain_combine_anies(domain: list, model: BaseModel) -> list: ... def prettify_domain(domain: list, pre_indent: int = ...) -> str: ... def normalize_leaf(element): ... def is_operator(element) -> bool: ... -def is_leaf(element, internal: bool = ...) -> bool: ... +def is_leaf(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]: ... class expression: diff --git a/odoo-stubs/tools/date_utils.pyi b/odoo-stubs/tools/date_utils.pyi index d9d531d..b0df30c 100644 --- a/odoo-stubs/tools/date_utils.pyi +++ b/odoo-stubs/tools/date_utils.pyi @@ -1,6 +1,7 @@ import datetime from typing import Iterator, Tuple, TypeVar +import babel from dateutil.relativedelta import relativedelta _DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime) @@ -21,3 +22,4 @@ def json_default(obj) -> str: ... def date_range( start: datetime.datetime, end: datetime.datetime, step: relativedelta = ... ) -> Iterator[datetime.datetime]: ... +def weeknumber(locale: babel.Locale, date: datetime.date) -> Tuple[int, int]: ... diff --git a/odoo-stubs/tools/float_utils.pyi b/odoo-stubs/tools/float_utils.pyi index aca5c68..6f5f571 100644 --- a/odoo-stubs/tools/float_utils.pyi +++ b/odoo-stubs/tools/float_utils.pyi @@ -22,3 +22,4 @@ def float_split(value: float, precision_digits: int) -> tuple[int, int]: ... def json_float_round( value: float, precision_digits: int, rounding_method: str = ... ) -> float: ... +def float_invert(value: float) -> float: ... diff --git a/odoo-stubs/tools/pdf.pyi b/odoo-stubs/tools/pdf.pyi index 1e26f38..6c03f1f 100644 --- a/odoo-stubs/tools/pdf.pyi +++ b/odoo-stubs/tools/pdf.pyi @@ -26,6 +26,7 @@ def add_banner( logo: bool = ..., thickness: float = ..., ) -> BytesIO: ... +def reshape_text(text: str) -> str: ... class OdooPdfFileReader(PdfFileReader): def getAttachments(self) -> Iterable[tuple[Any, Any]]: ... diff --git a/odoo-stubs/tools/profiler.pyi b/odoo-stubs/tools/profiler.pyi index dc4246c..025dc57 100644 --- a/odoo-stubs/tools/profiler.pyi +++ b/odoo-stubs/tools/profiler.pyi @@ -45,7 +45,6 @@ class PeriodicCollector(Collector): name: str active: bool frame_interval: float - thread: Thread last_frame: FrameType | None def __init__(self, interval: float = ...) -> None: ... def run(self) -> None: ...