Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-15 00:07:24 +07:00
parent 9dfe81f281
commit 3cf94fd738

View File

@@ -1,6 +1,6 @@
import datetime import datetime
import enum import enum
from typing import Any, Callable, Iterator, Sequence, TypeVar, Union from typing import Any, Callable, Container, Iterator, Sequence, TypeVar, Union
import psycopg2 import psycopg2
from markupsafe import Markup from markupsafe import Markup
@@ -21,6 +21,7 @@ DATE_LENGTH: int
DATETIME_LENGTH: int DATETIME_LENGTH: int
NO_ACCESS: str NO_ACCESS: str
IR_MODELS: tuple[str, ...] IR_MODELS: tuple[str, ...]
NoneType: type[None]
Default: object Default: object
def first(records: _ModelT) -> _ModelT: ... def first(records: _ModelT) -> _ModelT: ...
@@ -35,8 +36,6 @@ class Field(metaclass=MetaField):
relational: bool relational: bool
translate: bool translate: bool
column_type: tuple[str, str] | None column_type: tuple[str, str] | None
column_format: str
column_cast_from: tuple[str, ...]
write_sequence: int write_sequence: int
args: Any args: Any
_module: str _module: str
@@ -62,6 +61,7 @@ class Field(metaclass=MetaField):
recursive: bool recursive: bool
compute: str | Callable | None compute: str | Callable | None
compute_sudo: bool compute_sudo: bool
precompute: bool
inverse: str | Callable | None inverse: str | Callable | None
search: str | Callable | None search: str | Callable | None
related: str | None related: str | None
@@ -75,11 +75,11 @@ class Field(metaclass=MetaField):
states: dict[str, list[tuple]] | None states: dict[str, list[tuple]] | None
groups: str | None groups: str | None
change_default: bool change_default: bool
deprecated: bool | None
related_field: Field | None related_field: Field | None
group_operator: str | None group_operator: str | None
group_expand: str | None group_expand: str | None
prefetch: bool prefetch: bool
default_export_compatible: bool
related_attrs: list[tuple[str, str]] related_attrs: list[tuple[str, str]]
description_attrs: list[tuple[str, str]] description_attrs: list[tuple[str, str]]
def __init__(self, string: str = ..., **kwargs) -> None: ... def __init__(self, string: str = ..., **kwargs) -> None: ...
@@ -113,7 +113,9 @@ class Field(metaclass=MetaField):
def _inverse_company_dependent(self, records: BaseModel) -> None: ... def _inverse_company_dependent(self, records: BaseModel) -> None: ...
def _search_company_dependent(self, records: BaseModel, operator: str, value): ... def _search_company_dependent(self, records: BaseModel, operator: str, value): ...
def resolve_depends(self, registry: Registry) -> Iterator[tuple]: ... def resolve_depends(self, registry: Registry) -> Iterator[tuple]: ...
def get_description(self, env: Environment) -> dict[str, Any]: ... def get_description(self, env: Environment, attributes: Container[str] | None = ...) -> dict[str, Any]: ...
_description_name: str
_description_type: str
_description_store: bool | None _description_store: bool | None
_description_manual: Any _description_manual: Any
_description_related: str | None _description_related: str | None
@@ -123,8 +125,8 @@ class Field(metaclass=MetaField):
_description_states: dict[str, list[tuple]] | None _description_states: dict[str, list[tuple]] | None
_description_groups: str | None _description_groups: str | None
_description_change_default: bool _description_change_default: bool
_description_deprecated: bool | None
_description_group_operator: str | None _description_group_operator: str | None
_description_default_export_compatible: bool
def _description_depends(self, env: Environment): ... def _description_depends(self, env: Environment): ...
@property @property
def _description_searchable(self) -> bool: ... def _description_searchable(self) -> bool: ...
@@ -143,8 +145,11 @@ class Field(metaclass=MetaField):
def convert_to_onchange(self, value, record: BaseModel, names): ... def convert_to_onchange(self, value, record: BaseModel, names): ...
def convert_to_export(self, value, record: BaseModel): ... def convert_to_export(self, value, record: BaseModel): ...
def convert_to_display_name(self, value, record: BaseModel): ... def convert_to_display_name(self, value, record: BaseModel): ...
@property
def column_order(self) -> int: ...
def update_db(self, model: BaseModel, columns: dict[str, Any]): ... def update_db(self, model: BaseModel, columns: dict[str, Any]): ...
def update_db_column(self, model: BaseModel, column: dict | None) -> None: ... def update_db_column(self, model: BaseModel, column: dict | None) -> None: ...
def _convert_db_column(self, model: BaseModel, column: dict | None) -> None: ...
def update_db_notnull(self, model: BaseModel, column: dict | None) -> None: ... def update_db_notnull(self, model: BaseModel, column: dict | None) -> None: ...
def update_db_related(self, model: BaseModel) -> None: ... def update_db_related(self, model: BaseModel) -> None: ...
def read(self, records: BaseModel) -> None: ... def read(self, records: BaseModel) -> None: ...
@@ -178,7 +183,6 @@ class Integer(Field):
class Float(Field): class Float(Field):
type: str type: str
column_cast_from: tuple[str, str, str]
_digits: tuple[int, int] | str | None _digits: tuple[int, int] | str | None
group_operator: str group_operator: str
def __init__(self, string: str = ..., digits: tuple[int, int] | str | None =..., **kwargs) -> None: ... def __init__(self, string: str = ..., digits: tuple[int, int] | str | None =..., **kwargs) -> None: ...
@@ -199,7 +203,6 @@ class Monetary(Field):
type: str type: str
write_sequence: int write_sequence: int
column_type: tuple[str, str] column_type: tuple[str, str]
column_cast_from: tuple[str]
currency_field: str | None currency_field: str | None
group_operator: str group_operator: str
def __init__(self, string: str = ..., currency_field : str =..., **kwargs) -> None: ... def __init__(self, string: str = ..., currency_field : str =..., **kwargs) -> None: ...
@@ -215,13 +218,21 @@ class Monetary(Field):
class _String(Field): class _String(Field):
translate: Callable | bool translate: Callable | bool
prefetch: Any unaccent: bool
def __init__(self, string: str = ..., **kwargs) -> None: ... def __init__(self, string: str = ..., **kwargs) -> None: ...
def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
_related_translate: bool _related_translate: bool
def _description_translate(self, env: Environment) -> bool: ... def _description_translate(self, env: Environment) -> bool: ...
def _convert_db_column(self, model: BaseModel, column: dict) -> None: ...
def get_trans_terms(self, value) -> list: ... def get_trans_terms(self, value) -> list: ...
def get_text_content(self, term): ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
def _convert_from_cache_to_column(self, value): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_write(self, value, record: BaseModel): ...
def get_trans_func(self, records: BaseModel) -> Callable: ... def get_trans_func(self, records: BaseModel) -> Callable: ...
def get_translation_dictionary(self, from_lang_value: str, to_lang_values: dict) -> dict: ...
def _get_stored_translations(self, record: BaseModel) -> dict[str, str]: ...
def write(self, records: _ModelT, value) -> _ModelT: ... def write(self, records: _ModelT, value) -> _ModelT: ...
class Char(_String): class Char(_String):