mirror of
https://github.com/odoo-ide/odoo-stubs.git
synced 2025-05-08 16:52:26 +03:00
isort + black
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
from psycopg2 import connection
|
||||
|
||||
from . import (
|
||||
addons as addons,
|
||||
api as api,
|
||||
conf as conf,
|
||||
fields as fields,
|
||||
http as http,
|
||||
loglevels as loglevels,
|
||||
models as models,
|
||||
netsvc as netsvc,
|
||||
osv as osv,
|
||||
release as release,
|
||||
service as service,
|
||||
sql_db as sql_db,
|
||||
tools as tools
|
||||
)
|
||||
from . import addons as addons
|
||||
from . import api as api
|
||||
from . import conf as conf
|
||||
from . import fields as fields
|
||||
from . import http as http
|
||||
from . import loglevels as loglevels
|
||||
from . import models as models
|
||||
from . import netsvc as netsvc
|
||||
from . import osv as osv
|
||||
from . import release as release
|
||||
from . import service as service
|
||||
from . import sql_db as sql_db
|
||||
from . import tools as tools
|
||||
from .api import Registry
|
||||
from .fields import Command as Command
|
||||
from .tools.translate import _ as _, _lt as _lt
|
||||
from .tools.translate import _ as _
|
||||
from .tools.translate import _lt as _lt
|
||||
|
||||
evented: bool
|
||||
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
from collections import defaultdict
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, KeysView, Literal, Mapping, Optional, Sequence, TypeVar, Union
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Generator,
|
||||
Iterable,
|
||||
Iterator,
|
||||
KeysView,
|
||||
Literal,
|
||||
Mapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
Union,
|
||||
)
|
||||
from weakref import WeakSet
|
||||
|
||||
from .fields import Field
|
||||
from .models import BaseModel
|
||||
from .modules.registry import Registry
|
||||
from .sql_db import Cursor
|
||||
from .tools import frozendict, StackMap
|
||||
from .tools import StackMap, frozendict
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_ModelT = TypeVar('_ModelT', bound=BaseModel)
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_T = TypeVar("_T")
|
||||
_ModelT = TypeVar("_ModelT", bound=BaseModel)
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
|
||||
INHERITED_ATTRS: tuple[str, ...]
|
||||
|
||||
@@ -25,23 +38,32 @@ class Meta(type):
|
||||
|
||||
def attrsetter(attr, value) -> Callable[[_T], _T]: ...
|
||||
def propagate(method1: Callable, method2: _CallableT) -> _CallableT: ...
|
||||
def constrains(*args: str | Callable[[_ModelT], Sequence[str]]) -> Callable[[_T], _T]: ...
|
||||
def constrains(
|
||||
*args: str | Callable[[_ModelT], Sequence[str]]
|
||||
) -> Callable[[_T], _T]: ...
|
||||
def ondelete(*, at_uninstall: bool) -> Callable[[_T], _T]: ...
|
||||
def onchange(*args: str) -> Callable[[_T], _T]: ...
|
||||
def depends(*args: str | Callable[[_ModelT], Sequence[str]]) -> Callable[[_T], _T]: ...
|
||||
def depends_context(*args: str) -> Callable[[_T], _T]: ...
|
||||
def returns(model: str | None, downgrade: Callable | None = ..., upgrade: Callable | None = ...) -> Callable[[_T], _T]: ...
|
||||
def returns(
|
||||
model: str | None, downgrade: Callable | None = ..., upgrade: Callable | None = ...
|
||||
) -> Callable[[_T], _T]: ...
|
||||
def downgrade(method: Callable, value, self, args, kwargs): ...
|
||||
def split_context(method: Callable, args, kwargs) -> tuple: ...
|
||||
def autovacuum(method: _CallableT) -> _CallableT: ...
|
||||
def model(method: _CallableT) -> _CallableT: ...
|
||||
|
||||
def _model_create_single(create: Callable[..., _ModelT], self: _ModelT, arg) -> _ModelT: ...
|
||||
def _model_create_single(
|
||||
create: Callable[..., _ModelT], self: _ModelT, arg
|
||||
) -> _ModelT: ...
|
||||
def model_create_single(method: _CallableT) -> _CallableT: ...
|
||||
def _model_create_multi(create: Callable[..., _ModelT], self: _ModelT, arg) -> _ModelT: ...
|
||||
def _model_create_multi(
|
||||
create: Callable[..., _ModelT], self: _ModelT, arg
|
||||
) -> _ModelT: ...
|
||||
def model_create_multi(method: _CallableT) -> _CallableT: ...
|
||||
def _call_kw_model(method: Callable[..., _ModelT], self: _ModelT, args, kwargs): ...
|
||||
def _call_kw_model_create(method: Callable[..., _ModelT], self: _ModelT, args, kwargs) -> list[int] | int | Literal[False]: ...
|
||||
def _call_kw_model_create(
|
||||
method: Callable[..., _ModelT], self: _ModelT, args, kwargs
|
||||
) -> list[int] | int | Literal[False]: ...
|
||||
def _call_kw_multi(method: Callable[..., _ModelT], self: _ModelT, args, kwargs): ...
|
||||
def call_kw(model: BaseModel, name: str, args, kwargs): ...
|
||||
|
||||
@@ -61,7 +83,9 @@ class Environment(Mapping[str, BaseModel]):
|
||||
cache: Cache
|
||||
_cache_key: dict[Field, Any]
|
||||
_protected: StackMap[Field, set[int]]
|
||||
def __new__(cls, cr: Cursor, uid: int, context: dict, su: bool = ...) -> Environment: ...
|
||||
def __new__(
|
||||
cls, cr: Cursor, uid: int, context: dict, su: bool = ...
|
||||
) -> Environment: ...
|
||||
def __contains__(self, model_name: str) -> bool: ...
|
||||
def __getitem__(self, model_name: str) -> BaseModel: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
@@ -69,24 +93,34 @@ class Environment(Mapping[str, BaseModel]):
|
||||
def __eq__(self, other) -> bool: ...
|
||||
def __ne__(self, other) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __call__(self, cr: Cursor | None = ..., user: Union['odoo.model.res_users', int, None] = ..., context: dict | None = ..., su: bool | None = ...) -> Environment: ...
|
||||
def ref(self, xml_id: str, raise_if_not_found: bool = ...) -> Optional[BaseModel]: ...
|
||||
def __call__(
|
||||
self,
|
||||
cr: Cursor | None = ...,
|
||||
user: Union["odoo.model.res_users", int, None] = ...,
|
||||
context: dict | None = ...,
|
||||
su: bool | None = ...,
|
||||
) -> Environment: ...
|
||||
def ref(
|
||||
self, xml_id: str, raise_if_not_found: bool = ...
|
||||
) -> Optional[BaseModel]: ...
|
||||
def is_superuser(self) -> bool: ...
|
||||
def is_admin(self) -> bool: ...
|
||||
def is_system(self) -> bool: ...
|
||||
@property
|
||||
def user(self) -> 'odoo.model.res_users': ...
|
||||
def user(self) -> "odoo.model.res_users": ...
|
||||
@property
|
||||
def company(self) -> 'odoo.model.res_company': ...
|
||||
def company(self) -> "odoo.model.res_company": ...
|
||||
@property
|
||||
def companies(self) -> 'odoo.model.res_company': ...
|
||||
def companies(self) -> "odoo.model.res_company": ...
|
||||
@property
|
||||
def lang(self) -> str: ...
|
||||
def clear(self) -> None: ...
|
||||
def clear_upon_failure(self): ...
|
||||
def is_protected(self, field: Field, record: BaseModel) -> bool: ...
|
||||
def protected(self, field: Field) -> BaseModel: ...
|
||||
def protecting(self, what, records: Optional[BaseModel] = ...) -> Generator[None, None, None]: ...
|
||||
def protecting(
|
||||
self, what, records: Optional[BaseModel] = ...
|
||||
) -> Generator[None, None, None]: ...
|
||||
def fields_to_compute(self) -> KeysView[Field]: ...
|
||||
def records_to_compute(self, field: Field) -> BaseModel: ...
|
||||
def is_to_compute(self, field: Field, record: BaseModel) -> bool: ...
|
||||
@@ -123,9 +157,13 @@ class Cache:
|
||||
def remove(self, record: BaseModel, field: Field) -> None: ...
|
||||
def get_values(self, records: BaseModel, field: Field) -> Iterator: ...
|
||||
def get_until_miss(self, records: BaseModel, field: Field) -> list: ...
|
||||
def get_records_different_from(self, records: _ModelT, field: Field, value) -> _ModelT: ...
|
||||
def get_records_different_from(
|
||||
self, records: _ModelT, field: Field, value
|
||||
) -> _ModelT: ...
|
||||
def get_fields(self, record: BaseModel) -> Iterator[Field]: ...
|
||||
def get_records(self, model: _ModelT, field: Field) -> _ModelT: ...
|
||||
def get_missing_ids(self, records: BaseModel, field: Field) -> Iterator[int]: ...
|
||||
def invalidate(self, spec: list[tuple[Field, Iterable[int] | None]] | None = ...) -> None: ...
|
||||
def invalidate(
|
||||
self, spec: list[tuple[Field, Iterable[int] | None]] | None = ...
|
||||
) -> None: ...
|
||||
def check(self, env: Environment) -> None: ...
|
||||
|
||||
@@ -9,7 +9,13 @@ class UserError(Exception):
|
||||
def name(self): ...
|
||||
|
||||
class RedirectWarning(Exception):
|
||||
def __init__(self, message: str, action: int, button_text: str, additional_context: dict | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
message: str,
|
||||
action: int,
|
||||
button_text: str,
|
||||
additional_context: dict | None = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def name(self): ...
|
||||
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
import datetime
|
||||
import enum
|
||||
from typing import Any, Callable, Collection, Generic, Iterator, Sequence, Type, TypeVar, Union, overload
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Collection,
|
||||
Generic,
|
||||
Iterator,
|
||||
Sequence,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
|
||||
import psycopg2
|
||||
from markupsafe import Markup
|
||||
@@ -9,15 +20,15 @@ from .api import Environment, Registry
|
||||
from .models import BaseModel
|
||||
from .tools import date_utils, float_utils
|
||||
|
||||
_FieldT = TypeVar('_FieldT', bound=Field)
|
||||
_FieldValueT = TypeVar('_FieldValueT')
|
||||
_ModelT = TypeVar('_ModelT', bound=BaseModel)
|
||||
_FieldT = TypeVar("_FieldT", bound=Field)
|
||||
_FieldValueT = TypeVar("_FieldValueT")
|
||||
_ModelT = TypeVar("_ModelT", bound=BaseModel)
|
||||
_Selection = list[tuple[str, str]]
|
||||
_SelectionRaw = _Selection | Callable[..., _Selection] | str
|
||||
_Domain = list
|
||||
_DomainRaw = _Domain | Callable[..., _Domain]
|
||||
_CommandList = list[tuple[BaseModel, list]]
|
||||
_SeqIntT = TypeVar('_SeqIntT', bound=Sequence[int])
|
||||
_SeqIntT = TypeVar("_SeqIntT", bound=Sequence[int])
|
||||
|
||||
DATE_LENGTH: int
|
||||
DATETIME_LENGTH: int
|
||||
@@ -136,7 +147,9 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
|
||||
def _description_help(self, env: Environment) -> str | None: ...
|
||||
def is_editable(self) -> bool: ...
|
||||
def null(self, record: BaseModel) -> bool: ...
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
): ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
|
||||
def convert_to_record(self, value, record: BaseModel): ...
|
||||
def convert_to_record_multi(self, values, records: BaseModel): ...
|
||||
@@ -166,16 +179,24 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
|
||||
class Boolean(Field[bool]):
|
||||
type: str
|
||||
column_type: tuple[str, str]
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> bool: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> bool: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> bool: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> bool: ...
|
||||
def convert_to_export(self, value, record: BaseModel): ...
|
||||
|
||||
class Integer(Field[int]):
|
||||
type: str
|
||||
column_type: tuple[str, str]
|
||||
group_operator: str
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> int: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> int | None: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> int: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> int | None: ...
|
||||
def convert_to_record(self, value, record: BaseModel): ...
|
||||
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
|
||||
def _update(self, records: BaseModel, value) -> None: ...
|
||||
@@ -186,14 +207,20 @@ class Float(Field[float]):
|
||||
column_cast_from: tuple[str, str, str]
|
||||
_digits: tuple[int, int] | str | None
|
||||
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: ...
|
||||
@property
|
||||
def column_type(self): ...
|
||||
def get_digits(self, env: Environment) -> tuple[int, int]: ...
|
||||
_related__digits: Any
|
||||
def _description_digits(self, env: Environment) -> tuple[int, int]: ...
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> float: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> float: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> float: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> float: ...
|
||||
def convert_to_record(self, value, record: BaseModel): ...
|
||||
def convert_to_export(self, value, record: BaseModel): ...
|
||||
round = float_utils.float_round
|
||||
@@ -207,13 +234,19 @@ class Monetary(Field[float]):
|
||||
column_cast_from: tuple[str]
|
||||
currency_field: str | None
|
||||
group_operator: str
|
||||
def __init__(self, string: str = ..., currency_field : str =..., **kwargs) -> None: ...
|
||||
def __init__(
|
||||
self, string: str = ..., currency_field: str = ..., **kwargs
|
||||
) -> None: ...
|
||||
def _description_currency_field(self, env: Environment) -> str: ...
|
||||
def get_currency_field(self, model: BaseModel) -> str: ...
|
||||
def setup_nonrelated(self, model: BaseModel) -> None: ...
|
||||
def setup_related(self, model: BaseModel) -> None: ...
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> float: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> float: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> float: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> float: ...
|
||||
def convert_to_record(self, value, record: BaseModel): ...
|
||||
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
|
||||
def convert_to_write(self, value, record: BaseModel): ...
|
||||
@@ -242,8 +275,12 @@ class Char(_String):
|
||||
_related_trim: bool
|
||||
_description_size: int | None
|
||||
_description_trim: bool
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> str | None: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> str | None: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> str | None: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> str | None: ...
|
||||
|
||||
class Text(_String):
|
||||
type: str
|
||||
@@ -275,10 +312,16 @@ class Html(_String):
|
||||
_description_sanitize_style: bool
|
||||
_description_strip_style: bool
|
||||
_description_strip_classes: bool
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> Markup | None: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> Markup | None: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> Markup | None: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> Markup | None: ...
|
||||
def convert_to_record(self, value, record: BaseModel) -> Markup | None: ...
|
||||
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...) -> Markup | None: ...
|
||||
def convert_to_read(
|
||||
self, value, record: BaseModel, use_name_get: bool = ...
|
||||
) -> Markup | None: ...
|
||||
def get_trans_terms(self, value) -> list: ...
|
||||
|
||||
class Date(Field[datetime.date]):
|
||||
@@ -292,13 +335,17 @@ class Date(Field[datetime.date]):
|
||||
@staticmethod
|
||||
def today(*args) -> datetime.date: ...
|
||||
@staticmethod
|
||||
def context_today(record: BaseModel, timestamp: datetime.datetime | None = ...) -> datetime.date: ...
|
||||
def context_today(
|
||||
record: BaseModel, timestamp: datetime.datetime | None = ...
|
||||
) -> datetime.date: ...
|
||||
@staticmethod
|
||||
def to_date(value) -> datetime.date | None: ...
|
||||
from_string = to_date
|
||||
@staticmethod
|
||||
def to_string(value: datetime.datetime | datetime.date) -> str: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> datetime.date | None: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> datetime.date | None: ...
|
||||
def convert_to_export(self, value, record: BaseModel): ...
|
||||
|
||||
class Datetime(Field[datetime.datetime]):
|
||||
@@ -314,13 +361,17 @@ class Datetime(Field[datetime.datetime]):
|
||||
@staticmethod
|
||||
def today(*args) -> datetime.datetime: ...
|
||||
@staticmethod
|
||||
def context_timestamp(record: BaseModel, timestamp: datetime.datetime) -> datetime.datetime: ...
|
||||
def context_timestamp(
|
||||
record: BaseModel, timestamp: datetime.datetime
|
||||
) -> datetime.datetime: ...
|
||||
@staticmethod
|
||||
def to_datetime(value) -> datetime.datetime | None: ...
|
||||
from_string = to_datetime
|
||||
@staticmethod
|
||||
def to_string(value: datetime.datetime | datetime.date) -> str: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> datetime.datetime | None: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> datetime.datetime | None: ...
|
||||
def convert_to_export(self, value, record: BaseModel): ...
|
||||
def convert_to_display_name(self, value, record: BaseModel) -> str: ...
|
||||
|
||||
@@ -335,8 +386,12 @@ class Binary(Field[bytes]):
|
||||
def column_type(self) -> tuple[str, str] | None: ...
|
||||
def _get_attrs(self, model_class: Type[BaseModel], name: str) -> dict[str, Any]: ...
|
||||
_description_attachment: bool
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> psycopg2.Binary | None: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> bytes | None: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> psycopg2.Binary | None: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> bytes | None: ...
|
||||
def convert_to_record(self, value, record: BaseModel) -> bytes: ...
|
||||
def compute_value(self, records: BaseModel) -> None: ...
|
||||
def read(self, records: BaseModel) -> None: ...
|
||||
@@ -358,16 +413,22 @@ class Selection(Field[str]):
|
||||
selection: _SelectionRaw
|
||||
validate: bool
|
||||
ondelete: dict[str, Any] | None
|
||||
def __init__(self, selection: _SelectionRaw = ..., string: str = ..., **kwargs) -> None: ...
|
||||
def __init__(
|
||||
self, selection: _SelectionRaw = ..., string: str = ..., **kwargs
|
||||
) -> None: ...
|
||||
def setup_nonrelated(self, model: BaseModel) -> None: ...
|
||||
def setup_related(self, model: BaseModel): ...
|
||||
def _get_attrs(self, model_class: Type[BaseModel], name: str) -> dict[str, Any]: ...
|
||||
def _setup_attrs(self, model_class: Type[BaseModel], name: str) -> None: ...
|
||||
def _selection_modules(self, model: BaseModel) -> dict[str, set[str, str]]: ...
|
||||
def _description_selection(self, env: Environment) -> _Selection: ...
|
||||
def _default_group_expand(self, records: BaseModel, groups, domain, order) -> list[str]: ...
|
||||
def _default_group_expand(
|
||||
self, records: BaseModel, groups, domain, order
|
||||
) -> list[str]: ...
|
||||
def get_values(self, env: Environment) -> list[str]: ...
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
): ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
|
||||
def convert_to_export(self, value, record: BaseModel): ...
|
||||
|
||||
@@ -375,10 +436,16 @@ class Reference(Selection):
|
||||
type: str
|
||||
@property
|
||||
def column_type(self) -> tuple[str, str]: ...
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> str | None: ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> str | None: ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
) -> str | None: ...
|
||||
def convert_to_cache(
|
||||
self, value, record: BaseModel, validate: bool = ...
|
||||
) -> str | None: ...
|
||||
def convert_to_record(self, value, record: BaseModel) -> Union[BaseModel, None]: ...
|
||||
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...) -> str | bool: ...
|
||||
def convert_to_read(
|
||||
self, value, record: BaseModel, use_name_get: bool = ...
|
||||
) -> str | bool: ...
|
||||
def convert_to_export(self, value, record: BaseModel) -> str: ...
|
||||
def convert_to_display_name(self, value, record: BaseModel) -> str: ...
|
||||
|
||||
@@ -404,14 +471,18 @@ class Many2one(_Relational):
|
||||
ondelete: str | None
|
||||
auto_join: bool
|
||||
delegate: bool
|
||||
def __init__(self, comodel_name: str = ..., string: str = ..., **kwargs) -> None: ...
|
||||
def __init__(
|
||||
self, comodel_name: str = ..., string: str = ..., **kwargs
|
||||
) -> None: ...
|
||||
def _setup_attrs(self, model_class: Type[BaseModel], name: str) -> None: ...
|
||||
def setup_nonrelated(self, model: BaseModel) -> None: ...
|
||||
def update_db(self, model: BaseModel, columns): ...
|
||||
def update_db_column(self, model: BaseModel, column) -> None: ...
|
||||
def update_db_foreign_key(self, model: BaseModel, column) -> None: ...
|
||||
def _update(self, records: BaseModel, value) -> None: ...
|
||||
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
|
||||
def convert_to_column(
|
||||
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
|
||||
): ...
|
||||
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
|
||||
def convert_to_record(self, value, record: BaseModel): ...
|
||||
def convert_to_record_multi(self, values, records: BaseModel): ...
|
||||
@@ -477,7 +548,13 @@ class One2many(_RelationalMulti):
|
||||
auto_join: bool
|
||||
limit: int | None
|
||||
copy: bool
|
||||
def __init__(self, comodel_name: str = ..., inverse_name: str = ..., string: str = ..., **kwargs) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
comodel_name: str = ...,
|
||||
inverse_name: str = ...,
|
||||
string: str = ...,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def setup_nonrelated(self, model: BaseModel) -> None: ...
|
||||
_description_relation_field: str | None
|
||||
def update_db(self, model: BaseModel, columns) -> None: ...
|
||||
@@ -495,7 +572,15 @@ class Many2many(_RelationalMulti):
|
||||
auto_join: bool
|
||||
limit: int | None
|
||||
ondelete: str
|
||||
def __init__(self, comodel_name: str =..., relation: str = ..., column1: str = ..., column2: str = ..., string: str = ..., **kwargs) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
comodel_name: str = ...,
|
||||
relation: str = ...,
|
||||
column1: str = ...,
|
||||
column2: str = ...,
|
||||
string: str = ...,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def setup_nonrelated(self, model: BaseModel) -> None: ...
|
||||
def update_db(self, model: BaseModel, columns) -> None: ...
|
||||
def update_db_foreign_keys(self, model: BaseModel) -> None: ...
|
||||
|
||||
@@ -11,7 +11,7 @@ from .modules.registry import Registry
|
||||
from .sql_db import Cursor
|
||||
from .tools._vendor import sessions
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T = TypeVar("_T")
|
||||
|
||||
rpc_request: Logger
|
||||
rpc_response: Logger
|
||||
@@ -33,11 +33,11 @@ class WebRequest:
|
||||
endpoint: EndPoint | None
|
||||
endpoint_arguments: Any
|
||||
auth_method: str | None
|
||||
website: 'odoo.model.website'
|
||||
website: "odoo.model.website"
|
||||
website_routing: int
|
||||
is_frontend: bool
|
||||
is_frontend_multilang: bool
|
||||
lang: 'odoo.model.res_lang'
|
||||
lang: "odoo.model.res_lang"
|
||||
_db: str | None
|
||||
_cr: Cursor | None
|
||||
_uid: int | None
|
||||
@@ -64,7 +64,9 @@ class WebRequest:
|
||||
def set_handler(self, endpoint: EndPoint, arguments, auth) -> None: ...
|
||||
def _handle_exception(self, exception: Exception) -> None: ...
|
||||
def redirect(self, location, code: int = ..., local: bool = ...) -> Response: ...
|
||||
def redirect_query(self, location, query: Any | None = ..., code: int = ..., local: bool = ...) -> Response: ...
|
||||
def redirect_query(
|
||||
self, location, query: Any | None = ..., code: int = ..., local: bool = ...
|
||||
) -> Response: ...
|
||||
def _is_cors_preflight(self, endpoint: EndPoint) -> bool: ...
|
||||
def _call_function(self, *args, **kwargs): ...
|
||||
def registry_cr(self) -> Generator[tuple[Registry, Cursor], None, None]: ...
|
||||
@@ -75,13 +77,15 @@ class WebRequest:
|
||||
def csrf_token(self, time_limit: int | None = ...): ...
|
||||
def validate_csrf(self, csrf) -> bool: ...
|
||||
|
||||
def route(route: str | list[str] | None = ...,
|
||||
type: str = ...,
|
||||
auth: str = ...,
|
||||
methods: list[str] = ...,
|
||||
cors: str = ...,
|
||||
csrf: bool = ...,
|
||||
**kw): ...
|
||||
def route(
|
||||
route: str | list[str] | None = ...,
|
||||
type: str = ...,
|
||||
auth: str = ...,
|
||||
methods: list[str] = ...,
|
||||
cors: str = ...,
|
||||
csrf: bool = ...,
|
||||
**kw
|
||||
): ...
|
||||
|
||||
class JsonRequest(WebRequest):
|
||||
_request_type: str
|
||||
@@ -89,7 +93,9 @@ class JsonRequest(WebRequest):
|
||||
jsonrequest: Any
|
||||
context: dict
|
||||
def __init__(self, *args) -> None: ...
|
||||
def _json_response(self, result: Any | None = ..., error: dict | None = ...) -> Response: ...
|
||||
def _json_response(
|
||||
self, result: Any | None = ..., error: dict | None = ...
|
||||
) -> Response: ...
|
||||
def _handle_exception(self, exception: Exception) -> Response: ...
|
||||
def dispatch(self) -> Response: ...
|
||||
|
||||
@@ -102,8 +108,15 @@ class HttpRequest(WebRequest):
|
||||
def _handle_exception(self, exception: Exception): ...
|
||||
def _is_cors_preflight(self, endpoint: EndPoint) -> bool: ...
|
||||
def dispatch(self): ...
|
||||
def make_response(self, data, headers: list[tuple[str, str]] | None = ..., cookies: dict | None = ...) -> Response: ...
|
||||
def render(self, template, qcontext: dict | None = ..., lazy: bool = ..., **kw) -> Response: ...
|
||||
def make_response(
|
||||
self,
|
||||
data,
|
||||
headers: list[tuple[str, str]] | None = ...,
|
||||
cookies: dict | None = ...,
|
||||
) -> Response: ...
|
||||
def render(
|
||||
self, template, qcontext: dict | None = ..., lazy: bool = ..., **kw
|
||||
) -> Response: ...
|
||||
def not_found(self, description: str | Any | None = ...) -> NotFound: ...
|
||||
|
||||
addons_manifest: dict
|
||||
@@ -112,7 +125,7 @@ controllers_per_module: dict[str, list]
|
||||
class ControllerType(type):
|
||||
def __init__(cls, name: str, bases: tuple, attrs: dict) -> None: ...
|
||||
|
||||
Controller = ControllerType('Controller', (object,), {})
|
||||
Controller = ControllerType("Controller", (object,), {})
|
||||
|
||||
class EndPoint:
|
||||
method: Callable
|
||||
@@ -128,7 +141,9 @@ class EndPoint:
|
||||
def _as_tuple(self) -> tuple[Callable, dict]: ...
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
def _generate_routing_rules(modules: Collection[str], nodb_only: bool, converters: Any | None = ...) -> Generator[tuple[str, EndPoint, dict], None, None]: ...
|
||||
def _generate_routing_rules(
|
||||
modules: Collection[str], nodb_only: bool, converters: Any | None = ...
|
||||
) -> Generator[tuple[str, EndPoint, dict], None, None]: ...
|
||||
|
||||
class AuthenticationError(Exception): ...
|
||||
class SessionExpiredException(Exception): ...
|
||||
@@ -144,7 +159,9 @@ class OpenERPSession(sessions.Session):
|
||||
uid: int
|
||||
db: str | None
|
||||
login: str | None
|
||||
def authenticate(self, db: str, login: str | None = ..., password: str | None = ...) -> int: ...
|
||||
def authenticate(
|
||||
self, db: str, login: str | None = ..., password: str | None = ...
|
||||
) -> int: ...
|
||||
session_token: str | None
|
||||
def finalize(self) -> None: ...
|
||||
def check_security(self) -> None: ...
|
||||
@@ -166,7 +183,12 @@ class Response(werkzeug.Response):
|
||||
template: Any
|
||||
qcontext: dict
|
||||
uid: int
|
||||
def set_default(self, template: Any | None = ..., qcontext: dict | None = ..., uid: int | None = ...) -> None: ...
|
||||
def set_default(
|
||||
self,
|
||||
template: Any | None = ...,
|
||||
qcontext: dict | None = ...,
|
||||
uid: int | None = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def is_qweb(self) -> bool: ...
|
||||
def render(self): ...
|
||||
@@ -189,17 +211,32 @@ class Root:
|
||||
def setup_session(self, httprequest: werkzeug.Request) -> bool: ...
|
||||
def setup_db(self, httprequest: werkzeug.Request) -> None: ...
|
||||
def setup_lang(self, httprequest: werkzeug.Request) -> None: ...
|
||||
def get_request(self, httprequest: werkzeug.Request) -> HttpRequest | JsonRequest: ...
|
||||
def get_response(self, httprequest: werkzeug.Request, result, explicit_session: bool) -> Any: ...
|
||||
def get_request(
|
||||
self, httprequest: werkzeug.Request
|
||||
) -> HttpRequest | JsonRequest: ...
|
||||
def get_response(
|
||||
self, httprequest: werkzeug.Request, result, explicit_session: bool
|
||||
) -> Any: ...
|
||||
def set_csp(self, response: werkzeug.Response) -> None: ...
|
||||
def dispatch(self, environ: dict, start_response: Callable): ...
|
||||
def get_profiler_context_manager(self, request: WebRequest): ...
|
||||
def get_db_router(self, db: str) -> Map: ...
|
||||
|
||||
def db_list(force: bool = ..., httprequest: werkzeug.Request | None = ...) -> list[str]: ...
|
||||
def db_list(
|
||||
force: bool = ..., httprequest: werkzeug.Request | None = ...
|
||||
) -> list[str]: ...
|
||||
def db_filter(dbs, httprequest: werkzeug.Request | None = ...) -> list[str]: ...
|
||||
def db_monodb(httprequest: werkzeug.Request | None = ...) -> str | None: ...
|
||||
def send_file(filepath_or_fp, mimetype: str | None = ..., as_attachment: bool = ..., filename: str | None = ..., mtime: Any | None = ..., add_etags: bool = ..., cache_timeout: int =..., conditional: bool = ...) -> Response: ...
|
||||
def send_file(
|
||||
filepath_or_fp,
|
||||
mimetype: str | None = ...,
|
||||
as_attachment: bool = ...,
|
||||
filename: str | None = ...,
|
||||
mtime: Any | None = ...,
|
||||
add_etags: bool = ...,
|
||||
cache_timeout: int = ...,
|
||||
conditional: bool = ...,
|
||||
) -> Response: ...
|
||||
def content_disposition(filename: str) -> str: ...
|
||||
def set_safe_image_headers(headers, content): ...
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
from collections import defaultdict
|
||||
from re import Pattern
|
||||
from typing import Any, Callable, Collection, Container, Iterable, Iterator, Literal, MutableMapping, Sequence, TypeVar, Union, overload
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Collection,
|
||||
Container,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Literal,
|
||||
MutableMapping,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
|
||||
import psycopg2
|
||||
from lxml.etree import _Element
|
||||
@@ -12,8 +25,8 @@ from .modules.registry import Registry
|
||||
from .osv.query import Query
|
||||
from .sql_db import Cursor
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_ModelT = TypeVar('_ModelT', bound=BaseModel)
|
||||
_T = TypeVar("_T")
|
||||
_ModelT = TypeVar("_ModelT", bound=BaseModel)
|
||||
_Domain = list
|
||||
|
||||
regex_order: Pattern[str]
|
||||
@@ -36,7 +49,9 @@ def trigger_tree_merge(node1: dict, node2: dict) -> None: ...
|
||||
class MetaModel(api.Meta):
|
||||
module_to_models: defaultdict[str, list[type[BaseModel]]]
|
||||
def __new__(meta, name: str, bases: tuple, attrs: dict): ...
|
||||
def __init__(self: type[BaseModel], name: str, bases: tuple, attrs: dict) -> None: ...
|
||||
def __init__(
|
||||
self: type[BaseModel], name: str, bases: tuple, attrs: dict
|
||||
) -> None: ...
|
||||
|
||||
class NewId:
|
||||
__slots__: list[str]
|
||||
@@ -103,11 +118,11 @@ class BaseModel(metaclass=MetaModel):
|
||||
env: Environment = ...
|
||||
pool: Registry
|
||||
id = fields.Id()
|
||||
display_name = fields.Char(string='Display Name')
|
||||
create_uid = fields.Many2one('res.users', string='Created by')
|
||||
create_date = fields.Datetime(string='Created on')
|
||||
write_uid = fields.Many2one('res.users', string='Last Updated by')
|
||||
write_date = fields.Datetime(string='Last Updated on')
|
||||
display_name = fields.Char(string="Display Name")
|
||||
create_uid = fields.Many2one("res.users", string="Created by")
|
||||
create_date = fields.Datetime(string="Created on")
|
||||
write_uid = fields.Many2one("res.users", string="Last Updated by")
|
||||
write_date = fields.Datetime(string="Last Updated on")
|
||||
CONCURRENCY_CHECK_FIELD: str
|
||||
def view_init(self, fields_list: list[str]) -> None: ...
|
||||
def _valid_field_parameter(self, field: Field, name: str) -> bool: ...
|
||||
@@ -119,7 +134,9 @@ class BaseModel(metaclass=MetaModel):
|
||||
@classmethod
|
||||
def _build_model_check_base(model_class, cls: type[BaseModel]) -> None: ...
|
||||
@classmethod
|
||||
def _build_model_check_parent(model_class, cls: type[BaseModel], parent_class: type[BaseModel]) -> None: ...
|
||||
def _build_model_check_parent(
|
||||
model_class, cls: type[BaseModel], parent_class: type[BaseModel]
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def _build_model_attributes(cls, pool: Registry) -> None: ...
|
||||
@classmethod
|
||||
@@ -133,15 +150,31 @@ class BaseModel(metaclass=MetaModel):
|
||||
def __new__(cls) -> None: ...
|
||||
def __init__(self, pool: Registry, cr: Cursor) -> None: ...
|
||||
def _is_an_ordinary_table(self) -> bool: ...
|
||||
def __ensure_xml_id(self: _ModelT, skip: bool = ...) -> Iterator[tuple[_ModelT, str | None]]: ...
|
||||
def _export_rows(self, fields: list[list[str]], *, _is_toplevel_call: bool = ...) -> list[list]: ...
|
||||
def __ensure_xml_id(
|
||||
self: _ModelT, skip: bool = ...
|
||||
) -> Iterator[tuple[_ModelT, str | None]]: ...
|
||||
def _export_rows(
|
||||
self, fields: list[list[str]], *, _is_toplevel_call: bool = ...
|
||||
) -> list[list]: ...
|
||||
__export_rows = _export_rows
|
||||
def export_data(self, fields_to_export: list[str]) -> dict[str, list[list]]: ...
|
||||
def load(self, fields: list[str], data: list[list[str]]) -> dict[str, Any]: ...
|
||||
def _add_fake_fields(self, fields: dict[str | None, Field]) -> dict[str | None, Field]: ...
|
||||
def _extract_records(self, fields_: Iterable[Sequence[str]], data, log: Callable = ..., limit: float = ...) -> Iterator[tuple[BaseModel, dict[str, dict[str, int]]]]: ...
|
||||
def _convert_records(self, records, log: Callable = ...) -> Iterator[tuple[Any, Any, Any, dict]]: ...
|
||||
def _validate_fields(self, field_names: Iterable[str], excluded_names: Iterable[str] = ...) -> None: ...
|
||||
def _add_fake_fields(
|
||||
self, fields: dict[str | None, Field]
|
||||
) -> dict[str | None, Field]: ...
|
||||
def _extract_records(
|
||||
self,
|
||||
fields_: Iterable[Sequence[str]],
|
||||
data,
|
||||
log: Callable = ...,
|
||||
limit: float = ...,
|
||||
) -> Iterator[tuple[BaseModel, dict[str, dict[str, int]]]]: ...
|
||||
def _convert_records(
|
||||
self, records, log: Callable = ...
|
||||
) -> Iterator[tuple[Any, Any, Any, dict]]: ...
|
||||
def _validate_fields(
|
||||
self, field_names: Iterable[str], excluded_names: Iterable[str] = ...
|
||||
) -> None: ...
|
||||
def default_get(self, fields_list: list[str]) -> dict[str, Any]: ...
|
||||
def fields_get_keys(self) -> list[str]: ...
|
||||
def _rec_name_fallback(self) -> str: ...
|
||||
@@ -155,35 +188,126 @@ class BaseModel(metaclass=MetaModel):
|
||||
def _get_default_graph_view(self) -> _Element: ...
|
||||
def _get_default_calendar_view(self) -> _Element: ...
|
||||
def load_views(self, views: list, options: dict | None = ...) -> dict[str, Any]: ...
|
||||
def _fields_view_get(self, view_id: int | None = ..., view_type: str = ..., toolbar: bool = ..., submenu: bool = ...) -> dict[str, Any]: ...
|
||||
def fields_view_get(self, view_id: int | None = ..., view_type: str = ..., toolbar: bool = ..., submenu: bool = ...) -> dict[str, Any]: ...
|
||||
def _fields_view_get(
|
||||
self,
|
||||
view_id: int | None = ...,
|
||||
view_type: str = ...,
|
||||
toolbar: bool = ...,
|
||||
submenu: bool = ...,
|
||||
) -> dict[str, Any]: ...
|
||||
def fields_view_get(
|
||||
self,
|
||||
view_id: int | None = ...,
|
||||
view_type: str = ...,
|
||||
toolbar: bool = ...,
|
||||
submenu: bool = ...,
|
||||
) -> dict[str, Any]: ...
|
||||
def get_formview_id(self, access_uid: int | None = ...): ...
|
||||
def get_formview_action(self, access_uid: int | None = ...) -> dict[str, Any]: ...
|
||||
def get_access_action(self, access_uid: int | None = ...) -> dict[str, Any]: ...
|
||||
def search_count(self, args: _Domain) -> int: ...
|
||||
@overload
|
||||
def search(self: _ModelT, args: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: Literal[False] = ...) -> _ModelT: ...
|
||||
def search(
|
||||
self: _ModelT,
|
||||
args: _Domain,
|
||||
offset: int = ...,
|
||||
limit: int | None = ...,
|
||||
order: str | None = ...,
|
||||
count: Literal[False] = ...,
|
||||
) -> _ModelT: ...
|
||||
@overload
|
||||
def search(self: _ModelT, args: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: Literal[True] = ...) -> int: ...
|
||||
def search(
|
||||
self: _ModelT,
|
||||
args: _Domain,
|
||||
offset: int = ...,
|
||||
limit: int | None = ...,
|
||||
order: str | None = ...,
|
||||
count: Literal[True] = ...,
|
||||
) -> int: ...
|
||||
def _compute_display_name(self) -> None: ...
|
||||
def name_get(self) -> list[tuple[int, str]]: ...
|
||||
def name_create(self, name: str) -> tuple[int, str]: ...
|
||||
def name_search(self, name: str = ..., args: _Domain | None = ..., operator: str = ..., limit: int = ...) -> list[tuple[int, str]]: ...
|
||||
def _name_search(self, name: str = ..., args: _Domain | None = ..., operator: str = ..., limit: int = ..., name_get_uid: int | None = ...) -> list[int]: ...
|
||||
def name_search(
|
||||
self,
|
||||
name: str = ...,
|
||||
args: _Domain | None = ...,
|
||||
operator: str = ...,
|
||||
limit: int = ...,
|
||||
) -> list[tuple[int, str]]: ...
|
||||
def _name_search(
|
||||
self,
|
||||
name: str = ...,
|
||||
args: _Domain | None = ...,
|
||||
operator: str = ...,
|
||||
limit: int = ...,
|
||||
name_get_uid: int | None = ...,
|
||||
) -> list[int]: ...
|
||||
def _add_missing_default_values(self, values: dict[str, Any]) -> dict[str, Any]: ...
|
||||
@classmethod
|
||||
def clear_caches(cls) -> None: ...
|
||||
def _read_group_expand_full(self, groups: _ModelT, domain: _Domain | None, order: str | None) -> _ModelT: ...
|
||||
def _read_group_fill_results(self, domain: _Domain, groupby: str, remaining_groupbys: list[str], aggregated_fields: list[str], count_field: str, read_group_result, read_group_order: str | None = ...) -> list: ...
|
||||
def _read_group_fill_temporal(self, data: list, groupby: list[str], aggregated_fields: list[str], annotated_groupbys: list[dict], fill_from: str | None = ..., fill_to: str | None = ..., min_groups: int | None = ...) -> list: ...
|
||||
def _read_group_prepare(self, orderby: str, aggregated_fields: list[str], annotated_groupbys: list[dict], query: Query) -> tuple[list, list]: ...
|
||||
def _read_group_expand_full(
|
||||
self, groups: _ModelT, domain: _Domain | None, order: str | None
|
||||
) -> _ModelT: ...
|
||||
def _read_group_fill_results(
|
||||
self,
|
||||
domain: _Domain,
|
||||
groupby: str,
|
||||
remaining_groupbys: list[str],
|
||||
aggregated_fields: list[str],
|
||||
count_field: str,
|
||||
read_group_result,
|
||||
read_group_order: str | None = ...,
|
||||
) -> list: ...
|
||||
def _read_group_fill_temporal(
|
||||
self,
|
||||
data: list,
|
||||
groupby: list[str],
|
||||
aggregated_fields: list[str],
|
||||
annotated_groupbys: list[dict],
|
||||
fill_from: str | None = ...,
|
||||
fill_to: str | None = ...,
|
||||
min_groups: int | None = ...,
|
||||
) -> list: ...
|
||||
def _read_group_prepare(
|
||||
self,
|
||||
orderby: str,
|
||||
aggregated_fields: list[str],
|
||||
annotated_groupbys: list[dict],
|
||||
query: Query,
|
||||
) -> tuple[list, list]: ...
|
||||
def _read_group_process_groupby(self, gb: str, query: Query) -> dict[str, Any]: ...
|
||||
def _read_group_prepare_data(self, key, value, groupby_dict: dict[str, dict[str, Any]]) -> Any: ...
|
||||
def _read_group_format_result(self, data: dict, annotated_groupbys: list[dict], groupby: list, domain: _Domain) -> dict: ...
|
||||
def read_group(self, domain: _Domain, fields: list[str], groupby: str | list[str], offset: int = ..., limit: int | None = ..., orderby: str | None = ..., lazy: bool = ...) -> list[dict[str, Any]]: ...
|
||||
def _read_group_raw(self, domain: _Domain, fields: list[str], groupby: str | list[str], offset: int = ..., limit: int | None = ..., orderby: str | None = ..., lazy: bool = ...) -> list[dict[str, Any]]: ...
|
||||
def _read_group_resolve_many2x_fields(self, data: list[dict[str, Any]], fields: list[dict[str, Any]]) -> None: ...
|
||||
def _inherits_join_add(self, current_model: BaseModel, parent_model_name: str, query: Query) -> str: ...
|
||||
def _read_group_prepare_data(
|
||||
self, key, value, groupby_dict: dict[str, dict[str, Any]]
|
||||
) -> Any: ...
|
||||
def _read_group_format_result(
|
||||
self, data: dict, annotated_groupbys: list[dict], groupby: list, domain: _Domain
|
||||
) -> dict: ...
|
||||
def read_group(
|
||||
self,
|
||||
domain: _Domain,
|
||||
fields: list[str],
|
||||
groupby: str | list[str],
|
||||
offset: int = ...,
|
||||
limit: int | None = ...,
|
||||
orderby: str | None = ...,
|
||||
lazy: bool = ...,
|
||||
) -> list[dict[str, Any]]: ...
|
||||
def _read_group_raw(
|
||||
self,
|
||||
domain: _Domain,
|
||||
fields: list[str],
|
||||
groupby: str | list[str],
|
||||
offset: int = ...,
|
||||
limit: int | None = ...,
|
||||
orderby: str | None = ...,
|
||||
lazy: bool = ...,
|
||||
) -> list[dict[str, Any]]: ...
|
||||
def _read_group_resolve_many2x_fields(
|
||||
self, data: list[dict[str, Any]], fields: list[dict[str, Any]]
|
||||
) -> None: ...
|
||||
def _inherits_join_add(
|
||||
self, current_model: BaseModel, parent_model_name: str, query: Query
|
||||
) -> str: ...
|
||||
def _inherits_join_calc(self, alias: str, fname: str, query: Query) -> str: ...
|
||||
def _parent_store_compute(self): ...
|
||||
def _check_removed_columns(self, log: bool = ...) -> None: ...
|
||||
@@ -200,25 +324,35 @@ class BaseModel(metaclass=MetaModel):
|
||||
def _setup_base(self) -> None: ...
|
||||
def _setup_fields(self) -> None: ...
|
||||
def _setup_complete(self) -> None: ...
|
||||
def fields_get(self, allfields: list[str] | None = ..., attributes: list[str] | None = ...) -> dict[str, dict[str, Any]]: ...
|
||||
def fields_get(
|
||||
self, allfields: list[str] | None = ..., attributes: list[str] | None = ...
|
||||
) -> dict[str, dict[str, Any]]: ...
|
||||
def get_empty_list_help(self, help: str) -> str: ...
|
||||
def check_field_access_rights(self, operation: str, fields: Collection[str]): ...
|
||||
def read(self, fields: Collection[str] | None = ..., load: str = ...) -> list[dict[str, Any]]: ...
|
||||
def _read_format(self, fnames: Collection[str], load: str = ...) -> list[dict[str, Any]]: ...
|
||||
def read(
|
||||
self, fields: Collection[str] | None = ..., load: str = ...
|
||||
) -> list[dict[str, Any]]: ...
|
||||
def _read_format(
|
||||
self, fnames: Collection[str], load: str = ...
|
||||
) -> list[dict[str, Any]]: ...
|
||||
def _fetch_field(self, field: Field) -> None: ...
|
||||
def _read(self, fields: Collection[str]): ...
|
||||
def get_metadata(self) -> list[dict[str, Any]]: ...
|
||||
def get_base_url(self) -> str: ...
|
||||
def _check_concurrency(self) -> None: ...
|
||||
def _check_company(self, fnames: Collection[str] | None = ...) -> None: ...
|
||||
def check_access_rights(self, operation: str, raise_exception: bool = ...) -> bool: ...
|
||||
def check_access_rights(
|
||||
self, operation: str, raise_exception: bool = ...
|
||||
) -> bool: ...
|
||||
def check_access_rule(self, operation: str) -> None: ...
|
||||
def _filter_access_rules(self: _ModelT, operation: str) -> _ModelT: ...
|
||||
def _filter_access_rules_python(self, operation: str) -> _ModelT: ...
|
||||
def unlink(self): ...
|
||||
def write(self, vals: dict[str, Any]): ...
|
||||
def _write(self, vals: dict[str, Any]): ...
|
||||
def create(self: _ModelT, vals_list: list[dict[str, Any]] | dict[str, Any]) -> _ModelT: ...
|
||||
def create(
|
||||
self: _ModelT, vals_list: list[dict[str, Any]] | dict[str, Any]
|
||||
) -> _ModelT: ...
|
||||
def _create(self: _ModelT, data_list: list[dict[str, Any]]) -> _ModelT: ...
|
||||
def _compute_field_value(self, field: Field) -> None: ...
|
||||
def _parent_store_create(self) -> None: ...
|
||||
@@ -230,14 +364,48 @@ class BaseModel(metaclass=MetaModel):
|
||||
def _where_calc(self, domain: _Domain, active_test: bool = ...) -> Query: ...
|
||||
def _check_qorder(self, word: str) -> bool: ...
|
||||
def _apply_ir_rules(self, query: Query, mode: str = ...) -> None: ...
|
||||
def _generate_translated_field(self, table_alias: str, field: str, query: Query) -> str: ...
|
||||
def _generate_m2o_order_by(self, alias: str, order_field: str, query: Query, reverse_direction: bool, seen: set | None) -> list[str]: ...
|
||||
def _generate_order_by_inner(self, alias: str, order_spec: str, query: Query, reverse_direction: bool = ..., seen: set | None = ...) -> list[str]: ...
|
||||
def _generate_translated_field(
|
||||
self, table_alias: str, field: str, query: Query
|
||||
) -> str: ...
|
||||
def _generate_m2o_order_by(
|
||||
self,
|
||||
alias: str,
|
||||
order_field: str,
|
||||
query: Query,
|
||||
reverse_direction: bool,
|
||||
seen: set | None,
|
||||
) -> list[str]: ...
|
||||
def _generate_order_by_inner(
|
||||
self,
|
||||
alias: str,
|
||||
order_spec: str,
|
||||
query: Query,
|
||||
reverse_direction: bool = ...,
|
||||
seen: set | None = ...,
|
||||
) -> list[str]: ...
|
||||
def _generate_order_by(self, order_spec: str | None, query: Query) -> str: ...
|
||||
def _flush_search(self, domain: _Domain, fields: Sequence[str] | None = ..., order: str | None = ..., seen: set | None = ...) -> None: ...
|
||||
def _search(self: _ModelT, args: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: bool = ..., access_rights_uid: int | None = ...) -> Query | int: ...
|
||||
def copy_data(self, default: dict[str, Any] | None = ...) -> list[dict[str, Any]]: ...
|
||||
def copy_translations(old: _ModelT, new: _ModelT, excluded: Container[str] = ...) -> None: ...
|
||||
def _flush_search(
|
||||
self,
|
||||
domain: _Domain,
|
||||
fields: Sequence[str] | None = ...,
|
||||
order: str | None = ...,
|
||||
seen: set | None = ...,
|
||||
) -> None: ...
|
||||
def _search(
|
||||
self: _ModelT,
|
||||
args: _Domain,
|
||||
offset: int = ...,
|
||||
limit: int | None = ...,
|
||||
order: str | None = ...,
|
||||
count: bool = ...,
|
||||
access_rights_uid: int | None = ...,
|
||||
) -> Query | int: ...
|
||||
def copy_data(
|
||||
self, default: dict[str, Any] | None = ...
|
||||
) -> list[dict[str, Any]]: ...
|
||||
def copy_translations(
|
||||
old: _ModelT, new: _ModelT, excluded: Container[str] = ...
|
||||
) -> None: ...
|
||||
def copy(self: _ModelT, default: dict[str, Any] | None = ...) -> _ModelT: ...
|
||||
def exists(self: _ModelT) -> _ModelT: ...
|
||||
def _check_recursion(self, parent: str | None = ...) -> bool: ...
|
||||
@@ -248,7 +416,15 @@ class BaseModel(metaclass=MetaModel):
|
||||
_get_xml_ids = _get_external_ids
|
||||
@classmethod
|
||||
def is_transient(cls) -> bool: ...
|
||||
def search_read(self, domain: _Domain | None = ..., fields: list[str] | None = ..., offset: int = ..., limit: int | None = ..., order: str | None = ..., **read_kwargs: str) -> list[dict[str, Any]]: ...
|
||||
def search_read(
|
||||
self,
|
||||
domain: _Domain | None = ...,
|
||||
fields: list[str] | None = ...,
|
||||
offset: int = ...,
|
||||
limit: int | None = ...,
|
||||
order: str | None = ...,
|
||||
**read_kwargs: str
|
||||
) -> list[dict[str, Any]]: ...
|
||||
def toggle_active(self) -> None: ...
|
||||
def action_archive(self): ...
|
||||
def action_unarchive(self): ...
|
||||
@@ -259,8 +435,12 @@ class BaseModel(metaclass=MetaModel):
|
||||
@classmethod
|
||||
def _revert_method(cls, name: str) -> None: ...
|
||||
@classmethod
|
||||
def _browse(cls: type[_ModelT], env: Environment, ids: tuple, prefetch_ids: Iterable[int]) -> _ModelT: ...
|
||||
def browse(self: _ModelT, ids: int | NewId | Iterable[int | NewId] | None = ...) -> _ModelT: ...
|
||||
def _browse(
|
||||
cls: type[_ModelT], env: Environment, ids: tuple, prefetch_ids: Iterable[int]
|
||||
) -> _ModelT: ...
|
||||
def browse(
|
||||
self: _ModelT, ids: int | NewId | Iterable[int | NewId] | None = ...
|
||||
) -> _ModelT: ...
|
||||
@property
|
||||
def ids(self) -> list[int]: ...
|
||||
_cr: Cursor
|
||||
@@ -269,10 +449,16 @@ class BaseModel(metaclass=MetaModel):
|
||||
def ensure_one(self: _ModelT) -> _ModelT: ...
|
||||
def with_env(self: _ModelT, env: Environment) -> _ModelT: ...
|
||||
def sudo(self: _ModelT, flag: bool = ...) -> _ModelT: ...
|
||||
def with_user(self: _ModelT, user: Union['odoo.model.res_partner', int]) -> _ModelT: ...
|
||||
def with_company(self: _ModelT, company: Union['odoo.model.res_company', int]) -> _ModelT: ...
|
||||
def with_user(
|
||||
self: _ModelT, user: Union["odoo.model.res_partner", int]
|
||||
) -> _ModelT: ...
|
||||
def with_company(
|
||||
self: _ModelT, company: Union["odoo.model.res_company", int]
|
||||
) -> _ModelT: ...
|
||||
def with_context(self: _ModelT, *args, **kwargs) -> _ModelT: ...
|
||||
def with_prefetch(self: _ModelT, prefetch_ids: Iterable[int] | None = ...) -> _ModelT: ...
|
||||
def with_prefetch(
|
||||
self: _ModelT, prefetch_ids: Iterable[int] | None = ...
|
||||
) -> _ModelT: ...
|
||||
def _update_cache(self, values: dict[str, Any], validate: bool = ...): ...
|
||||
def _convert_to_record(self, values: dict[str, Any]): ...
|
||||
def _convert_to_write(self, values: dict[str, Any]) -> dict[str, Any]: ...
|
||||
@@ -281,10 +467,19 @@ class BaseModel(metaclass=MetaModel):
|
||||
def _mapped_cache(self, name_seq: str): ...
|
||||
def filtered(self: _ModelT, func: Callable | str) -> _ModelT: ...
|
||||
def filtered_domain(self: _ModelT, domain: _Domain) -> _ModelT: ...
|
||||
def sorted(self: _ModelT, key: Callable | str | None = ..., reverse: bool = ...) -> _ModelT: ...
|
||||
def sorted(
|
||||
self: _ModelT, key: Callable | str | None = ..., reverse: bool = ...
|
||||
) -> _ModelT: ...
|
||||
def update(self, values: dict[str, Any]) -> None: ...
|
||||
def flush(self, fnames: Collection[str] | None = ..., records: BaseModel | None = ...) -> None: ...
|
||||
def new(self: _ModelT, values: dict[str, Any] = ..., origin: _ModelT | None = ..., ref: Any | None = ...) -> _ModelT: ...
|
||||
def flush(
|
||||
self, fnames: Collection[str] | None = ..., records: BaseModel | None = ...
|
||||
) -> None: ...
|
||||
def new(
|
||||
self: _ModelT,
|
||||
values: dict[str, Any] = ...,
|
||||
origin: _ModelT | None = ...,
|
||||
ref: Any | None = ...,
|
||||
) -> _ModelT: ...
|
||||
@property
|
||||
def _origin(self: _ModelT) -> _ModelT: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
@@ -311,15 +506,30 @@ class BaseModel(metaclass=MetaModel):
|
||||
def _cache(self) -> RecordCache: ...
|
||||
def _in_cache_without(self: _ModelT, field: Field, limit: int = ...) -> _ModelT: ...
|
||||
def refresh(self) -> None: ...
|
||||
def invalidate_cache(self, fnames: Collection[str] | None = ..., ids: Iterable[int] | None = ...) -> None: ...
|
||||
def modified(self, fnames: Collection[str], create: bool = ..., before: bool = ...) -> None: ...
|
||||
def _modified_triggers(self: _ModelT, tree: dict[Field | None, Any], create: bool = ...) -> Iterator[tuple[Field, _ModelT, bool]]: ...
|
||||
def recompute(self, fnames: Collection[str] | None = ..., records: Union[BaseModel, None] = ...) -> None: ...
|
||||
def invalidate_cache(
|
||||
self, fnames: Collection[str] | None = ..., ids: Iterable[int] | None = ...
|
||||
) -> None: ...
|
||||
def modified(
|
||||
self, fnames: Collection[str], create: bool = ..., before: bool = ...
|
||||
) -> None: ...
|
||||
def _modified_triggers(
|
||||
self: _ModelT, tree: dict[Field | None, Any], create: bool = ...
|
||||
) -> Iterator[tuple[Field, _ModelT, bool]]: ...
|
||||
def recompute(
|
||||
self,
|
||||
fnames: Collection[str] | None = ...,
|
||||
records: Union[BaseModel, None] = ...,
|
||||
) -> None: ...
|
||||
def _dependent_fields(self, field: Field) -> Iterator[Field]: ...
|
||||
def _has_onchange(self, field: Field, other_fields: Container[Field]) -> bool: ...
|
||||
def _onchange_spec(self, view_info: dict | None = ...) -> dict: ...
|
||||
def _onchange_eval(self, field_name: str, onchange: str, result: dict) -> None: ...
|
||||
def onchange(self, values: dict[str, Any], field_name: str | list[str] | bool, field_onchange: dict[str, str]) -> dict: ...
|
||||
def onchange(
|
||||
self,
|
||||
values: dict[str, Any],
|
||||
field_name: str | list[str] | bool,
|
||||
field_onchange: dict[str, str],
|
||||
) -> dict: ...
|
||||
def _get_placeholder_filename(self, field: str) -> str | bool: ...
|
||||
def _populate_factories(self) -> list[tuple[str, Callable[..., Iterator]]]: ...
|
||||
@property
|
||||
@@ -356,9 +566,15 @@ class TransientModel(Model):
|
||||
def _transient_clean_rows_older_than(self, seconds) -> None: ...
|
||||
|
||||
def itemgetter_tuple(items) -> Callable[..., tuple]: ...
|
||||
def convert_pgerror_not_null(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
|
||||
def convert_pgerror_unique(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
|
||||
def convert_pgerror_constraint(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
|
||||
def convert_pgerror_not_null(
|
||||
model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error
|
||||
) -> dict[str, str]: ...
|
||||
def convert_pgerror_unique(
|
||||
model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error
|
||||
) -> dict[str, str]: ...
|
||||
def convert_pgerror_constraint(
|
||||
model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error
|
||||
) -> dict[str, str]: ...
|
||||
|
||||
PGERROR_TO_OE: dict[str, Callable]
|
||||
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
from . import (
|
||||
db as db,
|
||||
graph as graph,
|
||||
loading as loading,
|
||||
migration as migration,
|
||||
module as module,
|
||||
registry as registry
|
||||
)
|
||||
from .loading import (
|
||||
load_modules as load_modules,
|
||||
reset_modules_state as reset_modules_state
|
||||
)
|
||||
from . import db as db
|
||||
from . import graph as graph
|
||||
from . import loading as loading
|
||||
from . import migration as migration
|
||||
from . import module as module
|
||||
from . import registry as registry
|
||||
from .loading import load_modules as load_modules
|
||||
from .loading import reset_modules_state as reset_modules_state
|
||||
from .module import adapt_version as adapt_version
|
||||
from .module import check_resource_path as check_resource_path
|
||||
from .module import get_module_path as get_module_path
|
||||
from .module import get_module_resource as get_module_resource
|
||||
from .module import get_modules as get_modules
|
||||
from .module import get_modules_with_version as get_modules_with_version
|
||||
from .module import get_resource_from_path as get_resource_from_path
|
||||
from .module import get_resource_path as get_resource_path
|
||||
from .module import initialize_sys_path as initialize_sys_path
|
||||
from .module import (
|
||||
adapt_version as adapt_version,
|
||||
check_resource_path as check_resource_path,
|
||||
get_module_path as get_module_path,
|
||||
get_module_resource as get_module_resource,
|
||||
get_modules as get_modules,
|
||||
get_modules_with_version as get_modules_with_version,
|
||||
get_resource_from_path as get_resource_from_path,
|
||||
get_resource_path as get_resource_path,
|
||||
initialize_sys_path as initialize_sys_path,
|
||||
load_information_from_description_file as load_information_from_description_file,
|
||||
load_openerp_module as load_openerp_module
|
||||
)
|
||||
from .module import load_openerp_module as load_openerp_module
|
||||
|
||||
@@ -6,7 +6,9 @@ class Graph(dict[str, Node]):
|
||||
def add_node(self, name: str, info: dict[str, Any]) -> Node: ...
|
||||
def update_from_db(self, cr: Cursor) -> None: ...
|
||||
def add_module(self, cr: Cursor, module: str, force: list | None = ...) -> None: ...
|
||||
def add_modules(self, cr: Cursor, module_list: list[str], force: list | None = ...): ...
|
||||
def add_modules(
|
||||
self, cr: Cursor, module_list: list[str], force: list | None = ...
|
||||
): ...
|
||||
def __iter__(self) -> Iterator[Node]: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
@@ -21,7 +23,9 @@ class Node:
|
||||
dbdemo: bool
|
||||
state: str
|
||||
installed_version: str
|
||||
def __init__(self, name: str, graph: Graph, info: dict[str, Any] | None) -> None: ...
|
||||
def __init__(
|
||||
self, name: str, graph: Graph, info: dict[str, Any] | None
|
||||
) -> None: ...
|
||||
@property
|
||||
def data(self) -> dict[str, Any]: ...
|
||||
def add_child(self, name: str, info: dict[str, Any]): ...
|
||||
|
||||
@@ -1,17 +1,38 @@
|
||||
from typing import Any, Iterable
|
||||
|
||||
from .graph import Graph, Node
|
||||
from .registry import Registry
|
||||
from ..sql_db import Cursor
|
||||
from ..tests.runner import OdooTestResult
|
||||
from .graph import Graph, Node
|
||||
from .registry import Registry
|
||||
|
||||
def load_data(cr: Cursor, idref: dict, mode: str, kind: str, package: Node) -> bool: ...
|
||||
def load_demo(cr: Cursor, package: Node, idref: dict, mode: str) -> bool: ...
|
||||
def force_demo(cr: Cursor) -> None: ...
|
||||
def load_module_graph(cr: Cursor, graph: Graph, status: Any | None = ..., perform_checks: Any = ..., skip_modules: list[str] | None = ...,
|
||||
report: OdooTestResult | None = ..., models_to_check: set[str] | None = ...) -> tuple[list[str], list[str]]: ...
|
||||
def load_module_graph(
|
||||
cr: Cursor,
|
||||
graph: Graph,
|
||||
status: Any | None = ...,
|
||||
perform_checks: Any = ...,
|
||||
skip_modules: list[str] | None = ...,
|
||||
report: OdooTestResult | None = ...,
|
||||
models_to_check: set[str] | None = ...,
|
||||
) -> tuple[list[str], list[str]]: ...
|
||||
def _check_module_names(cr: Cursor, module_names: Iterable[str]) -> None: ...
|
||||
def load_marked_modules(cr: Cursor, graph: Graph, states: list[str], force: list[str], progressdict, report: OdooTestResult,
|
||||
loaded_modules: list[str], perform_checks: Any, models_to_check: set[str] | None = ...) -> list[str]: ...
|
||||
def load_modules(registry: Registry, force_demo: bool = ..., status: Any | None = ..., update_module: Any = ...) -> Registry | None: ...
|
||||
def load_marked_modules(
|
||||
cr: Cursor,
|
||||
graph: Graph,
|
||||
states: list[str],
|
||||
force: list[str],
|
||||
progressdict,
|
||||
report: OdooTestResult,
|
||||
loaded_modules: list[str],
|
||||
perform_checks: Any,
|
||||
models_to_check: set[str] | None = ...,
|
||||
) -> list[str]: ...
|
||||
def load_modules(
|
||||
registry: Registry,
|
||||
force_demo: bool = ...,
|
||||
status: Any | None = ...,
|
||||
update_module: Any = ...,
|
||||
) -> Registry | None: ...
|
||||
def reset_modules_state(db_name: str) -> None: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from types import ModuleType
|
||||
|
||||
from .graph import Graph, Node
|
||||
from ..sql_db import Cursor
|
||||
from .graph import Graph, Node
|
||||
|
||||
def load_script(path: str, module_name: str) -> ModuleType: ...
|
||||
|
||||
|
||||
@@ -21,10 +21,13 @@ class UpgradeHook:
|
||||
def load_module(self, name: str) -> ModuleType | None: ...
|
||||
|
||||
def initialize_sys_path() -> None: ...
|
||||
def get_module_path(module: str, downloaded: bool = ..., display_warning: bool = ...) -> str | Literal[False]: ...
|
||||
def get_module_path(
|
||||
module: str, downloaded: bool = ..., display_warning: bool = ...
|
||||
) -> str | Literal[False]: ...
|
||||
def get_module_filetree(module: str, dir: str = ...) -> dict: ...
|
||||
def get_resource_path(module: str, *args) -> str | Literal[False]: ...
|
||||
def check_resource_path(mod_path: str, *args) -> str | Literal[False]: ...
|
||||
|
||||
get_module_resource = get_resource_path
|
||||
|
||||
def get_resource_from_path(path: str) -> tuple[str, str, str] | None: ...
|
||||
@@ -32,7 +35,9 @@ def get_module_icon(module: str) -> str: ...
|
||||
def module_manifest(path: str) -> str | None: ...
|
||||
def read_manifest(addons_path: str, module: str): ...
|
||||
def get_module_root(path: str) -> str | None: ...
|
||||
def load_information_from_description_file(module: str, mod_path: str | None = ...) -> dict: ...
|
||||
def load_information_from_description_file(
|
||||
module: str, mod_path: str | None = ...
|
||||
) -> dict: ...
|
||||
def load_openerp_module(module_name: str) -> None: ...
|
||||
def get_modules() -> list[str]: ...
|
||||
def get_modules_with_version() -> dict[str, Any]: ...
|
||||
|
||||
@@ -4,13 +4,13 @@ from collections.abc import Mapping
|
||||
from threading import RLock
|
||||
from typing import Any, Callable, ClassVar, Iterable, Iterator
|
||||
|
||||
from .graph import Node
|
||||
from ..models import BaseModel
|
||||
from ..fields import Field
|
||||
from ..models import BaseModel
|
||||
from ..sql_db import Connection, Cursor
|
||||
from ..tests.runner import OdooTestResult
|
||||
from ..tools import Collector
|
||||
from ..tools.lru import LRU
|
||||
from .graph import Node
|
||||
|
||||
class Registry(Mapping[str, type[BaseModel]]):
|
||||
_lock: RLock
|
||||
@@ -18,7 +18,13 @@ class Registry(Mapping[str, type[BaseModel]]):
|
||||
registries: ClassVar[LRU]
|
||||
def __new__(cls, db_name: str) -> Registry: ...
|
||||
@classmethod
|
||||
def new(cls, db_name: str, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...) -> Registry: ...
|
||||
def new(
|
||||
cls,
|
||||
db_name: str,
|
||||
force_demo: bool = ...,
|
||||
status: Any | None = ...,
|
||||
update_module: bool = ...,
|
||||
) -> Registry: ...
|
||||
models: dict[str, type[BaseModel]]
|
||||
_sql_constraints: set
|
||||
_init: bool
|
||||
@@ -70,9 +76,21 @@ class Registry(Mapping[str, type[BaseModel]]):
|
||||
_post_init_queue: deque
|
||||
_foreign_keys: Any
|
||||
_is_install: bool
|
||||
def init_models(self, cr: Cursor, model_names: Iterable[str], context: dict, install: bool = ...) -> None: ...
|
||||
def init_models(
|
||||
self, cr: Cursor, model_names: Iterable[str], context: dict, install: bool = ...
|
||||
) -> None: ...
|
||||
def check_indexes(self, cr: Cursor, model_names: Iterable[str]) -> None: ...
|
||||
def add_foreign_key(self, table1, column1, table2, column2, ondelete, model, module, force: bool = ...) -> None: ...
|
||||
def add_foreign_key(
|
||||
self,
|
||||
table1,
|
||||
column1,
|
||||
table2,
|
||||
column2,
|
||||
ondelete,
|
||||
model,
|
||||
module,
|
||||
force: bool = ...,
|
||||
) -> None: ...
|
||||
def check_foreign_keys(self, cr: Cursor) -> None: ...
|
||||
def check_tables_exist(self, cr: Cursor) -> None: ...
|
||||
def _clear_cache(self) -> None: ...
|
||||
|
||||
@@ -3,7 +3,9 @@ import warnings
|
||||
from logging import Logger, LogRecord
|
||||
from typing import TextIO
|
||||
|
||||
def log(logger: Logger, level: int, prefix: str, msg, depth: int | None = ...) -> None: ...
|
||||
def log(
|
||||
logger: Logger, level: int, prefix: str, msg, depth: int | None = ...
|
||||
) -> None: ...
|
||||
|
||||
class PostgreSQLHandler(logging.Handler):
|
||||
def emit(self, record: LogRecord) -> None: ...
|
||||
@@ -25,11 +27,15 @@ COLOR_PATTERN: str
|
||||
LEVEL_COLOR_MAPPING: dict[int, tuple[int, int]]
|
||||
|
||||
class PerfFilter(logging.Filter):
|
||||
def format_perf(self, query_count: int, query_time: float, remaining_time: float): ...
|
||||
def format_perf(
|
||||
self, query_count: int, query_time: float, remaining_time: float
|
||||
): ...
|
||||
def filter(self, record: LogRecord): ...
|
||||
|
||||
class ColoredPerfFilter(PerfFilter):
|
||||
def format_perf(self, query_count: int, query_time: float, remaining_time: float): ...
|
||||
def format_perf(
|
||||
self, query_count: int, query_time: float, remaining_time: float
|
||||
): ...
|
||||
|
||||
class DBFormatter(logging.Formatter):
|
||||
def format(self, record: LogRecord): ...
|
||||
@@ -46,5 +52,12 @@ PSEUDOCONFIG_MAPPER: dict[str, list[str]]
|
||||
showwarning = warnings.showwarning
|
||||
IGNORE: set[str]
|
||||
|
||||
def showwarning_with_traceback(message: Warning | str, category: type[Warning], filename: str, lineno: int, file: TextIO | None = ..., line: str | None = ...): ...
|
||||
def showwarning_with_traceback(
|
||||
message: Warning | str,
|
||||
category: type[Warning],
|
||||
filename: str,
|
||||
lineno: int,
|
||||
file: TextIO | None = ...,
|
||||
line: str | None = ...,
|
||||
): ...
|
||||
def runbot(self, message, *args, **kws) -> None: ...
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from functools import partial as partial
|
||||
from typing import Any, Callable
|
||||
|
||||
from .query import Query
|
||||
from ..models import BaseModel, MAGIC_COLUMNS as MAGIC_COLUMNS
|
||||
from ..models import MAGIC_COLUMNS as MAGIC_COLUMNS
|
||||
from ..models import BaseModel
|
||||
from ..sql_db import Cursor
|
||||
from ..tools.misc import get_lang as get_lang
|
||||
from .query import Query
|
||||
|
||||
_Domain = list
|
||||
|
||||
@@ -42,7 +43,13 @@ class expression:
|
||||
expression: _Domain
|
||||
query: Query | None
|
||||
result: tuple[str, list]
|
||||
def __init__(self, domain: _Domain, model: BaseModel, alias: str | None = ..., query: Query | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
domain: _Domain,
|
||||
model: BaseModel,
|
||||
alias: str | None = ...,
|
||||
query: Query | None = ...,
|
||||
) -> None: ...
|
||||
def get_tables(self) -> tuple[str, ...]: ...
|
||||
def parse(self): ...
|
||||
def __leaf_to_sql(self, leaf, model: BaseModel, alias: str) -> tuple[str, list]: ...
|
||||
|
||||
@@ -20,9 +20,37 @@ class Query:
|
||||
def __init__(self, cr: Cursor, alias: str, table: str | None = ...) -> None: ...
|
||||
def add_table(self, alias: str, table: str | None = ...) -> None: ...
|
||||
def add_where(self, where_clause: str, where_params: Iterable = ...) -> None: ...
|
||||
def join(self, lhs_alias: str, lhs_column: str, rhs_table: str, rhs_column: str, link: str, extra: str | None = ..., extra_params: tuple = ...) -> str: ...
|
||||
def left_join(self, lhs_alias: str, lhs_column: str, rhs_table: str, rhs_column: str, link: str, extra: str | None = ..., extra_params: tuple = ...) -> str: ...
|
||||
def _join(self, kind: str, lhs_alias: str, lhs_column: str, rhs_table: str, rhs_column: str, link: str, extra: str | None = ..., extra_params: tuple = ...) -> str: ...
|
||||
def join(
|
||||
self,
|
||||
lhs_alias: str,
|
||||
lhs_column: str,
|
||||
rhs_table: str,
|
||||
rhs_column: str,
|
||||
link: str,
|
||||
extra: str | None = ...,
|
||||
extra_params: tuple = ...,
|
||||
) -> str: ...
|
||||
def left_join(
|
||||
self,
|
||||
lhs_alias: str,
|
||||
lhs_column: str,
|
||||
rhs_table: str,
|
||||
rhs_column: str,
|
||||
link: str,
|
||||
extra: str | None = ...,
|
||||
extra_params: tuple = ...,
|
||||
) -> str: ...
|
||||
def _join(
|
||||
self,
|
||||
kind: str,
|
||||
lhs_alias: str,
|
||||
lhs_column: str,
|
||||
rhs_table: str,
|
||||
rhs_column: str,
|
||||
link: str,
|
||||
extra: str | None = ...,
|
||||
extra_params: tuple = ...,
|
||||
) -> str: ...
|
||||
def select(self, *args) -> tuple[str, list]: ...
|
||||
def subselect(self, *args) -> tuple[str, list]: ...
|
||||
def get_sql(self) -> tuple[str, str, list]: ...
|
||||
@@ -38,4 +66,11 @@ class Query:
|
||||
def where_clause(self) -> tuple[str, ...]: ...
|
||||
@property
|
||||
def where_clause_params(self) -> tuple: ...
|
||||
def add_join(self, connection, implicit: bool = ..., outer: bool = ..., extra: str | None = ..., extra_params: tuple = ...) -> tuple[str, str]: ...
|
||||
def add_join(
|
||||
self,
|
||||
connection,
|
||||
implicit: bool = ...,
|
||||
outer: bool = ...,
|
||||
extra: str | None = ...,
|
||||
extra_params: tuple = ...,
|
||||
) -> tuple[str, str]: ...
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
from . import common as common, db as db, model as model, server as server, wsgi_server as wsgi_server
|
||||
from . import common as common
|
||||
from . import db as db
|
||||
from . import model as model
|
||||
from . import server as server
|
||||
from . import wsgi_server as wsgi_server
|
||||
|
||||
@@ -4,7 +4,9 @@ from typing import Any, Literal
|
||||
RPC_VERSION_1: dict[str, Any]
|
||||
|
||||
def exp_login(db: str, login: str, password: str) -> int: ...
|
||||
def exp_authenticate(db: str, login: str, password: str, user_agent_env: dict | None) -> int: ...
|
||||
def exp_authenticate(
|
||||
db: str, login: str, password: str, user_agent_env: dict | None
|
||||
) -> int: ...
|
||||
def exp_version() -> dict[str, Any]: ...
|
||||
def exp_about(extended: bool = ...) -> str | tuple[str, str]: ...
|
||||
def exp_set_loglevel(loglevel, logger: Logger | None = ...) -> Literal[True]: ...
|
||||
|
||||
@@ -1,19 +1,34 @@
|
||||
from functools import wraps as wraps
|
||||
from typing import Any, Callable, IO, Iterable, Literal, TypeVar
|
||||
from typing import IO, Any, Callable, Iterable, Literal, TypeVar
|
||||
|
||||
from ..sql_db import Cursor
|
||||
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
|
||||
class DatabaseExists(Warning): ...
|
||||
|
||||
def check_db_management_enabled(method: _CallableT) -> _CallableT: ...
|
||||
def check_super(passwd: str) -> Literal[True]: ...
|
||||
def _initialize_db(id, db_name: str, demo: bool, lang: str, user_password: str, login: str = ...,
|
||||
country_code: str | None = ..., phone: str | None = ...) -> None: ...
|
||||
def _initialize_db(
|
||||
id,
|
||||
db_name: str,
|
||||
demo: bool,
|
||||
lang: str,
|
||||
user_password: str,
|
||||
login: str = ...,
|
||||
country_code: str | None = ...,
|
||||
phone: str | None = ...,
|
||||
) -> None: ...
|
||||
def _create_empty_database(name: str) -> None: ...
|
||||
def exp_create_database(db_name: str, demo: bool, lang: str, user_password: str = ..., login: str = ...,
|
||||
country_code: str | None = ..., phone: str | None = ...) -> Literal[True]: ...
|
||||
def exp_create_database(
|
||||
db_name: str,
|
||||
demo: bool,
|
||||
lang: str,
|
||||
user_password: str = ...,
|
||||
login: str = ...,
|
||||
country_code: str | None = ...,
|
||||
phone: str | None = ...,
|
||||
) -> Literal[True]: ...
|
||||
def exp_duplicate_database(db_original_name: str, db_name: str) -> Literal[True]: ...
|
||||
def _drop_conn(cr: Cursor, db_name: str) -> None: ...
|
||||
def exp_drop(db_name: str) -> bool: ...
|
||||
|
||||
@@ -5,10 +5,12 @@ from ..sql_db import Cursor
|
||||
PG_CONCURRENCY_ERRORS_TO_RETRY: tuple[str, str, str]
|
||||
MAX_TRIES_ON_CONCURRENCY_FAILURE: int
|
||||
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
|
||||
def dispatch(method: str, params): ...
|
||||
def check(f: _CallableT) -> _CallableT: ...
|
||||
def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...
|
||||
def execute_kw(db: str, uid: int, obj: str, method: str, args, kw: dict | None = ...): ...
|
||||
def execute_kw(
|
||||
db: str, uid: int, obj: str, method: str, args, kw: dict | None = ...
|
||||
): ...
|
||||
def execute(db: str, uid: int, obj: str, method: str, *args, **kw): ...
|
||||
|
||||
@@ -4,5 +4,7 @@ from ..api import Environment
|
||||
from ..http import OpenERPSession
|
||||
|
||||
def check(db: str, uid: int, passwd: str) -> None: ...
|
||||
def compute_session_token(session: OpenERPSession, env: Environment) -> str | Literal[False]: ...
|
||||
def compute_session_token(
|
||||
session: OpenERPSession, env: Environment
|
||||
) -> str | Literal[False]: ...
|
||||
def check_session(session: OpenERPSession, env: Environment) -> bool: ...
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from itertools import chain as chain
|
||||
from socket import socket as socket_
|
||||
from threading import Semaphore, Thread
|
||||
|
||||
from gevent.pywsgi import WSGIServer
|
||||
from itertools import chain as chain
|
||||
from typing import Any, Callable, Iterable, Literal, TypeVar
|
||||
|
||||
import werkzeug.serving
|
||||
from gevent.pywsgi import WSGIServer
|
||||
from inotify.adapters import InotifyTrees
|
||||
from psutil import Process
|
||||
from watchdog.observers import Observer
|
||||
@@ -14,7 +13,7 @@ from ..modules.registry import Registry
|
||||
from ..sql_db import Cursor
|
||||
from ..tests import runner as runner
|
||||
|
||||
_WorkerT = TypeVar('_WorkerT', bound=Worker)
|
||||
_WorkerT = TypeVar("_WorkerT", bound=Worker)
|
||||
|
||||
INOTIFY_LISTEN_EVENTS: Any
|
||||
SLEEP_INTERVAL: int
|
||||
@@ -33,7 +32,9 @@ class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGI
|
||||
class RequestHandler(werkzeug.serving.WSGIRequestHandler):
|
||||
def setup(self) -> None: ...
|
||||
|
||||
class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer):
|
||||
class ThreadedWSGIServerReloadable(
|
||||
LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer
|
||||
):
|
||||
max_http_threads: Any
|
||||
http_threads_sem: Semaphore
|
||||
daemon_threads: bool
|
||||
@@ -123,7 +124,9 @@ class PreforkServer(CommonServer):
|
||||
def pipe_new(self) -> tuple[int, int]: ...
|
||||
def pipe_ping(self, pipe: tuple[int, int]) -> None: ...
|
||||
def signal_handler(self, sig: int, frame) -> None: ...
|
||||
def worker_spawn(self, klass: Callable[..., _WorkerT], workers_registry: dict[int, _WorkerT]) -> _WorkerT | None: ...
|
||||
def worker_spawn(
|
||||
self, klass: Callable[..., _WorkerT], workers_registry: dict[int, _WorkerT]
|
||||
) -> _WorkerT | None: ...
|
||||
def long_polling_spawn(self) -> None: ...
|
||||
def worker_pop(self, pid: int) -> None: ...
|
||||
def worker_kill(self, pid: int, sig: int) -> None: ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
|
||||
from typing import Callable
|
||||
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
|
||||
|
||||
RPC_FAULT_CODE_CLIENT_ERROR: int
|
||||
RPC_FAULT_CODE_APPLICATION_ERROR: int
|
||||
RPC_FAULT_CODE_WARNING: int
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
from datetime import datetime
|
||||
from re import Pattern
|
||||
from threading import Lock, RLock
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, Literal, NoReturn, Sequence, TypeVar
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Generator,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Literal,
|
||||
NoReturn,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
)
|
||||
|
||||
import psycopg2.extensions
|
||||
from decorator import decorator
|
||||
@@ -9,8 +19,8 @@ from decorator import decorator
|
||||
from .api import Transaction
|
||||
from .tools import Callbacks
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_CursorT = TypeVar('_CursorT', bound=Cursor)
|
||||
_T = TypeVar("_T")
|
||||
_CursorT = TypeVar("_CursorT", bound=Cursor)
|
||||
|
||||
real_time: Callable
|
||||
|
||||
@@ -61,15 +71,21 @@ class Cursor(BaseCursor):
|
||||
_default_log_exceptions: bool
|
||||
cache: dict
|
||||
_now: datetime | None
|
||||
def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict, serialized: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self, pool: ConnectionPool, dbname: str, dsn: dict, serialized: bool = ...
|
||||
) -> None: ...
|
||||
def __build_dict(self, row: Sequence) -> dict[str, Any]: ...
|
||||
def dictfetchone(self) -> dict[str, Any] | None: ...
|
||||
def dictfetchmany(self, size) -> list[dict[str, Any]]: ...
|
||||
def dictfetchall(self) -> list[dict[str, Any]]: ...
|
||||
def __del__(self) -> None: ...
|
||||
def _format(self, query, params: Any | None = ...): ...
|
||||
def execute(self, query, params: Any | None = ..., log_exceptions: Any | None = ...): ...
|
||||
def split_for_in_conditions(self, ids: Iterable, size: int | None = ...) -> Iterator[tuple]: ...
|
||||
def execute(
|
||||
self, query, params: Any | None = ..., log_exceptions: Any | None = ...
|
||||
): ...
|
||||
def split_for_in_conditions(
|
||||
self, ids: Iterable, size: int | None = ...
|
||||
) -> Iterator[tuple]: ...
|
||||
def print_log(self): ...
|
||||
def close(self): ...
|
||||
def _close(self, leak: bool = ...) -> None: ...
|
||||
@@ -106,7 +122,9 @@ class ConnectionPool:
|
||||
def __repr__(self) -> str: ...
|
||||
def _debug(self, msg, *args) -> None: ...
|
||||
def borrow(self, connection_info: dict) -> PsycoConnection: ...
|
||||
def give_back(self, connection: PsycoConnection, keep_in_pool: bool = ...) -> None: ...
|
||||
def give_back(
|
||||
self, connection: PsycoConnection, keep_in_pool: bool = ...
|
||||
) -> None: ...
|
||||
def close_all(self, dsn: dict | None = ...) -> None: ...
|
||||
def _dsn_equals(self, dsn1, dsn2) -> bool: ...
|
||||
def _dsn_to_dict(self, dsn) -> dict: ...
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from .common import *
|
||||
from . import common as common
|
||||
from .common import *
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import collections
|
||||
import logging
|
||||
import unittest
|
||||
from itertools import count
|
||||
from re import Pattern
|
||||
from types import TracebackType
|
||||
|
||||
from itertools import count
|
||||
from typing import Any, Callable, Generator, Generic, Iterator, Literal, Mapping, Match, TypeVar
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Generator,
|
||||
Generic,
|
||||
Iterator,
|
||||
Literal,
|
||||
Mapping,
|
||||
Match,
|
||||
TypeVar,
|
||||
)
|
||||
from unittest import TestCase
|
||||
from xmlrpc import client as xmlrpclib
|
||||
|
||||
@@ -21,10 +30,10 @@ from ..sql_db import BaseCursor, Cursor
|
||||
from ..tools import profiler
|
||||
from ..tools.profiler import Profiler
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_ModelT = TypeVar('_ModelT', bound=BaseModel)
|
||||
_FormT = TypeVar('_FormT', bound=Form)
|
||||
_T = TypeVar("_T")
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
_ModelT = TypeVar("_ModelT", bound=BaseModel)
|
||||
_FormT = TypeVar("_FormT", bound=Form)
|
||||
|
||||
ADDONS_PATH: str
|
||||
HOST: str
|
||||
@@ -38,7 +47,13 @@ def standalone(*tags: str) -> Callable[[_CallableT], _CallableT]: ...
|
||||
|
||||
DB: str
|
||||
|
||||
def new_test_user(env: Environment, login: str = ..., groups: str = ..., context: dict | None = ..., **kwargs) -> 'odoo.model.res_users': ...
|
||||
def new_test_user(
|
||||
env: Environment,
|
||||
login: str = ...,
|
||||
groups: str = ...,
|
||||
context: dict | None = ...,
|
||||
**kwargs
|
||||
) -> "odoo.model.res_users": ...
|
||||
|
||||
class RecordCapturer:
|
||||
_model: BaseModel
|
||||
@@ -54,8 +69,12 @@ class RecordCapturer:
|
||||
class OdooSuite(unittest.suite.TestSuite):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def _handleClassSetUp(self, test, result) -> None: ...
|
||||
def _createClassOrModuleLevelException(self, result, exc, method_name, parent, info: Any | None = ...) -> None: ...
|
||||
def _addClassOrModuleLevelException(self, result, exception, errorName, info: Any | None = ...) -> None: ...
|
||||
def _createClassOrModuleLevelException(
|
||||
self, result, exc, method_name, parent, info: Any | None = ...
|
||||
) -> None: ...
|
||||
def _addClassOrModuleLevelException(
|
||||
self, result, exception, errorName, info: Any | None = ...
|
||||
) -> None: ...
|
||||
def _tearDownPreviousClass(self, test, result) -> None: ...
|
||||
|
||||
class MetaCase(type):
|
||||
@@ -87,14 +106,26 @@ class BaseCase(unittest.TestCase, metaclass=MetaCase):
|
||||
def browse_ref(self, xid: str) -> BaseModel | None: ...
|
||||
def patch(self, obj, key, val) -> None: ...
|
||||
def with_user(self, login: str) -> None: ...
|
||||
def _assertRaises(self, exception, *, msg: Any | None = ...) -> Generator[Any, None, None]: ...
|
||||
def assertRaises(self, exception, func: Any | None = ..., *args, **kwargs) -> Generator[Any, None, None] | None: ...
|
||||
def assertQueries(self, expected, flush: bool = ...) -> Generator[list, None, None]: ...
|
||||
def assertQueryCount(self, default: int = ..., flush: bool = ..., **counters) -> Generator[None, None, None]: ...
|
||||
def assertRecordValues(self, records: BaseModel, expected_values: list[dict[str, Any]]) -> None: ...
|
||||
def _assertRaises(
|
||||
self, exception, *, msg: Any | None = ...
|
||||
) -> Generator[Any, None, None]: ...
|
||||
def assertRaises(
|
||||
self, exception, func: Any | None = ..., *args, **kwargs
|
||||
) -> Generator[Any, None, None] | None: ...
|
||||
def assertQueries(
|
||||
self, expected, flush: bool = ...
|
||||
) -> Generator[list, None, None]: ...
|
||||
def assertQueryCount(
|
||||
self, default: int = ..., flush: bool = ..., **counters
|
||||
) -> Generator[None, None, None]: ...
|
||||
def assertRecordValues(
|
||||
self, records: BaseModel, expected_values: list[dict[str, Any]]
|
||||
) -> None: ...
|
||||
def assertItemsEqual(self, a, b, msg: str | None = ...) -> None: ...
|
||||
def assertTreesEqual(self, n1, n2, msg: str | None = ...) -> None: ...
|
||||
def _assertXMLEqual(self, original: str, expected: str, parser: str = ...) -> None: ...
|
||||
def _assertXMLEqual(
|
||||
self, original: str, expected: str, parser: str = ...
|
||||
) -> None: ...
|
||||
def assertXMLEqual(self, original: str, expected: str) -> None: ...
|
||||
def assertHTMLEqual(self, original: str, expected: str) -> None: ...
|
||||
profile_session: str
|
||||
@@ -102,7 +133,7 @@ class BaseCase(unittest.TestCase, metaclass=MetaCase):
|
||||
def _callSetUp(self) -> None: ...
|
||||
|
||||
class _ErrorCatcher(list):
|
||||
__slots__ = ['test']
|
||||
__slots__ = ["test"]
|
||||
test: TestCase
|
||||
def __init__(self, test: TestCase) -> None: ...
|
||||
def append(self, error) -> None: ...
|
||||
@@ -145,7 +176,9 @@ class ChromeBrowser:
|
||||
screencast_frames: list
|
||||
window_size: str
|
||||
sigxcpu_handler: Any
|
||||
def __init__(self, logger: logging.Logger, window_size: str, test_class: str) -> None: ...
|
||||
def __init__(
|
||||
self, logger: logging.Logger, window_size: str, test_class: str
|
||||
) -> None: ...
|
||||
def signal_handler(self, sig, frame) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
@property
|
||||
@@ -153,13 +186,17 @@ class ChromeBrowser:
|
||||
def _spawn_chrome(self, cmd: list[str]) -> int | None: ...
|
||||
def _chrome_start(self) -> None: ...
|
||||
def _find_websocket(self) -> None: ...
|
||||
def _json_command(self, command: str, timeout: int = ..., get_key: Any | None = ...): ...
|
||||
def _json_command(
|
||||
self, command: str, timeout: int = ..., get_key: Any | None = ...
|
||||
): ...
|
||||
def _open_websocket(self) -> None: ...
|
||||
def _websocket_send(self, method: str, params: Any | None = ...) -> int | None: ...
|
||||
def _get_message(self, raise_log_error: bool = ...) -> dict: ...
|
||||
_TO_LEVEL: dict[str, int]
|
||||
def _websocket_wait_id(self, awaited_id: int, timeout: int = ...) -> dict: ...
|
||||
def _websocket_wait_event(self, method: str, params: dict | None = ..., timeout: int = ...) -> dict | None: ...
|
||||
def _websocket_wait_event(
|
||||
self, method: str, params: dict | None = ..., timeout: int = ...
|
||||
) -> dict | None: ...
|
||||
def take_screenshot(self, prefix: str = ..., suffix: str | None = ...) -> None: ...
|
||||
def _save_screencast(self, prefix: str = ...) -> None: ...
|
||||
screencasts_frames_dir: str
|
||||
@@ -201,17 +238,35 @@ class HttpCase(TransactionCase):
|
||||
def start_browser(cls) -> None: ...
|
||||
@classmethod
|
||||
def terminate_browser(cls) -> None: ...
|
||||
def url_open(self, url: str, data: Any | None = ..., files: Mapping | None = ..., timeout: int = ...,
|
||||
headers: Mapping | None = ..., allow_redirects: bool = ..., head: bool = ...) -> requests.Response: ...
|
||||
def url_open(
|
||||
self,
|
||||
url: str,
|
||||
data: Any | None = ...,
|
||||
files: Mapping | None = ...,
|
||||
timeout: int = ...,
|
||||
headers: Mapping | None = ...,
|
||||
allow_redirects: bool = ...,
|
||||
head: bool = ...,
|
||||
) -> requests.Response: ...
|
||||
def _wait_remaining_requests(self, timeout: int = ...) -> None: ...
|
||||
def logout(self, keep_db: bool = ...) -> None: ...
|
||||
session: OpenERPSession
|
||||
def authenticate(self, user, password) -> OpenERPSession: ...
|
||||
def browser_js(self, url_path: str, code: str, ready: str = ..., login: str | None = ..., timeout: int = ...,
|
||||
cookies: Any | None = ..., **kw) -> None: ...
|
||||
def browser_js(
|
||||
self,
|
||||
url_path: str,
|
||||
code: str,
|
||||
ready: str = ...,
|
||||
login: str | None = ...,
|
||||
timeout: int = ...,
|
||||
cookies: Any | None = ...,
|
||||
**kw
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def base_url(cls) -> str: ...
|
||||
def start_tour(self, url_path: str, tour_name: str, step_delay: float | None = ..., **kwargs) -> None: ...
|
||||
def start_tour(
|
||||
self, url_path: str, tour_name: str, step_delay: float | None = ..., **kwargs
|
||||
) -> None: ...
|
||||
def profile(self, **kwargs) -> profiler.Nested: ...
|
||||
|
||||
class HttpSavepointCase(HttpCase):
|
||||
@@ -231,14 +286,24 @@ class Form(Generic[_ModelT]):
|
||||
_values: dict
|
||||
_changed: set
|
||||
def __init__(self, recordp: _ModelT, view: _ModelT | str | None = ...) -> None: ...
|
||||
def _o2m_set_edition_view(self, descr: dict, node: _Element, level: int) -> None: ...
|
||||
def _o2m_set_edition_view(
|
||||
self, descr: dict, node: _Element, level: int
|
||||
) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def _process_fvg(self, model: BaseModel, fvg: dict, level: int = ...) -> None: ...
|
||||
def _init_from_defaults(self, model: BaseModel) -> None: ...
|
||||
def _init_from_values(self, values: BaseModel) -> None: ...
|
||||
def __getattr__(self, field: str): ...
|
||||
def _get_modifier(self, field: str, modifier: str, *, default: Any = ..., view: Any = ..., modmap: Any | None = ...,
|
||||
vals: Any | None = ...): ...
|
||||
def _get_modifier(
|
||||
self,
|
||||
field: str,
|
||||
modifier: str,
|
||||
*,
|
||||
default: Any = ...,
|
||||
view: Any = ...,
|
||||
modmap: Any | None = ...,
|
||||
vals: Any | None = ...
|
||||
): ...
|
||||
_OPS: dict[str, Callable[..., bool]]
|
||||
def _get_context(self, field: str): ...
|
||||
def __setattr__(self, field: str, value) -> None: ...
|
||||
@@ -246,8 +311,16 @@ class Form(Generic[_ModelT]):
|
||||
def __exit__(self, etype, _evalue, _etb) -> None: ...
|
||||
def save(self) -> _ModelT: ...
|
||||
def _values_to_save(self, all_fields: bool = ...) -> dict: ...
|
||||
def _values_to_save_(self, record_values: dict, fields: dict, view: Any, changed: set, all_fields: bool = ...,
|
||||
modifiers_values: dict | None = ..., parent_link: Any | None = ...) -> dict: ...
|
||||
def _values_to_save_(
|
||||
self,
|
||||
record_values: dict,
|
||||
fields: dict,
|
||||
view: Any,
|
||||
changed: set,
|
||||
all_fields: bool = ...,
|
||||
modifiers_values: dict | None = ...,
|
||||
parent_link: Any | None = ...,
|
||||
) -> dict: ...
|
||||
def _perform_onchange(self, fields: list[str]) -> dict: ...
|
||||
def _onchange_values(self) -> dict: ...
|
||||
def _onchange_values_(self, fields, record: dict) -> dict: ...
|
||||
@@ -257,8 +330,16 @@ class O2MForm(Form):
|
||||
_proxy: O2MProxy
|
||||
_index: int | None
|
||||
def __init__(self, proxy: O2MProxy, index: int | None = ...) -> None: ...
|
||||
def _get_modifier(self, field: str, modifier: str, *, default: Any = ..., view: Any = ..., modmap: Any | None = ...,
|
||||
vals: Any | None = ...): ...
|
||||
def _get_modifier(
|
||||
self,
|
||||
field: str,
|
||||
modifier: str,
|
||||
*,
|
||||
default: Any = ...,
|
||||
view: Any = ...,
|
||||
modmap: Any | None = ...,
|
||||
vals: Any | None = ...
|
||||
): ...
|
||||
def _onchange_values(self) -> dict: ...
|
||||
def save(self) -> None: ...
|
||||
def _values_to_save(self, all_fields: bool = ...) -> UpdateDict: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from types import ModuleType
|
||||
from typing import Iterator
|
||||
|
||||
from .runner import OdooTestResult
|
||||
from ..tests import OdooSuite
|
||||
from .runner import OdooTestResult
|
||||
|
||||
def get_test_modules(module: str) -> list: ...
|
||||
def _get_tests_modules(path: str, module: str) -> list: ...
|
||||
|
||||
@@ -8,8 +8,17 @@ class OdooTestResult(unittest.result.TestResult):
|
||||
def __str__(self) -> str: ...
|
||||
shouldStop: Any
|
||||
def update(self, other) -> None: ...
|
||||
def log(self, level, msg, *args, test: Any | None = ..., exc_info: Any | None = ..., extra: Any | None = ...,
|
||||
stack_info: bool = ..., caller_infos: Any | None = ...) -> None: ...
|
||||
def log(
|
||||
self,
|
||||
level,
|
||||
msg,
|
||||
*args,
|
||||
test: Any | None = ...,
|
||||
exc_info: Any | None = ...,
|
||||
extra: Any | None = ...,
|
||||
stack_info: bool = ...,
|
||||
caller_infos: Any | None = ...
|
||||
) -> None: ...
|
||||
def getDescription(self, test): ...
|
||||
def startTest(self, test) -> None: ...
|
||||
def addError(self, test, err) -> None: ...
|
||||
|
||||
@@ -1,27 +1,23 @@
|
||||
from .misc import *
|
||||
from .translate import *
|
||||
from .image import *
|
||||
from .sql import *
|
||||
from .float_utils import *
|
||||
from .mail import *
|
||||
from .func import *
|
||||
from .debugger import *
|
||||
from .xml_utils import *
|
||||
from .date_utils import *
|
||||
from .convert import *
|
||||
from .template_inheritance import *
|
||||
from . import (
|
||||
appdirs as appdirs,
|
||||
cloc as cloc,
|
||||
osutil as osutil,
|
||||
pdf as pdf,
|
||||
pycompat as pycompat
|
||||
)
|
||||
from . import appdirs as appdirs
|
||||
from . import cloc as cloc
|
||||
from . import osutil as osutil
|
||||
from . import pdf as pdf
|
||||
from . import pycompat as pycompat
|
||||
from .config import config as config
|
||||
from .js_transpiler import (
|
||||
ODOO_MODULE_RE as ODOO_MODULE_RE,
|
||||
URL_RE as URL_RE,
|
||||
is_odoo_module as is_odoo_module,
|
||||
transpile_javascript as transpile_javascript
|
||||
)
|
||||
from .convert import *
|
||||
from .date_utils import *
|
||||
from .debugger import *
|
||||
from .float_utils import *
|
||||
from .func import *
|
||||
from .image import *
|
||||
from .js_transpiler import ODOO_MODULE_RE as ODOO_MODULE_RE
|
||||
from .js_transpiler import URL_RE as URL_RE
|
||||
from .js_transpiler import is_odoo_module as is_odoo_module
|
||||
from .js_transpiler import transpile_javascript as transpile_javascript
|
||||
from .mail import *
|
||||
from .misc import *
|
||||
from .sourcemap_generator import SourceMapGenerator as SourceMapGenerator
|
||||
from .sql import *
|
||||
from .template_inheritance import *
|
||||
from .translate import *
|
||||
from .xml_utils import *
|
||||
|
||||
@@ -3,22 +3,24 @@ from typing import Any, Generic, TypeVar
|
||||
|
||||
from werkzeug.datastructures import CallbackDict
|
||||
|
||||
_ModificationTrackingDictT = TypeVar('_ModificationTrackingDictT', bound=ModificationTrackingDict)
|
||||
_SessionT = TypeVar('_SessionT', bound=Session)
|
||||
_ModificationTrackingDictT = TypeVar(
|
||||
"_ModificationTrackingDictT", bound=ModificationTrackingDict
|
||||
)
|
||||
_SessionT = TypeVar("_SessionT", bound=Session)
|
||||
|
||||
_sha1_re: Pattern
|
||||
|
||||
def generate_key(salt: Any = ...) -> str: ...
|
||||
|
||||
class ModificationTrackingDict(CallbackDict):
|
||||
__slots__ = ('modified',)
|
||||
__slots__ = ("modified",)
|
||||
modified: bool
|
||||
def __init__(self, *args, **kwargs): ...
|
||||
def copy(self: _ModificationTrackingDictT) -> _ModificationTrackingDictT: ...
|
||||
def __copy__(self: _ModificationTrackingDictT) -> _ModificationTrackingDictT: ...
|
||||
|
||||
class Session(ModificationTrackingDict):
|
||||
__slots__ = ('modified', 'sid', 'new')
|
||||
__slots__ = ("modified", "sid", "new")
|
||||
sid: str
|
||||
new: bool
|
||||
def __init__(self, data, sid, new: bool = ...): ...
|
||||
@@ -44,8 +46,14 @@ class FilesystemSessionStore(SessionStore[_SessionT]):
|
||||
filename_template: str
|
||||
renew_missing: bool
|
||||
mode: int
|
||||
def __init__(self, path: str | None = ..., filename_template: str = ..., session_class: type[_SessionT] | None = ...,
|
||||
renew_missing: bool = ..., mode: int = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
path: str | None = ...,
|
||||
filename_template: str = ...,
|
||||
session_class: type[_SessionT] | None = ...,
|
||||
renew_missing: bool = ...,
|
||||
mode: int = ...,
|
||||
) -> None: ...
|
||||
def get_session_filename(self, sid: str) -> str: ...
|
||||
def save(self, session: _SessionT) -> None: ...
|
||||
def delete(self, session: _SessionT) -> None: ...
|
||||
|
||||
@@ -6,7 +6,9 @@ class UserAgentParser(object):
|
||||
_browser_version_re: str
|
||||
_language_re: Pattern
|
||||
def __init__(self) -> None: ...
|
||||
def __call__(self, user_agent: str) -> tuple[str | None, str | None, str | None, str | None]: ...
|
||||
def __call__(
|
||||
self, user_agent: str
|
||||
) -> tuple[str | None, str | None, str | None, str | None]: ...
|
||||
|
||||
class UserAgent(object):
|
||||
_parser: UserAgentParser
|
||||
|
||||
@@ -3,12 +3,42 @@ from typing import Callable
|
||||
__version_info__: tuple
|
||||
__version__: str
|
||||
|
||||
def user_data_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ...) -> str: ...
|
||||
def site_data_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ...) -> str: ...
|
||||
def user_config_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ...) -> str: ...
|
||||
def site_config_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ...) -> str: ...
|
||||
def user_cache_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ...) -> str: ...
|
||||
def user_log_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ...) -> str: ...
|
||||
def user_data_dir(
|
||||
appname: str | None = ...,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
roaming: bool = ...,
|
||||
) -> str: ...
|
||||
def site_data_dir(
|
||||
appname: str | None = ...,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
multipath: bool = ...,
|
||||
) -> str: ...
|
||||
def user_config_dir(
|
||||
appname: str | None = ...,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
roaming: bool = ...,
|
||||
) -> str: ...
|
||||
def site_config_dir(
|
||||
appname: str | None = ...,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
multipath: bool = ...,
|
||||
) -> str: ...
|
||||
def user_cache_dir(
|
||||
appname: str | None = ...,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
opinion: bool = ...,
|
||||
) -> str: ...
|
||||
def user_log_dir(
|
||||
appname: str | None = ...,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
opinion: bool = ...,
|
||||
) -> str: ...
|
||||
|
||||
class AppDirs:
|
||||
appname: str
|
||||
@@ -16,7 +46,14 @@ class AppDirs:
|
||||
version: str | None
|
||||
roaming: bool
|
||||
multipath: bool
|
||||
def __init__(self, appname: str, appauthor: str | None = ..., version: str | None = ..., roaming: bool = ..., multipath: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
appname: str,
|
||||
appauthor: str | None = ...,
|
||||
version: str | None = ...,
|
||||
roaming: bool = ...,
|
||||
multipath: bool = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def user_data_dir(self) -> str: ...
|
||||
@property
|
||||
@@ -33,4 +70,5 @@ class AppDirs:
|
||||
def _get_win_folder_from_registry(csidl_name: str) -> str: ...
|
||||
def _get_win_folder_with_pywin32(csidl_name: str) -> str: ...
|
||||
def _get_win_folder_with_ctypes(csidl_name: str) -> str: ...
|
||||
|
||||
_get_win_folder: Callable[[str], str]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from collections import defaultdict
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
from .lru import LRU
|
||||
from ..models import BaseModel
|
||||
from .lru import LRU
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_CallableT = TypeVar('_CallableT')
|
||||
_T = TypeVar("_T")
|
||||
_CallableT = TypeVar("_CallableT")
|
||||
|
||||
unsafe_eval = eval
|
||||
|
||||
@@ -27,7 +27,9 @@ class ormcache:
|
||||
def __call__(self, method: _CallableT) -> _CallableT: ...
|
||||
key: Any
|
||||
def determine_key(self): ...
|
||||
def lru(self, model: BaseModel) -> tuple[LRU, tuple[str, Callable], ormcache_counter]: ...
|
||||
def lru(
|
||||
self, model: BaseModel
|
||||
) -> tuple[LRU, tuple[str, Callable], ormcache_counter]: ...
|
||||
def lookup(self, method: Callable, *args, **kwargs): ...
|
||||
def clear(self, model: BaseModel, *args) -> None: ...
|
||||
|
||||
@@ -52,4 +54,5 @@ class dummy_cache:
|
||||
|
||||
def log_ormcache_stats(sig: Any | None = ..., frame: Any | None = ...): ...
|
||||
def get_cache_key_counter(bound_method, *args, **kwargs): ...
|
||||
|
||||
cache = ormcache
|
||||
|
||||
@@ -24,7 +24,13 @@ class Cloc:
|
||||
def parse_scss(self, s: str) -> tuple[int, int]: ...
|
||||
def parse_css(self, s: str) -> tuple[int, int]: ...
|
||||
def parse(self, s: str, ext: str) -> tuple[int, int]: ...
|
||||
def book(self, module: str, item: str = ..., count: tuple[Any, Any] = ..., exclude: bool = ...) -> None: ...
|
||||
def book(
|
||||
self,
|
||||
module: str,
|
||||
item: str = ...,
|
||||
count: tuple[Any, Any] = ...,
|
||||
exclude: bool = ...,
|
||||
) -> None: ...
|
||||
def count_path(self, path: str, exclude: set[str] | None = ...) -> None: ...
|
||||
def count_modules(self, env: Environment) -> None: ...
|
||||
def count_customization(self, env: Environment) -> None: ...
|
||||
|
||||
@@ -28,10 +28,16 @@ class configmanager:
|
||||
def _parse_config(self, args: list | None = ...): ...
|
||||
def _warn_deprecated_options(self) -> None: ...
|
||||
def _is_addons_path(self, path: str) -> bool: ...
|
||||
def _check_addons_path(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
|
||||
def _check_upgrade_path(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
|
||||
def _check_addons_path(
|
||||
self, option: MyOption, opt, value, parser: OptionParser
|
||||
) -> None: ...
|
||||
def _check_upgrade_path(
|
||||
self, option: MyOption, opt, value, parser: OptionParser
|
||||
) -> None: ...
|
||||
def _is_upgrades_path(self, res: str) -> bool: ...
|
||||
def _test_enable_callback(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
|
||||
def _test_enable_callback(
|
||||
self, option: MyOption, opt, value, parser: OptionParser
|
||||
) -> None: ...
|
||||
def load(self) -> None: ...
|
||||
def save(self) -> None: ...
|
||||
def get(self, key, default: Any | None = ...): ...
|
||||
|
||||
@@ -3,13 +3,15 @@ from typing import Any, Callable, TextIO
|
||||
|
||||
from lxml.etree import _Element
|
||||
|
||||
from .misc import ustr as ustr
|
||||
from ..api import Environment
|
||||
from ..sql_db import Cursor
|
||||
from .misc import ustr as ustr
|
||||
|
||||
__all__ = [
|
||||
'convert_file', 'convert_sql_import',
|
||||
'convert_csv_import', 'convert_xml_import'
|
||||
"convert_file",
|
||||
"convert_sql_import",
|
||||
"convert_csv_import",
|
||||
"convert_xml_import",
|
||||
]
|
||||
|
||||
safe_eval: Callable
|
||||
@@ -28,7 +30,9 @@ def str2bool(value) -> bool: ...
|
||||
def nodeattr2bool(node: _Element, attr, default: bool = ...) -> bool: ...
|
||||
|
||||
class xml_import:
|
||||
def get_env(self, node: _Element, eval_context: dict | None = ...) -> Environment: ...
|
||||
def get_env(
|
||||
self, node: _Element, eval_context: dict | None = ...
|
||||
) -> Environment: ...
|
||||
def make_xml_id(self, xml_id: str) -> str: ...
|
||||
def _test_xml_id(self, xml_id: str) -> None: ...
|
||||
def _tag_delete(self, rec: _Element) -> None: ...
|
||||
@@ -39,7 +43,9 @@ class xml_import:
|
||||
def _tag_record(self, rec: _Element) -> tuple[str, int] | None: ...
|
||||
def _tag_template(self, el: _Element) -> tuple[str, int] | None: ...
|
||||
def id_get(self, id_str: str, raise_if_not_found: bool = ...) -> int | None: ...
|
||||
def model_id_get(self, id_str: str, raise_if_not_found: bool = ...) -> tuple[Any, Any]: ...
|
||||
def model_id_get(
|
||||
self, id_str: str, raise_if_not_found: bool = ...
|
||||
) -> tuple[Any, Any]: ...
|
||||
def _tag_root(self, el: _Element) -> None: ...
|
||||
@property
|
||||
def env(self) -> Environment: ...
|
||||
@@ -52,11 +58,44 @@ class xml_import:
|
||||
_noupdate: list[bool]
|
||||
xml_filename: str
|
||||
_tags: dict[str, Callable]
|
||||
def __init__(self, cr: Cursor, module: str, idref: dict, mode: str, noupdate: bool = ..., xml_filename: str | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
cr: Cursor,
|
||||
module: str,
|
||||
idref: dict,
|
||||
mode: str,
|
||||
noupdate: bool = ...,
|
||||
xml_filename: str | None = ...,
|
||||
) -> None: ...
|
||||
def parse(self, de: _Element) -> None: ...
|
||||
DATA_ROOTS: list[str]
|
||||
|
||||
def convert_file(cr: Cursor, module: str, filename: str, idref: dict, mode: str = ..., noupdate: bool = ..., kind: str | None = ..., pathname: str | None = ...) -> None: ...
|
||||
def convert_file(
|
||||
cr: Cursor,
|
||||
module: str,
|
||||
filename: str,
|
||||
idref: dict,
|
||||
mode: str = ...,
|
||||
noupdate: bool = ...,
|
||||
kind: str | None = ...,
|
||||
pathname: str | None = ...,
|
||||
) -> None: ...
|
||||
def convert_sql_import(cr: Cursor, fp: TextIO) -> None: ...
|
||||
def convert_csv_import(cr: Cursor, module: str, fname: str, csvcontent: bytes, idref: dict | None = ..., mode: str = ..., noupdate: bool = ...) -> None: ...
|
||||
def convert_xml_import(cr: Cursor, module: str, xmlfile: str | BufferedReader, idref: dict | None = ..., mode: str = ..., noupdate: bool = ..., report: Any | None = ...) -> None: ...
|
||||
def convert_csv_import(
|
||||
cr: Cursor,
|
||||
module: str,
|
||||
fname: str,
|
||||
csvcontent: bytes,
|
||||
idref: dict | None = ...,
|
||||
mode: str = ...,
|
||||
noupdate: bool = ...,
|
||||
) -> None: ...
|
||||
def convert_xml_import(
|
||||
cr: Cursor,
|
||||
module: str,
|
||||
xmlfile: str | BufferedReader,
|
||||
idref: dict | None = ...,
|
||||
mode: str = ...,
|
||||
noupdate: bool = ...,
|
||||
report: Any | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
import datetime
|
||||
from typing import Tuple, Iterator, TypeVar
|
||||
from typing import Iterator, Tuple, TypeVar
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
_DateTimeT = TypeVar('_DateTimeT', datetime.date, datetime.datetime)
|
||||
_DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime)
|
||||
|
||||
def get_month(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
|
||||
def get_quarter_number(date: _DateTimeT) -> int: ...
|
||||
def get_quarter(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
|
||||
def get_fiscal_year(date: _DateTimeT, day: int = ..., month: int = ...) -> Tuple[_DateTimeT, _DateTimeT]: ...
|
||||
def get_fiscal_year(
|
||||
date: _DateTimeT, day: int = ..., month: int = ...
|
||||
) -> Tuple[_DateTimeT, _DateTimeT]: ...
|
||||
def get_timedelta(qty: int, granularity: str) -> relativedelta: ...
|
||||
def start_of(value: _DateTimeT, granularity: str) -> _DateTimeT: ...
|
||||
def end_of(value: _DateTimeT, granularity: str) -> _DateTimeT: ...
|
||||
def add(value: _DateTimeT, *args, **kwargs) -> _DateTimeT: ...
|
||||
def subtract(value: _DateTimeT, *args, **kwargs) -> _DateTimeT: ...
|
||||
def json_default(obj) -> str: ...
|
||||
def date_range(start: datetime.datetime, end: datetime.datetime, step: relativedelta = ...) -> Iterator[datetime.datetime]: ...
|
||||
def date_range(
|
||||
start: datetime.datetime, end: datetime.datetime, step: relativedelta = ...
|
||||
) -> Iterator[datetime.datetime]: ...
|
||||
|
||||
@@ -1,10 +1,30 @@
|
||||
def round(f: float) -> float: ...
|
||||
def _float_check_precision(precision_digits: int | None = ..., precision_rounding: float | None = ...) -> float: ...
|
||||
def float_round(value: float, precision_digits: int | None = ..., precision_rounding: float | None = ..., rounding_method: str = ...) -> float: ...
|
||||
def float_is_zero(value: float, precision_digits: int | None = ..., precision_rounding: float | None = ...) -> bool: ...
|
||||
def float_compare(value1: float, value2: float, precision_digits: int | None = ..., precision_rounding: float | None = ...) -> int: ...
|
||||
def _float_check_precision(
|
||||
precision_digits: int | None = ..., precision_rounding: float | None = ...
|
||||
) -> float: ...
|
||||
def float_round(
|
||||
value: float,
|
||||
precision_digits: int | None = ...,
|
||||
precision_rounding: float | None = ...,
|
||||
rounding_method: str = ...,
|
||||
) -> float: ...
|
||||
def float_is_zero(
|
||||
value: float,
|
||||
precision_digits: int | None = ...,
|
||||
precision_rounding: float | None = ...,
|
||||
) -> bool: ...
|
||||
def float_compare(
|
||||
value1: float,
|
||||
value2: float,
|
||||
precision_digits: int | None = ...,
|
||||
precision_rounding: float | None = ...,
|
||||
) -> int: ...
|
||||
def float_repr(value: float, precision_digits: int) -> str: ...
|
||||
|
||||
_float_repr = float_repr
|
||||
|
||||
def float_split_str(value: float, precision_digits: int) -> tuple[str, str]: ...
|
||||
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 json_float_round(
|
||||
value: float, precision_digits: int, rounding_method: str = ...
|
||||
) -> float: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from json import JSONEncoder as JSONEncoder
|
||||
from typing import Callable, Generic, TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class lazy_property(Generic[_T]):
|
||||
fget: Callable[..., _T]
|
||||
@@ -26,7 +26,7 @@ class _ClassProperty(property, Generic[_T]):
|
||||
def classproperty(func: Callable[..., _T]) -> _ClassProperty[_T]: ...
|
||||
|
||||
class lazy:
|
||||
__slots__ = ['_func', '_args', '_kwargs', '_cached_value']
|
||||
__slots__ = ["_func", "_args", "_kwargs", "_cached_value"]
|
||||
def __init__(self, func, *args, **kwargs) -> None: ...
|
||||
@property
|
||||
def _value(self): ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from PIL import IcoImagePlugin as IcoImagePlugin, ImageOps as ImageOps
|
||||
from typing import Any, Iterable, Literal
|
||||
|
||||
from PIL import IcoImagePlugin as IcoImagePlugin
|
||||
from PIL import ImageOps as ImageOps
|
||||
from PIL.Image import Image
|
||||
|
||||
FILETYPE_BASE64_MAGICWORD: dict[bytes, str]
|
||||
@@ -14,14 +15,34 @@ class ImageProcess:
|
||||
image: Image | Literal[False]
|
||||
original_format: str
|
||||
def __init__(self, base64_source: bytes, verify_resolution: bool = ...) -> None: ...
|
||||
def image_quality(self, quality: int = ..., output_format: str = ...) -> bytes | Literal[False]: ...
|
||||
def image_base64(self, quality: int = ..., output_format: str = ...) -> bytes | Literal[False]: ...
|
||||
def image_quality(
|
||||
self, quality: int = ..., output_format: str = ...
|
||||
) -> bytes | Literal[False]: ...
|
||||
def image_base64(
|
||||
self, quality: int = ..., output_format: str = ...
|
||||
) -> bytes | Literal[False]: ...
|
||||
def resize(self, max_width: int = ..., max_height: int = ...) -> ImageProcess: ...
|
||||
def crop_resize(self, max_width: int, max_height: int, center_x: float = ..., center_y: float = ...) -> ImageProcess: ...
|
||||
def crop_resize(
|
||||
self,
|
||||
max_width: int,
|
||||
max_height: int,
|
||||
center_x: float = ...,
|
||||
center_y: float = ...,
|
||||
) -> ImageProcess: ...
|
||||
def colorize(self) -> ImageProcess: ...
|
||||
|
||||
def image_process(base64_source: bytes, size: tuple[int, int] = ..., verify_resolution: bool = ..., quality: int = ..., crop: str | None = ..., colorize: bool = ..., output_format: str = ...) -> bytes: ...
|
||||
def average_dominant_color(colors: list[tuple[Any, Any]], mitigate: int = ..., max_margin: int = ...) -> tuple[Any, Any]: ...
|
||||
def image_process(
|
||||
base64_source: bytes,
|
||||
size: tuple[int, int] = ...,
|
||||
verify_resolution: bool = ...,
|
||||
quality: int = ...,
|
||||
crop: str | None = ...,
|
||||
colorize: bool = ...,
|
||||
output_format: str = ...,
|
||||
) -> bytes: ...
|
||||
def average_dominant_color(
|
||||
colors: list[tuple[Any, Any]], mitigate: int = ..., max_margin: int = ...
|
||||
) -> tuple[Any, Any]: ...
|
||||
def image_fix_orientation(image: Image) -> Image: ...
|
||||
def base64_to_image(base64_source: bytes) -> Image: ...
|
||||
def image_apply_opt(image: Image, format: str | None, **params) -> bytes: ...
|
||||
|
||||
@@ -17,7 +17,8 @@ def convert_export_class(content: str) -> str: ...
|
||||
|
||||
EXPORT_FCT_DEFAULT_RE: Pattern
|
||||
|
||||
def convert_export_function_default(content: str): str: ...
|
||||
def convert_export_function_default(content: str):
|
||||
str: ...
|
||||
|
||||
EXPORT_CLASS_DEFAULT_RE: Pattern
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from collections import OrderedDict
|
||||
from threading import RLock
|
||||
from typing import Any
|
||||
|
||||
__all__ = ['LRU']
|
||||
__all__ = ["LRU"]
|
||||
|
||||
class LRU:
|
||||
_lock: RLock
|
||||
|
||||
@@ -21,8 +21,16 @@ class _Cleaner(clean.Cleaner):
|
||||
def strip_class(self, el: _Element) -> None: ...
|
||||
def parse_style(self, el: _Element) -> None: ...
|
||||
|
||||
def html_sanitize(src: str, silent: bool = ..., sanitize_tags: bool = ..., sanitize_attributes: bool = ..., sanitize_style: bool = ...,
|
||||
sanitize_form: bool = ..., strip_style: bool = ..., strip_classes: bool = ...) -> Markup: ...
|
||||
def html_sanitize(
|
||||
src: str,
|
||||
silent: bool = ...,
|
||||
sanitize_tags: bool = ...,
|
||||
sanitize_attributes: bool = ...,
|
||||
sanitize_style: bool = ...,
|
||||
sanitize_form: bool = ...,
|
||||
strip_style: bool = ...,
|
||||
strip_classes: bool = ...,
|
||||
) -> Markup: ...
|
||||
|
||||
URL_REGEX: str
|
||||
TEXT_URL_REGEX: str
|
||||
@@ -31,9 +39,17 @@ HTML_TAG_URL_REGEX: str
|
||||
def validate_url(url: str) -> str: ...
|
||||
def is_html_empty(html_content: str) -> bool: ...
|
||||
def html_keep_url(text: str) -> str: ...
|
||||
def html2plaintext(html: str, body_id: str | None = ..., encoding: str = ...) -> str: ...
|
||||
def html2plaintext(
|
||||
html: str, body_id: str | None = ..., encoding: str = ...
|
||||
) -> str: ...
|
||||
def plaintext2html(text: str, container_tag: str = ...) -> Markup: ...
|
||||
def append_content_to_html(html: str, content: str, plaintext: bool = ..., preserve: bool = ..., container_tag: str = ...) -> Markup: ...
|
||||
def append_content_to_html(
|
||||
html: str,
|
||||
content: str,
|
||||
plaintext: bool = ...,
|
||||
preserve: bool = ...,
|
||||
container_tag: str = ...,
|
||||
) -> Markup: ...
|
||||
def prepend_html_content(html_body: str, html_content: str) -> str: ...
|
||||
|
||||
email_re: Pattern
|
||||
@@ -50,6 +66,8 @@ def email_domain_extract(email: str) -> str | Literal[False]: ...
|
||||
def email_domain_normalize(domain: str) -> str | Literal[False]: ...
|
||||
def url_domain_extract(url: str) -> str | Literal[False]: ...
|
||||
def email_escape_char(email_address: str) -> str: ...
|
||||
def decode_message_header(message: Message, header: str, separator: str = ...) -> str: ...
|
||||
def decode_message_header(
|
||||
message: Message, header: str, separator: str = ...
|
||||
) -> str: ...
|
||||
def formataddr(pair: tuple[str, str], charset: str = ...) -> str: ...
|
||||
def encapsulate_email(old_email: str, new_email: str) -> str: ...
|
||||
|
||||
@@ -2,7 +2,7 @@ import collections
|
||||
from re import Pattern
|
||||
from typing import Any, Literal
|
||||
|
||||
__all__ = ['guess_mimetype']
|
||||
__all__ = ["guess_mimetype"]
|
||||
_ooxml_dirs: dict[str, str]
|
||||
|
||||
def _check_ooxml(data: bytes) -> str | Literal[False]: ...
|
||||
@@ -17,7 +17,7 @@ _ppt_pattern: Pattern
|
||||
def _check_olecf(data: bytes) -> str | Literal[False]: ...
|
||||
def _check_svg(data: bytes) -> str | None: ...
|
||||
|
||||
_Entry = collections.namedtuple('_Entry', ['mimetype', 'signatures', 'discriminants'])
|
||||
_Entry = collections.namedtuple("_Entry", ["mimetype", "signatures", "discriminants"])
|
||||
_mime_mappings: tuple[_Entry, ...]
|
||||
|
||||
def _odoo_guess_mimetype(bin_data: str, default: str = ...) -> str: ...
|
||||
@@ -26,7 +26,5 @@ _guesser: Any
|
||||
ms: Any
|
||||
|
||||
def guess_mimetype(bin_data: str, default: str | None = ...) -> str: ...
|
||||
|
||||
def neuter_mimetype(mimetype: str, user: 'odoo.model.res_users') -> str: ...
|
||||
|
||||
def neuter_mimetype(mimetype: str, user: "odoo.model.res_users") -> str: ...
|
||||
def get_extension(filename: str) -> str: ...
|
||||
|
||||
@@ -4,7 +4,19 @@ from collections import deque
|
||||
from collections.abc import Mapping, MutableMapping, MutableSet
|
||||
from logging import Filter, LogRecord
|
||||
from types import ModuleType
|
||||
from typing import Any, Collection, Generic, IO, AnyStr, ItemsView, Iterable, Iterator, NoReturn, TypeVar, Callable
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
AnyStr,
|
||||
Callable,
|
||||
Collection,
|
||||
Generic,
|
||||
ItemsView,
|
||||
Iterable,
|
||||
Iterator,
|
||||
NoReturn,
|
||||
TypeVar,
|
||||
)
|
||||
|
||||
import markupsafe
|
||||
import xlsxwriter
|
||||
@@ -12,33 +24,44 @@ import xlwt
|
||||
from babel.core import Locale
|
||||
from xlwt import Worksheet
|
||||
|
||||
from ..api import Environment
|
||||
from ..loglevels import exception_to_unicode as exception_to_unicode
|
||||
from ..loglevels import get_encodings as get_encodings
|
||||
from ..sql_db import Cursor
|
||||
from .cache import *
|
||||
from .parse_version import parse_version as parse_version
|
||||
from ..api import Environment
|
||||
from ..loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings
|
||||
from ..sql_db import Cursor
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T1 = TypeVar('_T1')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_T = TypeVar("_T")
|
||||
_T1 = TypeVar("_T1")
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
|
||||
SKIPPED_ELEMENT_TYPES: tuple
|
||||
NON_BREAKING_SPACE: str
|
||||
|
||||
def find_in_path(name: str) -> str: ...
|
||||
def _exec_pipe(prog, args, env: Mapping[str, str] | None = ...) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
|
||||
def exec_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
|
||||
def _exec_pipe(
|
||||
prog, args, env: Mapping[str, str] | None = ...
|
||||
) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
|
||||
def exec_command_pipe(
|
||||
name: str, *args
|
||||
) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
|
||||
def find_pg_tool(name: str) -> str: ...
|
||||
def exec_pg_environ() -> dict[str, str]: ...
|
||||
def exec_pg_command(name: str, *args) -> None: ...
|
||||
def exec_pg_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
|
||||
def exec_pg_command_pipe(
|
||||
name: str, *args
|
||||
) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
|
||||
def file_path(file_path: str, filter_ext: tuple[str, ...] = ...) -> str: ...
|
||||
def file_open(name: str, mode: str = ..., filter_ext: tuple[str, ...] | None = ...) -> IO: ...
|
||||
def file_open(
|
||||
name: str, mode: str = ..., filter_ext: tuple[str, ...] | None = ...
|
||||
) -> IO: ...
|
||||
def flatten(list) -> list: ...
|
||||
def reverse_enumerate(l): ...
|
||||
def partition(pred: Callable[[_T], bool], elems: Iterable[_T]) -> tuple[list[_T], list[_T]]: ...
|
||||
def partition(
|
||||
pred: Callable[[_T], bool], elems: Iterable[_T]
|
||||
) -> tuple[list[_T], list[_T]]: ...
|
||||
def topological_sort(elems: dict[_T, Any]) -> list[_T]: ...
|
||||
def merge_sequences(*iterables: Iterable[_T]) -> list[_T]: ...
|
||||
|
||||
@@ -71,9 +94,15 @@ DATETIME_FORMATS_MAP: dict[str, str]
|
||||
POSIX_TO_LDML: dict[str, str]
|
||||
|
||||
def posix_to_ldml(fmt: str, locale: Locale) -> str: ...
|
||||
def split_every(n: int, iterable: Iterable[_T], piece_maker: Callable[[Iterable[_T]], _T1] = ...) -> Iterator[_T1]: ...
|
||||
def get_and_group_by_field(cr: Cursor, uid: int, obj, ids, field: str, context: dict | None = ...) -> dict: ...
|
||||
def get_and_group_by_company(cr: Cursor, uid: int, obj, ids, context: dict | None = ...) -> dict: ...
|
||||
def split_every(
|
||||
n: int, iterable: Iterable[_T], piece_maker: Callable[[Iterable[_T]], _T1] = ...
|
||||
) -> Iterator[_T1]: ...
|
||||
def get_and_group_by_field(
|
||||
cr: Cursor, uid: int, obj, ids, field: str, context: dict | None = ...
|
||||
) -> dict: ...
|
||||
def get_and_group_by_company(
|
||||
cr: Cursor, uid: int, obj, ids, context: dict | None = ...
|
||||
) -> dict: ...
|
||||
def resolve_attr(obj, attr: str): ...
|
||||
def attrgetter(*items): ...
|
||||
def discardattr(obj, key: str) -> None: ...
|
||||
@@ -91,7 +120,12 @@ class mute_logger(Filter):
|
||||
def __init__(self, *loggers: str) -> None: ...
|
||||
def filter(self, record: LogRecord) -> int: ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(self, exc_type: Any | None = ..., exc_val: Any | None = ..., exc_tb: Any | None = ...) -> None: ...
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: Any | None = ...,
|
||||
exc_val: Any | None = ...,
|
||||
exc_tb: Any | None = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, func: _CallableT) -> _CallableT: ...
|
||||
|
||||
_ph: Any
|
||||
@@ -108,14 +142,16 @@ class CountingStream(Generic[_T]):
|
||||
def stripped_sys_argv(*strip_args: str) -> list[str]: ...
|
||||
|
||||
class ConstantMapping(Mapping[_KT, _VT]):
|
||||
__slots__ = ['_value']
|
||||
__slots__ = ["_value"]
|
||||
_value: _VT
|
||||
def __init__(self, val: _VT) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator: ...
|
||||
def __getitem__(self, item) -> _VT: ...
|
||||
|
||||
def dumpstacks(sig: Any | None = ..., frame: Any | None = ..., thread_idents: Any | None = ...) -> None: ...
|
||||
def dumpstacks(
|
||||
sig: Any | None = ..., frame: Any | None = ..., thread_idents: Any | None = ...
|
||||
) -> None: ...
|
||||
def freehash(arg) -> int: ...
|
||||
def clean_context(context: dict[str, Any]) -> dict[str, Any]: ...
|
||||
|
||||
@@ -138,7 +174,7 @@ class Collector(dict[_KT, tuple[_T]]):
|
||||
def discard_keys_and_values(self, excludes: Collection): ...
|
||||
|
||||
class StackMap(MutableMapping):
|
||||
__slots__ = ['_maps']
|
||||
__slots__ = ["_maps"]
|
||||
_maps: list[MutableMapping]
|
||||
def __init__(self, m: MutableMapping | None = ...) -> None: ...
|
||||
def __getitem__(self, key): ...
|
||||
@@ -151,7 +187,7 @@ class StackMap(MutableMapping):
|
||||
def popmap(self) -> MutableMapping: ...
|
||||
|
||||
class OrderedSet(MutableSet):
|
||||
__slots__ = ['_map']
|
||||
__slots__ = ["_map"]
|
||||
_map: dict
|
||||
def __init__(self, elems: Iterable = ...) -> None: ...
|
||||
def __contains__(self, elem) -> bool: ...
|
||||
@@ -167,7 +203,7 @@ class LastOrderedSet(OrderedSet):
|
||||
def add(self, elem) -> None: ...
|
||||
|
||||
class Callbacks:
|
||||
__slots__ = ['_funcs', 'data']
|
||||
__slots__ = ["_funcs", "data"]
|
||||
_funcs: deque
|
||||
data: dict
|
||||
def __init__(self) -> None: ...
|
||||
@@ -176,17 +212,19 @@ class Callbacks:
|
||||
def clear(self) -> None: ...
|
||||
|
||||
class IterableGenerator(Generic[_T]):
|
||||
__slots__ = ['func', 'args']
|
||||
__slots__ = ["func", "args"]
|
||||
func: Callable
|
||||
args: tuple
|
||||
def __init__(self, func: Callable[..., _T], *args) -> None: ...
|
||||
def __iter__(self) -> _T: ...
|
||||
|
||||
def groupby(iterable: Iterable[_T], key: Callable[..., _T1] | None = ...) -> ItemsView[_T1, _T]: ...
|
||||
def groupby(
|
||||
iterable: Iterable[_T], key: Callable[..., _T1] | None = ...
|
||||
) -> ItemsView[_T1, _T]: ...
|
||||
def unique(it: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
class Reverse:
|
||||
__slots__ = ['val']
|
||||
__slots__ = ["val"]
|
||||
val: Any
|
||||
def __init__(self, val) -> None: ...
|
||||
def __eq__(self, other) -> bool: ...
|
||||
@@ -200,21 +238,50 @@ def ignore(*exc) -> None: ...
|
||||
|
||||
html_escape = markupsafe.escape
|
||||
|
||||
def get_lang(env: Environment, lang_code: str = ...) -> 'odoo.model.res_lang': ...
|
||||
def get_lang(env: Environment, lang_code: str = ...) -> "odoo.model.res_lang": ...
|
||||
def babel_locale_parse(lang_code: str) -> Locale: ...
|
||||
def formatLang(env: Environment, value, digits: int | None = ..., grouping: bool = ..., monetary: bool = ...,
|
||||
dp: bool = ..., currency_obj: 'odoo.model.res_currency' = ...) -> str: ...
|
||||
def format_date(env: Environment, value: datetime.date | datetime.datetime | str, lang_code: str = ...,
|
||||
date_format: str = ...) -> str: ...
|
||||
def formatLang(
|
||||
env: Environment,
|
||||
value,
|
||||
digits: int | None = ...,
|
||||
grouping: bool = ...,
|
||||
monetary: bool = ...,
|
||||
dp: bool = ...,
|
||||
currency_obj: "odoo.model.res_currency" = ...,
|
||||
) -> str: ...
|
||||
def format_date(
|
||||
env: Environment,
|
||||
value: datetime.date | datetime.datetime | str,
|
||||
lang_code: str = ...,
|
||||
date_format: str = ...,
|
||||
) -> str: ...
|
||||
def parse_date(env: Environment, value: str, lang_code: str = ...) -> datetime.date: ...
|
||||
def format_datetime(env: Environment, value: str | datetime.datetime, tz: str = ...,
|
||||
dt_format: str = ..., lang_code: str = ...) -> str: ...
|
||||
def format_time(env: Environment, value, tz: str = ..., time_format: str = ..., lang_code: str = ...) -> str: ...
|
||||
def _format_time_ago(env: Environment, time_delta: datetime.timedelta | int, lang_code: str = ...,
|
||||
add_direction: bool = ...) -> str: ...
|
||||
def format_datetime(
|
||||
env: Environment,
|
||||
value: str | datetime.datetime,
|
||||
tz: str = ...,
|
||||
dt_format: str = ...,
|
||||
lang_code: str = ...,
|
||||
) -> str: ...
|
||||
def format_time(
|
||||
env: Environment, value, tz: str = ..., time_format: str = ..., lang_code: str = ...
|
||||
) -> str: ...
|
||||
def _format_time_ago(
|
||||
env: Environment,
|
||||
time_delta: datetime.timedelta | int,
|
||||
lang_code: str = ...,
|
||||
add_direction: bool = ...,
|
||||
) -> str: ...
|
||||
def format_decimalized_number(number: float, decimal: int = ...) -> str: ...
|
||||
def format_decimalized_amount(amount: float, currency: 'odoo.model.res_currency | None' = ...) -> str: ...
|
||||
def format_amount(env: Environment, amount: float, currency: 'odoo.model.res_currency', lang_code: str = ...) -> str: ...
|
||||
def format_decimalized_amount(
|
||||
amount: float, currency: "odoo.model.res_currency | None" = ...
|
||||
) -> str: ...
|
||||
def format_amount(
|
||||
env: Environment,
|
||||
amount: float,
|
||||
currency: "odoo.model.res_currency",
|
||||
lang_code: str = ...,
|
||||
) -> str: ...
|
||||
def format_duration(value: float) -> str: ...
|
||||
def _consteq(str1: str, str2: str) -> bool: ...
|
||||
|
||||
@@ -224,13 +291,17 @@ class Unpickler(pickle_.Unpickler):
|
||||
find_global: Any
|
||||
find_class: Any
|
||||
|
||||
def _pickle_load(stream: pickle_._ReadableFileobj, encoding: str = ..., errors: bool = ...): ...
|
||||
def _pickle_load(
|
||||
stream: pickle_._ReadableFileobj, encoding: str = ..., errors: bool = ...
|
||||
): ...
|
||||
|
||||
pickle: ModuleType
|
||||
|
||||
class DotDict(dict):
|
||||
def __getattr__(self, attrib): ...
|
||||
|
||||
def get_diff(data_from: tuple[str, str], data_to: tuple[str, str], custom_style: bool = ...) -> str: ...
|
||||
def get_diff(
|
||||
data_from: tuple[str, str], data_to: tuple[str, str], custom_style: bool = ...
|
||||
) -> str: ...
|
||||
def traverse_containers(val, type_) -> Iterator: ...
|
||||
def hmac(env: Environment, scope, message, hash_function = ...) -> str: ...
|
||||
def hmac(env: Environment, scope, message, hash_function=...) -> str: ...
|
||||
|
||||
@@ -6,9 +6,16 @@ WINDOWS_RESERVED: Pattern
|
||||
|
||||
def clean_filename(name: str, replacement: str = ...) -> str: ...
|
||||
def listdir(dir: str, recursive: bool = ...) -> Iterable[str]: ...
|
||||
def walksymlinks(top: str, topdown: bool = ..., onerror: Callable[[OSError], Any] | None = ...) -> Iterator[tuple[str, list[str], list[str]]]: ...
|
||||
def walksymlinks(
|
||||
top: str, topdown: bool = ..., onerror: Callable[[OSError], Any] | None = ...
|
||||
) -> Iterator[tuple[str, list[str], list[str]]]: ...
|
||||
def tempdir() -> Generator[str, None, None]: ...
|
||||
def zip_dir(path: str, stream: str | BinaryIO, include_dir: bool = ..., fnct_sort: Callable | None = ...) -> None: ...
|
||||
def zip_dir(
|
||||
path: str,
|
||||
stream: str | BinaryIO,
|
||||
include_dir: bool = ...,
|
||||
fnct_sort: Callable | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
getppid: Callable[[], int]
|
||||
is_running_as_nt_service: Callable[[], bool]
|
||||
|
||||
@@ -3,7 +3,8 @@ from re import Pattern
|
||||
from typing import Any, BinaryIO, Iterable
|
||||
|
||||
from PyPDF2 import PdfFileReader, PdfFileWriter
|
||||
from PyPDF2.generic import ArrayObject as ArrayObject, IndirectObject
|
||||
from PyPDF2.generic import ArrayObject as ArrayObject
|
||||
from PyPDF2.generic import IndirectObject
|
||||
from PyPDF2.utils import b_ as b_
|
||||
|
||||
DEFAULT_PDF_DATETIME_FORMAT: str
|
||||
@@ -14,11 +15,17 @@ def _unwrapping_get(self, key, default: Any | None = ...): ...
|
||||
|
||||
class BrandedFileWriter(PdfFileWriter):
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
PdfFileWriter = BrandedFileWriter
|
||||
|
||||
def merge_pdf(pdf_data: Iterable[bytes]) -> bytes: ...
|
||||
def rotate_pdf(pdf: bytes) -> bytes: ...
|
||||
def add_banner(pdf_stream: str | BinaryIO, text: str | None = ..., logo: bool = ..., thickness: float = ...) -> BytesIO: ...
|
||||
def add_banner(
|
||||
pdf_stream: str | BinaryIO,
|
||||
text: str | None = ...,
|
||||
logo: bool = ...,
|
||||
thickness: float = ...,
|
||||
) -> BytesIO: ...
|
||||
|
||||
class OdooPdfFileReader(PdfFileReader):
|
||||
def getAttachments(self) -> Iterable[tuple[Any, Any]]: ...
|
||||
@@ -28,10 +35,15 @@ class OdooPdfFileWriter(PdfFileWriter):
|
||||
is_pdfa: bool
|
||||
_header: bytes
|
||||
_ID: Any
|
||||
def __init__(self, *args, **kwargs): None
|
||||
def __init__(self, *args, **kwargs):
|
||||
None
|
||||
def addAttachment(self, fname: str, fdata, subtype: str | None = ...) -> None: ...
|
||||
def embed_odoo_attachment(self, attachment: 'odoo.model.ir_attachment', subtype: str | None = ...) -> None: ...
|
||||
def embed_odoo_attachment(
|
||||
self, attachment: "odoo.model.ir_attachment", subtype: str | None = ...
|
||||
) -> None: ...
|
||||
def cloneReaderDocumentRoot(self, reader: PdfFileReader) -> None: ...
|
||||
def convert_to_pdfa(self) -> None: ...
|
||||
def add_file_metadata(self, metadata_content: bytes) -> None: ...
|
||||
def _create_attachment_object(self, attachment: dict[str, Any]) -> IndirectObject: ...
|
||||
def _create_attachment_object(
|
||||
self, attachment: dict[str, Any]
|
||||
) -> IndirectObject: ...
|
||||
|
||||
@@ -6,21 +6,51 @@ from dateutil.relativedelta import relativedelta
|
||||
|
||||
from ..tools import pycompat as pycompat
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def Random(seed) -> random.Random: ...
|
||||
def format_str(val: _T, counter, values) -> _T: ...
|
||||
def chain_factories(field_factories: Iterable[tuple[str, Callable[..., Iterator]]], model_name: str) -> Iterator: ...
|
||||
def chain_factories(
|
||||
field_factories: Iterable[tuple[str, Callable[..., Iterator]]], model_name: str
|
||||
) -> Iterator: ...
|
||||
def root_factory() -> Iterator[dict]: ...
|
||||
def randomize(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
|
||||
counter_offset: int = ...) -> Callable[[Iterable, str, str], dict]: ...
|
||||
def cartesian(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
|
||||
then: Callable[[Iterable, str, str], dict] | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def iterate(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
|
||||
then: Callable[[Iterable, str, str], dict] | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def constant(val: Sequence, formatter: Callable[[Any, Any, Any], Any] = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def compute(function: Callable[[Any, Any, Any], Any], seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randint(a: int, b: int, seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randfloat(a: float, b: float, seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randdatetime(*, base_date: datetime.datetime | None = ..., relative_before: datetime.timedelta | relativedelta | None = ...,
|
||||
relative_after: datetime.timedelta | relativedelta | None = ..., seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randomize(
|
||||
vals: Sequence,
|
||||
weights: Sequence | None = ...,
|
||||
seed: Any = ...,
|
||||
formatter: Callable[[Any, Any, Any], Any] = ...,
|
||||
counter_offset: int = ...,
|
||||
) -> Callable[[Iterable, str, str], dict]: ...
|
||||
def cartesian(
|
||||
vals: Sequence,
|
||||
weights: Sequence | None = ...,
|
||||
seed: Any = ...,
|
||||
formatter: Callable[[Any, Any, Any], Any] = ...,
|
||||
then: Callable[[Iterable, str, str], dict] | None = ...,
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def iterate(
|
||||
vals: Sequence,
|
||||
weights: Sequence | None = ...,
|
||||
seed: Any = ...,
|
||||
formatter: Callable[[Any, Any, Any], Any] = ...,
|
||||
then: Callable[[Iterable, str, str], dict] | None = ...,
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def constant(
|
||||
val: Sequence, formatter: Callable[[Any, Any, Any], Any] = ...
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def compute(
|
||||
function: Callable[[Any, Any, Any], Any], seed: Any | None = ...
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randint(
|
||||
a: int, b: int, seed: Any | None = ...
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randfloat(
|
||||
a: float, b: float, seed: Any | None = ...
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
def randdatetime(
|
||||
*,
|
||||
base_date: datetime.datetime | None = ...,
|
||||
relative_before: datetime.timedelta | relativedelta | None = ...,
|
||||
relative_after: datetime.timedelta | relativedelta | None = ...,
|
||||
seed: Any | None = ...
|
||||
) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any, Callable, ContextManager, Generic, Iterable, TypeVar
|
||||
|
||||
from ..sql_db import Cursor
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T = TypeVar("_T")
|
||||
|
||||
real_datetime_now: Callable[..., datetime]
|
||||
real_time: Callable[[], float]
|
||||
@@ -13,7 +13,9 @@ real_time: Callable[[], float]
|
||||
def _format_frame(frame: FrameType) -> tuple[str, int, str, str]: ...
|
||||
def _format_stack(stack: Iterable) -> list[list]: ...
|
||||
def get_current_frame(thread: Thread | None = ...) -> FrameType: ...
|
||||
def _get_stack_trace(frame: FrameType, limit_frame: FrameType | None = ...) -> list[tuple[str, int, str, str]]: ...
|
||||
def _get_stack_trace(
|
||||
frame: FrameType, limit_frame: FrameType | None = ...
|
||||
) -> list[tuple[str, int, str, str]]: ...
|
||||
def stack_size() -> int: ...
|
||||
def make_session(name: str = ...) -> str: ...
|
||||
def force_hook() -> None: ...
|
||||
@@ -32,7 +34,9 @@ class Collector:
|
||||
def start(self) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
def add(self, entry: dict | None = ..., frame: FrameType | None = ...) -> None: ...
|
||||
def _get_stack_trace(self, frame: FrameType | None = ...) -> list[tuple[str, int, str, str]]: ...
|
||||
def _get_stack_trace(
|
||||
self, frame: FrameType | None = ...
|
||||
) -> list[tuple[str, int, str, str]]: ...
|
||||
def post_process(self) -> None: ...
|
||||
@property
|
||||
def entries(self) -> list[dict]: ...
|
||||
@@ -110,9 +114,15 @@ class Profiler:
|
||||
profile_id: Any
|
||||
db: str | None
|
||||
collectors: list[Collector]
|
||||
def __init__(self, collectors: list[str | Collector] | None = ..., db: str | None = ...,
|
||||
profile_session: Any | None = ..., description: str | None = ..., disable_gc: bool = ...,
|
||||
params: Any | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
collectors: list[str | Collector] | None = ...,
|
||||
db: str | None = ...,
|
||||
profile_session: Any | None = ...,
|
||||
description: str | None = ...,
|
||||
disable_gc: bool = ...,
|
||||
params: Any | None = ...,
|
||||
) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __exit__(self, *args) -> None: ...
|
||||
def _add_file_lines(self, stack: list[tuple[str, int, str, str]]) -> None: ...
|
||||
@@ -123,6 +133,8 @@ class Profiler:
|
||||
class Nested(Generic[_T]):
|
||||
profiler: Profiler
|
||||
context_manager: ContextManager[_T]
|
||||
def __init__(self, profiler: Profiler, context_manager: ContextManager[_T]) -> None: ...
|
||||
def __init__(
|
||||
self, profiler: Profiler, context_manager: ContextManager[_T]
|
||||
) -> None: ...
|
||||
def __enter__(self) -> _T: ...
|
||||
def __exit__(self, exc_type, exc_value, traceback): ...
|
||||
|
||||
@@ -11,4 +11,6 @@ template_env_globals: dict[str, Any]
|
||||
|
||||
def parse_inline_template(text: str) -> list[tuple[str, str]]: ...
|
||||
def convert_inline_template_to_qweb(template: str) -> Markup: ...
|
||||
def render_inline_template(template_instructions: Iterable[tuple[str, str]], variables: dict) -> str: ...
|
||||
def render_inline_template(
|
||||
template_instructions: Iterable[tuple[str, str]], variables: dict
|
||||
) -> str: ...
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
from opcode import HAVE_ARGUMENT as HAVE_ARGUMENT
|
||||
from types import CodeType
|
||||
from typing import Any, Iterable, Iterator, Literal
|
||||
|
||||
from opcode import HAVE_ARGUMENT as HAVE_ARGUMENT
|
||||
|
||||
unsafe_eval = eval
|
||||
_ALLOWED_MODULES: list[str]
|
||||
_UNSAFE_ATTRIBUTES: list[str]
|
||||
|
||||
def to_opcodes(opnames: Iterable[str], _opmap: dict[str, int] =...) -> Iterator[int]: ...
|
||||
def to_opcodes(
|
||||
opnames: Iterable[str], _opmap: dict[str, int] = ...
|
||||
) -> Iterator[int]: ...
|
||||
|
||||
_BLACKLIST: set[int]
|
||||
_CONST_OPCODES: set[int]
|
||||
@@ -15,16 +18,30 @@ _EXPR_OPCODES: set[int]
|
||||
_SAFE_OPCODES: set[int]
|
||||
|
||||
def assert_no_dunder_name(code_obj: CodeType, expr: str) -> None: ...
|
||||
def assert_valid_codeobj(allowed_codes: set[int], code_obj: CodeType, expr: str) -> None: ...
|
||||
def assert_valid_codeobj(
|
||||
allowed_codes: set[int], code_obj: CodeType, expr: str
|
||||
) -> None: ...
|
||||
def test_expr(expr: str, allowed_codes: set[int], mode: str = ...): ...
|
||||
def const_eval(expr: str): ...
|
||||
def expr_eval(expr: str): ...
|
||||
def _import(name: str, globals: dict | None = ..., locals: dict | None = ..., fromlist: list | None = ..., level: int = ...): ...
|
||||
def _import(
|
||||
name: str,
|
||||
globals: dict | None = ...,
|
||||
locals: dict | None = ...,
|
||||
fromlist: list | None = ...,
|
||||
level: int = ...,
|
||||
): ...
|
||||
|
||||
_BUILTINS: dict[str, Any]
|
||||
|
||||
def safe_eval(expr: str, globals_dict: dict | None = ..., locals_dict: dict | None = ..., mode: str = ...,
|
||||
nocopy: bool = ..., locals_builtins: bool = ...): ...
|
||||
def safe_eval(
|
||||
expr: str,
|
||||
globals_dict: dict | None = ...,
|
||||
locals_dict: dict | None = ...,
|
||||
mode: str = ...,
|
||||
nocopy: bool = ...,
|
||||
locals_builtins: bool = ...,
|
||||
): ...
|
||||
def test_python_expr(expr: str, mode: str = ...) -> str | Literal[False]: ...
|
||||
def check_values(d: dict): ...
|
||||
|
||||
|
||||
@@ -12,7 +12,13 @@ class SourceMapGenerator:
|
||||
def _serialize_mappings(self) -> str: ...
|
||||
def to_json(self) -> dict: ...
|
||||
def get_content(self) -> bytes: ...
|
||||
def add_source(self, source_name: str, source_content: str, last_index: int, start_offset: int = ...) -> None: ...
|
||||
def add_source(
|
||||
self,
|
||||
source_name: str,
|
||||
source_content: str,
|
||||
last_index: int,
|
||||
start_offset: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
B64CHARS: bytes
|
||||
SHIFTSIZE: int
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from reprlib import Repr
|
||||
from typing import Any, Callable, Iterable, Sequence, TypeVar
|
||||
|
||||
_SpeedscopeT = TypeVar('_SpeedscopeT', bound=Speedscope)
|
||||
_SpeedscopeT = TypeVar("_SpeedscopeT", bound=Speedscope)
|
||||
|
||||
shortener: Repr
|
||||
shorten: Callable[[Any], str]
|
||||
@@ -16,14 +16,30 @@ class Speedscope:
|
||||
frames_indexes: dict[Any, int]
|
||||
frame_count: int
|
||||
profiles: list
|
||||
def __init__(self, name: str = ..., init_stack_trace: list | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self, name: str = ..., init_stack_trace: list | None = ...
|
||||
) -> None: ...
|
||||
def add(self, key, profile) -> None: ...
|
||||
def convert_stack(self, stack: list[Sequence]) -> None: ...
|
||||
def add_output(self: _SpeedscopeT, names: Iterable[str], complete: bool = ..., display_name: str | None = ...,
|
||||
use_context: bool = ..., **params) -> _SpeedscopeT: ...
|
||||
def add_output(
|
||||
self: _SpeedscopeT,
|
||||
names: Iterable[str],
|
||||
complete: bool = ...,
|
||||
display_name: str | None = ...,
|
||||
use_context: bool = ...,
|
||||
**params
|
||||
) -> _SpeedscopeT: ...
|
||||
def add_default(self: _SpeedscopeT) -> _SpeedscopeT: ...
|
||||
def make(self) -> dict: ...
|
||||
def get_frame_id(self, frame) -> int: ...
|
||||
def stack_to_ids(self, stack: list, context: Iterable[tuple[int, dict]], stack_offset: int = ...) -> list[int]: ...
|
||||
def process(self, entries: list[dict], continuous: bool = ..., hide_gaps: bool = ..., use_context: bool = ...,
|
||||
constant_time: bool = ...) -> list[dict]: ...
|
||||
def stack_to_ids(
|
||||
self, stack: list, context: Iterable[tuple[int, dict]], stack_offset: int = ...
|
||||
) -> list[int]: ...
|
||||
def process(
|
||||
self,
|
||||
entries: list[dict],
|
||||
continuous: bool = ...,
|
||||
hide_gaps: bool = ...,
|
||||
use_context: bool = ...,
|
||||
constant_time: bool = ...,
|
||||
) -> list[dict]: ...
|
||||
|
||||
@@ -8,23 +8,64 @@ _CONFDELTYPES: dict[str, str]
|
||||
def existing_tables(cr: Cursor, tablenames: Iterable[str]) -> list[str]: ...
|
||||
def table_exists(cr: Cursor, tablename: str) -> bool: ...
|
||||
def table_kind(cr: Cursor, tablename: str) -> str | None: ...
|
||||
def create_model_table(cr: Cursor, tablename: str, comment: str | None = ..., columns: Iterable = ...) -> None: ...
|
||||
def create_model_table(
|
||||
cr: Cursor, tablename: str, comment: str | None = ..., columns: Iterable = ...
|
||||
) -> None: ...
|
||||
def table_columns(cr: Cursor, tablename: str) -> dict: ...
|
||||
def column_exists(cr: Cursor, tablename: str, columnname: str) -> int: ...
|
||||
def create_column(cr: Cursor, tablename: str, columnname: str, columntype: str, comment: str | None = ...) -> None: ...
|
||||
def rename_column(cr: Cursor, tablename: str, columnname1: str, columnname2: str) -> None: ...
|
||||
def convert_column(cr: Cursor, tablename: str, columnname: str, columntype: str) -> None: ...
|
||||
def create_column(
|
||||
cr: Cursor,
|
||||
tablename: str,
|
||||
columnname: str,
|
||||
columntype: str,
|
||||
comment: str | None = ...,
|
||||
) -> None: ...
|
||||
def rename_column(
|
||||
cr: Cursor, tablename: str, columnname1: str, columnname2: str
|
||||
) -> None: ...
|
||||
def convert_column(
|
||||
cr: Cursor, tablename: str, columnname: str, columntype: str
|
||||
) -> None: ...
|
||||
def set_not_null(cr: Cursor, tablename: str, columnname: str) -> None: ...
|
||||
def drop_not_null(cr: Cursor, tablename: str, columnname: str) -> None: ...
|
||||
def constraint_definition(cr: Cursor, tablename: str, constraintname: str) -> str | None: ...
|
||||
def add_constraint(cr: Cursor, tablename: str, constraintname: str, definition: str) -> None: ...
|
||||
def constraint_definition(
|
||||
cr: Cursor, tablename: str, constraintname: str
|
||||
) -> str | None: ...
|
||||
def add_constraint(
|
||||
cr: Cursor, tablename: str, constraintname: str, definition: str
|
||||
) -> None: ...
|
||||
def drop_constraint(cr: Cursor, tablename: str, constraintname: str) -> None: ...
|
||||
def add_foreign_key(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> Literal[True]: ...
|
||||
def get_foreign_keys(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> list[str]: ...
|
||||
def fix_foreign_key(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> list[str]: ...
|
||||
def add_foreign_key(
|
||||
cr: Cursor,
|
||||
tablename1: str,
|
||||
columnname1: str,
|
||||
tablename2: str,
|
||||
columnname2: str,
|
||||
ondelete,
|
||||
) -> Literal[True]: ...
|
||||
def get_foreign_keys(
|
||||
cr: Cursor,
|
||||
tablename1: str,
|
||||
columnname1: str,
|
||||
tablename2: str,
|
||||
columnname2: str,
|
||||
ondelete,
|
||||
) -> list[str]: ...
|
||||
def fix_foreign_key(
|
||||
cr: Cursor,
|
||||
tablename1: str,
|
||||
columnname1: str,
|
||||
tablename2: str,
|
||||
columnname2: str,
|
||||
ondelete,
|
||||
) -> list[str]: ...
|
||||
def index_exists(cr: Cursor, indexname: str) -> int: ...
|
||||
def create_index(cr: Cursor, indexname: str, tablename: str, expressions: Iterable[str]) -> None: ...
|
||||
def create_unique_index(cr: Cursor, indexname: str, tablename: str, expressions: Iterable[str]) -> None: ...
|
||||
def create_index(
|
||||
cr: Cursor, indexname: str, tablename: str, expressions: Iterable[str]
|
||||
) -> None: ...
|
||||
def create_unique_index(
|
||||
cr: Cursor, indexname: str, tablename: str, expressions: Iterable[str]
|
||||
) -> None: ...
|
||||
def drop_index(cr: Cursor, indexname: str, tablename: str) -> None: ...
|
||||
def drop_view_if_exists(cr: Cursor, viewname: str) -> None: ...
|
||||
def escape_psql(to_escape: str) -> str: ...
|
||||
|
||||
@@ -6,5 +6,9 @@ def add_text_before(node: _Element, text: str | None) -> None: ...
|
||||
def add_text_inside(node: _Element, text: str | None) -> None: ...
|
||||
def remove_element(node: _Element) -> None: ...
|
||||
def locate_node(arch: _Element, spec: _Element) -> _Element: ...
|
||||
def apply_inheritance_specs(source: _Element, specs_tree: _Element, inherit_branding: bool = ...,
|
||||
pre_locate: Callable[[_Element], Any] = ...) -> _Element: ...
|
||||
def apply_inheritance_specs(
|
||||
source: _Element,
|
||||
specs_tree: _Element,
|
||||
inherit_branding: bool = ...,
|
||||
pre_locate: Callable[[_Element], Any] = ...,
|
||||
) -> _Element: ...
|
||||
|
||||
@@ -1,10 +1,26 @@
|
||||
from typing import Any, Literal
|
||||
|
||||
from . import config as config
|
||||
from ..sql_db import Cursor
|
||||
from . import config as config
|
||||
|
||||
def try_report(cr: Cursor, uid: int, rname: str, ids, data: Any | None = ..., context: dict | None = ...,
|
||||
our_module: Any | None = ..., report_type: Any | None = ...) -> bool: ...
|
||||
def try_report_action(cr: Cursor, uid: int, action_id: int, active_model: str | None = ..., active_ids: list[int] | None = ...,
|
||||
wiz_data: dict | None = ..., wiz_buttons: list[str] | None = ..., context: dict | None = ...,
|
||||
our_module: str | None = ...) -> Literal[True]: ...
|
||||
def try_report(
|
||||
cr: Cursor,
|
||||
uid: int,
|
||||
rname: str,
|
||||
ids,
|
||||
data: Any | None = ...,
|
||||
context: dict | None = ...,
|
||||
our_module: Any | None = ...,
|
||||
report_type: Any | None = ...,
|
||||
) -> bool: ...
|
||||
def try_report_action(
|
||||
cr: Cursor,
|
||||
uid: int,
|
||||
action_id: int,
|
||||
active_model: str | None = ...,
|
||||
active_ids: list[int] | None = ...,
|
||||
wiz_data: dict | None = ...,
|
||||
wiz_buttons: list[str] | None = ...,
|
||||
context: dict | None = ...,
|
||||
our_module: str | None = ...,
|
||||
) -> Literal[True]: ...
|
||||
|
||||
@@ -3,15 +3,15 @@ from collections import namedtuple
|
||||
from re import Match, Pattern
|
||||
from tarfile import TarFile
|
||||
from types import FrameType
|
||||
from typing import Any, BinaryIO, Callable, Container, IO, Iterable, Iterator, NoReturn
|
||||
from typing import IO, Any, BinaryIO, Callable, Container, Iterable, Iterator, NoReturn
|
||||
|
||||
from lxml.etree import HTMLParser, _Element
|
||||
from polib import POFile
|
||||
|
||||
from .pycompat import _CsvWriter
|
||||
from ..api import Environment
|
||||
from ..models import BaseModel
|
||||
from ..sql_db import Connection, Cursor
|
||||
from .pycompat import _CsvWriter
|
||||
|
||||
WEB_TRANSLATION_COMMENT: str
|
||||
SKIPPED_ELEMENTS: tuple[str, ...]
|
||||
@@ -31,8 +31,12 @@ def translate_attrib_value(node: _Element) -> bool: ...
|
||||
avoid_pattern: Pattern
|
||||
node_pattern: Pattern
|
||||
|
||||
def translate_xml_node(node: _Element, callback: Callable[[str], str | None], parse: Callable[[str], _Element],
|
||||
serialize: Callable[[_Element], str]) -> _Element: ...
|
||||
def translate_xml_node(
|
||||
node: _Element,
|
||||
callback: Callable[[str], str | None],
|
||||
parse: Callable[[str], _Element],
|
||||
serialize: Callable[[_Element], str],
|
||||
) -> _Element: ...
|
||||
def parse_xml(text: str) -> _Element: ...
|
||||
def serialize_xml(node: _Element) -> str: ...
|
||||
|
||||
@@ -42,19 +46,23 @@ def parse_html(text: str) -> _Element: ...
|
||||
def serialize_html(node: _Element) -> str: ...
|
||||
def xml_translate(callback: Callable[[str], str | None], value: str) -> str: ...
|
||||
def html_translate(callback: Callable[[str], str | None], value: str) -> str: ...
|
||||
def translate(cr: Cursor, name: str, source_type: str, lang: str, source: str | None = ...) -> str: ...
|
||||
def translate(
|
||||
cr: Cursor, name: str, source_type: str, lang: str, source: str | None = ...
|
||||
) -> str: ...
|
||||
def translate_sql_constraint(cr: Cursor, key: str, lang: str) -> str: ...
|
||||
|
||||
class GettextAlias:
|
||||
def _get_db(self) -> Connection | None: ...
|
||||
def _get_cr(self, frame: FrameType, allow_create: bool = ...) -> tuple[Cursor, bool]: ...
|
||||
def _get_cr(
|
||||
self, frame: FrameType, allow_create: bool = ...
|
||||
) -> tuple[Cursor, bool]: ...
|
||||
def _get_uid(self, frame: FrameType) -> int: ...
|
||||
def _get_lang(self, frame: FrameType) -> str: ...
|
||||
def __call__(self, source: str, *args, **kwargs) -> str: ...
|
||||
def _get_translation(self, source: str) -> str: ...
|
||||
|
||||
class _lt:
|
||||
__slots__ = ['_source', '_args']
|
||||
__slots__ = ["_source", "_args"]
|
||||
_source: str
|
||||
_args: tuple
|
||||
def __init__(self, source: str, *args, **kwargs) -> None: ...
|
||||
@@ -73,7 +81,9 @@ re_escaped_replacements: dict[str, str]
|
||||
|
||||
def _sub_replacement(match_obj: Match) -> str: ...
|
||||
def unquote(str: str) -> str: ...
|
||||
def TranslationFileReader(source: IO, fileformat: str = ...) -> CSVFileReader | PoFileReader: ...
|
||||
def TranslationFileReader(
|
||||
source: IO, fileformat: str = ...
|
||||
) -> CSVFileReader | PoFileReader: ...
|
||||
|
||||
class CSVFileReader:
|
||||
source: csv.DictReader
|
||||
@@ -86,7 +96,9 @@ class PoFileReader:
|
||||
def __init__(self, source: str | IO): ...
|
||||
def __iter__(self) -> Iterator[dict[str, Any]]: ...
|
||||
|
||||
def TranslationFileWriter(target, fileformat: str = ..., lang: str | None = ...) -> CSVFileWriter | PoFileWriter | TarFileWriter: ...
|
||||
def TranslationFileWriter(
|
||||
target, fileformat: str = ..., lang: str | None = ...
|
||||
) -> CSVFileWriter | PoFileWriter | TarFileWriter: ...
|
||||
|
||||
class CSVFileWriter:
|
||||
writer: _CsvWriter
|
||||
@@ -99,7 +111,9 @@ class PoFileWriter:
|
||||
po: POFile
|
||||
def __init__(self, target: IO, lang: str) -> None: ...
|
||||
def write_rows(self, rows: Iterable) -> None: ...
|
||||
def add_entry(self, modules, tnrs, source, trad, comments: Iterable[str] | None = ...) -> None: ...
|
||||
def add_entry(
|
||||
self, modules, tnrs, source, trad, comments: Iterable[str] | None = ...
|
||||
) -> None: ...
|
||||
|
||||
class TarFileWriter:
|
||||
tar: TarFile
|
||||
@@ -107,14 +121,18 @@ class TarFileWriter:
|
||||
def __init__(self, target: IO, lang: str) -> None: ...
|
||||
def write_rows(self, rows: Iterable) -> None: ...
|
||||
|
||||
def trans_export(lang: str, modules: list[str], buffer, format: str, cr: Cursor) -> None: ...
|
||||
def trans_export(
|
||||
lang: str, modules: list[str], buffer, format: str, cr: Cursor
|
||||
) -> None: ...
|
||||
def trans_parse_rml(de: Iterable) -> list[bytes]: ...
|
||||
def _push(callback: Callable[[str, int], Any], term: str, source_line: int) -> None: ...
|
||||
def in_modules(object_name: str, modules: Container[str]) -> bool: ...
|
||||
def _extract_translatable_qweb_terms(element: _Element, callback: Callable[[str, int], Any]) -> None: ...
|
||||
def _extract_translatable_qweb_terms(
|
||||
element: _Element, callback: Callable[[str, int], Any]
|
||||
) -> None: ...
|
||||
def babel_extract_qweb(fileobj: IO, keywords, comment_tags, options) -> list[tuple]: ...
|
||||
|
||||
ImdInfo = namedtuple('ExternalId', ['name', 'model', 'res_id', 'module'])
|
||||
ImdInfo = namedtuple("ExternalId", ["name", "model", "res_id", "module"])
|
||||
|
||||
class TranslationModuleReader:
|
||||
_cr: Cursor
|
||||
@@ -124,22 +142,57 @@ class TranslationModuleReader:
|
||||
_to_translate: list[tuple]
|
||||
_path_list: list[tuple[str, Any]]
|
||||
_installed_modules: list[str]
|
||||
def __init__(self, cr: Cursor, modules: list[str] | None = ..., lang: str | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self, cr: Cursor, modules: list[str] | None = ..., lang: str | None = ...
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterable[tuple]: ...
|
||||
def _push_translation(self, module: str, ttype: str, name: str, res_id: str, source: str,
|
||||
comments: Iterable[str] | None = ..., record_id: int | None = ...) -> None: ...
|
||||
def _get_translatable_records(self, imd_records: Iterable[ImdInfo]) -> BaseModel: ...
|
||||
def _push_translation(
|
||||
self,
|
||||
module: str,
|
||||
ttype: str,
|
||||
name: str,
|
||||
res_id: str,
|
||||
source: str,
|
||||
comments: Iterable[str] | None = ...,
|
||||
record_id: int | None = ...,
|
||||
) -> None: ...
|
||||
def _get_translatable_records(
|
||||
self, imd_records: Iterable[ImdInfo]
|
||||
) -> BaseModel: ...
|
||||
def _export_translatable_records(self) -> None: ...
|
||||
def _get_module_from_path(self, path: str) -> str: ...
|
||||
def _verified_module_filepaths(self, fname: str, path: str, root: str) -> tuple[str | None, str | None, str | None, str | None]: ...
|
||||
def _babel_extract_terms(self, fname: str, path: str, root: str, extract_method: str = ..., trans_type: str = ...,
|
||||
extra_comments: list[str] | None = ..., extract_keywords: dict = ...) -> None: ...
|
||||
def _verified_module_filepaths(
|
||||
self, fname: str, path: str, root: str
|
||||
) -> tuple[str | None, str | None, str | None, str | None]: ...
|
||||
def _babel_extract_terms(
|
||||
self,
|
||||
fname: str,
|
||||
path: str,
|
||||
root: str,
|
||||
extract_method: str = ...,
|
||||
trans_type: str = ...,
|
||||
extra_comments: list[str] | None = ...,
|
||||
extract_keywords: dict = ...,
|
||||
) -> None: ...
|
||||
def _export_translatable_resources(self) -> None: ...
|
||||
|
||||
def trans_load(cr: Cursor, filename: str, lang: str, verbose: bool = ..., create_empty_translation: bool = ...,
|
||||
overwrite: bool = ...) -> None: ...
|
||||
def trans_load_data(cr: Cursor, fileobj: IO, fileformat: str, lang: str, verbose: bool = ...,
|
||||
create_empty_translation: bool = ..., overwrite: bool = ...) -> None: ...
|
||||
def trans_load(
|
||||
cr: Cursor,
|
||||
filename: str,
|
||||
lang: str,
|
||||
verbose: bool = ...,
|
||||
create_empty_translation: bool = ...,
|
||||
overwrite: bool = ...,
|
||||
) -> None: ...
|
||||
def trans_load_data(
|
||||
cr: Cursor,
|
||||
fileobj: IO,
|
||||
fileformat: str,
|
||||
lang: str,
|
||||
verbose: bool = ...,
|
||||
create_empty_translation: bool = ...,
|
||||
overwrite: bool = ...,
|
||||
) -> None: ...
|
||||
def get_locales(lang: str | None = ...) -> None: ...
|
||||
def resetlocale() -> str: ...
|
||||
def load_language(cr: Cursor, lang: str) -> None: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Callable, TypeVar
|
||||
|
||||
from lxml.etree import RelaxNG, _Element
|
||||
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
|
||||
_validators: defaultdict[str, list[Callable]]
|
||||
_relaxng_cache: dict[str, RelaxNG | None]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from os import R_OK as R_OK, W_OK as W_OK
|
||||
from os import R_OK as R_OK
|
||||
from os import W_OK as W_OK
|
||||
from os.path import dirname as dirname
|
||||
from typing import Iterator
|
||||
|
||||
@@ -8,5 +9,9 @@ windows: bool
|
||||
seen: set
|
||||
defpathext: list[str]
|
||||
|
||||
def which_files(file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...) -> Iterator[str]: ...
|
||||
def which(file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...) -> str: ...
|
||||
def which_files(
|
||||
file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...
|
||||
) -> Iterator[str]: ...
|
||||
def which(
|
||||
file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...
|
||||
) -> str: ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import IO, Iterable
|
||||
|
||||
from lxml import etree
|
||||
from lxml.etree import _Element
|
||||
from typing import IO, Iterable
|
||||
|
||||
from ..api import Environment
|
||||
|
||||
@@ -9,8 +10,21 @@ class odoo_resolver(etree.Resolver):
|
||||
def __init__(self, env: Environment) -> None: ...
|
||||
def resolve(self, url: str, id: str, context) -> str: ...
|
||||
|
||||
def _check_with_xsd(tree_or_str: str | _Element, stream: str | IO, env: Environment | None = ...) -> None: ...
|
||||
def create_xml_node_chain(first_parent_node: _Element, nodes_list: Iterable[str], last_node_value: str | None = ...) -> list[_Element]: ...
|
||||
def create_xml_node(parent_node: _Element, node_name: str, node_value: str | None = ...) -> _Element: ...
|
||||
def cleanup_xml_node(xml_node_or_string: _Element | str, remove_blank_text: bool = ..., remove_blank_nodes: bool = ...,
|
||||
indent_level: int = ..., indent_space: str = ...) -> _Element: ...
|
||||
def _check_with_xsd(
|
||||
tree_or_str: str | _Element, stream: str | IO, env: Environment | None = ...
|
||||
) -> None: ...
|
||||
def create_xml_node_chain(
|
||||
first_parent_node: _Element,
|
||||
nodes_list: Iterable[str],
|
||||
last_node_value: str | None = ...,
|
||||
) -> list[_Element]: ...
|
||||
def create_xml_node(
|
||||
parent_node: _Element, node_name: str, node_value: str | None = ...
|
||||
) -> _Element: ...
|
||||
def cleanup_xml_node(
|
||||
xml_node_or_string: _Element | str,
|
||||
remove_blank_text: bool = ...,
|
||||
remove_blank_nodes: bool = ...,
|
||||
indent_level: int = ...,
|
||||
indent_space: str = ...,
|
||||
) -> _Element: ...
|
||||
|
||||
Reference in New Issue
Block a user