From c352bfb67e3ba6ba1a42fd658c454076b1bf376a Mon Sep 17 00:00:00 2001 From: Trinh Anh Ngoc Date: Thu, 27 Jul 2023 10:42:48 +0700 Subject: [PATCH] Update stubs --- odoo-stubs/models.pyi | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/odoo-stubs/models.pyi b/odoo-stubs/models.pyi index 8b3f68c..d1a3037 100644 --- a/odoo-stubs/models.pyi +++ b/odoo-stubs/models.pyi @@ -1,5 +1,5 @@ from collections import MutableMapping -from typing import Any, Callable, Dict, Generator, List, TypeVar, overload +from typing import Any, Callable, Dict, Generator, List, Literal, TypeVar, overload from . import api, fields from .api import Environment @@ -137,14 +137,24 @@ class BaseModel: def get_formview_action(self): ... def get_access_action(self): ... def search_count(self, args) -> int: ... + @overload def search( self: _ModelT, args, offset: int = ..., - limit: Any | None = ..., - order: Any | None = ..., - count: bool = ..., + limit: int | None = ..., + order: str | None = ..., + count: Literal[False] = ..., ) -> _ModelT: ... + @overload + def search( + self: _ModelT, + args, + offset: int = ..., + limit: int | None = ..., + order: str | None = ..., + count: Literal[True] = ..., + ) -> int: ... def _compute_display_name(self) -> None: ... def name_get(self): ... def name_create(self, name): ...