Update stubs

This commit is contained in:
Trinh Anh Ngoc
2024-01-27 21:05:09 +07:00
parent d96b2f40bb
commit 83118b2043
5 changed files with 16 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
from codecs import CodecInfo
from re import Pattern
from . import addons as addons
from . import api as api
from . import conf as conf
@@ -18,6 +21,8 @@ from .tools.translate import _lt as _lt
evented: bool
multi_process: bool
iso8859_8: CodecInfo
iso8859_8ie_re: Pattern
SUPERUSER_ID: int
def registry(database_name: str | None = ...) -> Registry: ...

View File

@@ -67,12 +67,18 @@ class Environment(Mapping[str, BaseModel]):
@classmethod
def manage(cls) -> Generator[None, None, None]: ...
def reset(self) -> None: ...
uid_origin: int | None
all: Transaction
transaction: Transaction
registry: Registry
cache: Cache
def __new__(
cls, cr: Cursor, uid: int | None, context: dict, su: bool = ...
cls,
cr: Cursor,
uid: int | None,
context: dict,
su: bool = ...,
uid_origin: int | None = ...,
) -> Environment: ...
def __contains__(self, model_name) -> bool: ...
def __getitem__(self, model_name: str) -> BaseModel: ...

View File

@@ -16,6 +16,7 @@ from typing import (
import psycopg2
from markupsafe import Markup
from . import SUPERUSER_ID as SUPERUSER_ID
from .api import Environment, Registry
from .models import BaseModel
from .tools import date_utils, float_utils
@@ -433,6 +434,7 @@ class Properties(Field):
definition_record_field: str | None
ALLOWED_TYPES: tuple[str, ...]
compute: Callable
def setup_related(self, model: BaseModel) -> None: ...
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
): ...

View File

@@ -104,6 +104,7 @@ class BaseModel(metaclass=MetaModel):
_fold_name: str
_translate: bool
_check_company_auto: bool
_allow_sudo_commands: bool
_depends: dict[str, Iterable[str]]
_transient_max_count: int
_transient_max_hours: float

View File

@@ -5,6 +5,7 @@ from dateutil.relativedelta import relativedelta
_DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime)
def date_type(value: _DateTimeT) -> type[_DateTimeT]: ...
def get_month(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
def get_quarter_number(date: _DateTimeT) -> int: ...
def get_quarter(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...