Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-17 11:04:45 +07:00
parent 20ceb8553b
commit ebfdd704fe
81 changed files with 3027 additions and 2259 deletions

View File

@@ -1,17 +1,34 @@
from . import addons as addons, api as api, cli as cli, 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, upgrade as upgrade from psycopg2 import connection
from . import (
addons as addons,
api as api,
cli as cli,
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,
upgrade as upgrade
)
from .api import Registry
from .fields import Command as Command from .fields import Command as Command
from .tools.translate import _ as _, _lt as _lt from .tools.translate import _ as _, _lt as _lt
from typing import Any
__path__: Any
evented: bool evented: bool
def gevent_wait_callback(conn, timeout: Any | None = ...) -> None: ... def gevent_wait_callback(conn: connection, timeout: float | None = ...) -> None: ...
multi_process: bool multi_process: bool
def _decompress(data): ... def _decompress(data: bytes) -> bytes: ...
SUPERUSER_ID: int SUPERUSER_ID: int
def registry(database_name: Any | None = ...): ... def registry(database_name: str | None = ...) -> Registry: ...

View File

@@ -1,133 +1,150 @@
from collections import defaultdict from collections import defaultdict
from collections.abc import Mapping from typing import Any, Callable, Collection, Generator, Iterable, Iterator, KeysView, Literal, Mapping, Optional, \
from typing import Any TypeVar, Union
from weakref import WeakSet from weakref import WeakSet
from .fields import Field
from .models import BaseModel
from .modules.registry import Registry from .modules.registry import Registry
from .sql_db import Cursor from .sql_db import Cursor
from .tools import StackMap from .tools import OrderedSet, frozendict, StackMap
__all__: Any _T = TypeVar('_T')
_logger: Any _ModelT = TypeVar('_ModelT', bound=BaseModel)
INHERITED_ATTRS: Any _CallableT = TypeVar('_CallableT', bound=Callable)
INHERITED_ATTRS: tuple[str, ...]
class Params: class Params:
args: Any args: tuple
kwargs: Any kwargs: dict
def __init__(self, args, kwargs) -> None: ... def __init__(self, args: tuple, kwargs: dict) -> None: ...
def __str__(self): ... def __str__(self) -> str: ...
class Meta(type): class Meta(type):
def __new__(meta, name, bases, attrs): ... def __new__(meta, name: str, bases: tuple, attrs: dict): ...
def attrsetter(attr, value): ... def attrsetter(attr, value) -> Callable[[_T], _T]: ...
def propagate(method1, method2): ... def propagate(method1: Callable, method2: _CallableT) -> _CallableT: ...
def constrains(*args): ... def constrains(*args: str) -> Callable[[_T], _T]: ...
def ondelete(at_uninstall): ... def ondelete(*, at_uninstall: bool) -> Callable[[_T], _T]: ...
def onchange(*args): ... def onchange(*args: str) -> Callable[[_T], _T]: ...
def depends(*args): ... def depends(*args: Union[str, Callable]) -> Callable[[_T], _T]: ...
def depends_context(*args): ... def depends_context(*args: str) -> Callable[[_T], _T]: ...
def returns(model, downgrade: Any | None = ..., upgrade: Any | None = ...): ... def returns(model: str | None, downgrade: Callable | None = ..., upgrade: Callable | None = ...) -> Callable[[_T], _T]: ...
def downgrade(method, value, self, args, kwargs): ... def downgrade(method: Callable, value, self, args, kwargs): ...
def split_context(method, args, kwargs): ... def split_context(method: Callable, args, kwargs) -> tuple: ...
def autovacuum(method): ... def autovacuum(method: _CallableT) -> _CallableT: ...
def model(method): ... def model(method: _CallableT) -> _CallableT: ...
_create_logger: Any 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(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_multi(method: Callable[..., _ModelT], self: _ModelT, args, kwargs): ...
def call_kw(model: BaseModel, name: str, args, kwargs): ...
def _model_create_single(create, self, arg): ... class Environment(Mapping[str, BaseModel]):
def model_create_single(method): ...
def _model_create_multi(create, self, arg): ...
def model_create_multi(method): ...
def _call_kw_model(method, self, args, kwargs): ...
def _call_kw_model_create(method, self, args, kwargs): ...
def _call_kw_multi(method, self, args, kwargs): ...
def call_kw(model, name, args, kwargs): ...
class Environment(Mapping):
_local: Any = ...
cr: Cursor = ... cr: Cursor = ...
uid: int = ... uid: int = ...
context: dict = ... context: dict[str, Any] = ...
su: bool = ... su: bool = ...
envs: Any envs: None
args: tuple[Cursor, int, dict, bool]
@classmethod @classmethod
def manage(cls) -> None: ... def manage(cls) -> Generator[None, None, None]: ...
def reset(self) -> None: ... def reset(self) -> None: ...
all: Transaction all: Transaction
transaction: Transaction transaction: Transaction
registry: Registry registry: Registry
cache: Cache cache: Cache
_cache_key: Any _cache_key: dict[Field, Any]
_protected: Any _protected: StackMap[Field, set[int]]
def __new__(cls, cr: Cursor, uid, context, su: bool = ...) -> Environment: ... def __new__(cls, cr: Cursor, uid: int, context: dict, su: bool = ...) -> Environment: ...
def __contains__(self, model_name): ... def __contains__(self, model_name: str) -> bool: ...
def __getitem__(self, model_name): ... def __getitem__(self, model_name: str) -> BaseModel: ...
def __iter__(self): ... def __iter__(self) -> Iterator[str]: ...
def __len__(self) -> int: ... def __len__(self) -> int: ...
def __eq__(self, other) -> bool: ... def __eq__(self, other) -> bool: ...
def __ne__(self, other) -> bool: ... def __ne__(self, other) -> bool: ...
def __hash__(self) -> int: ... def __hash__(self) -> int: ...
def __call__(self, cr: Cursor | None = ..., user: Any | None = ..., context: Any | None = ..., su: Any | None = ...) -> Environment: ... 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, raise_if_not_found: bool = ...): ... def ref(self, xml_id: str, raise_if_not_found: bool = ...) -> Optional[BaseModel]: ...
def is_superuser(self) -> bool: ... def is_superuser(self) -> bool: ...
def is_admin(self) -> bool: ... def is_admin(self) -> bool: ...
def is_system(self) -> bool: ... def is_system(self) -> bool: ...
@property @property
def user(self): def user(self) -> 'odoo.model.res_users': ...
return self['res.users']
@property @property
def company(self): def company(self) -> 'odoo.model.res_company': ...
return self['res.company']
@property @property
def companies(self): def companies(self) -> 'odoo.model.res_company': ...
return self['res.company']
@property @property
def lang(self) -> str: ... def lang(self) -> str: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def clear_upon_failure(self): ... def clear_upon_failure(self): ...
def is_protected(self, field, record): ... def invalidate_all(self, flush: bool = ...) -> None: ...
def protected(self, field): ... def _recompute_all(self) -> None: ...
def protecting(self, what, records: Any | None = ...) -> None: ... def flush_all(self) -> None: ...
def fields_to_compute(self): ... def is_protected(self, field: Field, record: BaseModel) -> bool: ...
def records_to_compute(self, field): ... def protected(self, field: Field) -> BaseModel: ...
def is_to_compute(self, field, record): ... def protecting(self, what, records: Optional[BaseModel] = ...) -> Generator[None, None, None]: ...
def not_to_compute(self, field, records): ... def fields_to_compute(self) -> KeysView[Field]: ...
def add_to_compute(self, field, records): ... def records_to_compute(self, field: Field) -> BaseModel: ...
def remove_to_compute(self, field, records) -> None: ... def is_to_compute(self, field: Field, record: BaseModel) -> bool: ...
def norecompute(self) -> None: ... def not_to_compute(self, field: Field, records: _ModelT) -> _ModelT: ...
def cache_key(self, field): ... def add_to_compute(self, field: Field, records: BaseModel): ...
def remove_to_compute(self, field: Field, records: BaseModel) -> None: ...
def norecompute(self) -> Generator[None, None, None]: ...
def cache_key(self, field: Field): ...
class Transaction: class Transaction:
registry: Any registry: Registry
envs: WeakSet envs: WeakSet[Environment]
cache: Cache cache: Cache
protected: StackMap protected: StackMap[Field, set[int]]
tocompute: defaultdict tocompute: defaultdict[Field, set[int]]
towrite: defaultdict def __init__(self, registry: Registry) -> None: ...
def __init__(self, registry): ...
def flush(self) -> None: ... def flush(self) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def reset(self) -> None: ... def reset(self) -> None: ...
NOTHING: Any NOTHING: object
EMPTY_DICT: Any EMPTY_DICT: frozendict
class Cache: class Cache:
_data: Any _data: defaultdict[Field, dict]
_dirty: defaultdict[Field, OrderedSet[int]]
def __init__(self) -> None: ... def __init__(self) -> None: ...
def _get_field_cache(self, model, field): ... def __repr__(self) -> str: ...
def _set_field_cache(self, model, field): ... def _get_field_cache(self, model: BaseModel, field: Field) -> dict: ...
def contains(self, record, field): ... def _set_field_cache(self, model: BaseModel, field: Field): ...
def get(self, record, field, default=...): ... def contains(self, record: BaseModel, field: Field) -> bool: ...
def set(self, record, field, value) -> None: ... def contains_field(self, field: Field) -> bool: ...
def update(self, records, field, values) -> None: ... def get(self, record: BaseModel, field: Field, default=...): ...
def remove(self, record, field) -> None: ... def set(self, record: BaseModel, field: Field, value, dirty: bool = ..., check_dirty: bool = ...) -> None: ...
def get_values(self, records, field) -> None: ... def update(self, records: BaseModel, field: Field, values, dirty: bool = ..., check_dirty: bool = ...) -> None: ...
def get_until_miss(self, records, field): ... def update_raw(self, records: BaseModel, field: Field, values, dirty: bool = ..., check_dirty: bool = ...) -> None: ...
def get_records_different_from(self, records, field, value): ... def insert_missing(self, records: BaseModel, field: Field, values) -> None: ...
def get_fields(self, record) -> None: ... def remove(self, record: BaseModel, field: Field) -> None: ...
def get_records(self, model, field): ... def get_values(self, records: BaseModel, field: Field) -> Iterator: ...
def get_missing_ids(self, records, field) -> None: ... def get_until_miss(self, records: BaseModel, field: Field) -> list: ...
def invalidate(self, spec: Any | None = ...) -> None: ... def get_records_different_from(self, records: _ModelT, field: Field, value) -> _ModelT: ...
def check(self, env) -> None: ... 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 get_dirty_fields(self) -> 'set[Field]': ...
def get_dirty_records(self, model: _ModelT, field: Field) -> _ModelT: ...
def has_dirty_fields(self, records: BaseModel, fields: Iterable[Field] | None = ...) -> bool: ...
def clear_dirty_field(self, field: Field) -> Collection[int]: ...
def invalidate(self, spec: list[tuple[Field, Iterable | None]] | None = ...) -> None: ...
def clear(self) -> None: ...
def check(self, env: Environment) -> None: ...
class Starred:
__slots__ = ['value']
value: Any
def __init__(self, value) -> None: ...
def __repr__(self) -> str: ...

View File

@@ -1,2 +1,14 @@
from . import cloc as cloc, deploy as deploy, populate as populate, scaffold as scaffold, server as server, shell as shell, start as start, tsconfig as tsconfig from . import (
cloc as cloc,
db as db,
deploy as deploy,
genproxytoken as genproxytoken,
neutralize as neutralize,
populate as populate,
scaffold as scaffold,
server as server,
shell as shell,
start as start,
tsconfig as tsconfig
)
from .command import Command as Command, main as main from .command import Command as Command, main as main

View File

@@ -1,11 +1,8 @@
from typing import Any commands: dict[str, type[Command]]
commands: Any class Command:
name: str
class CommandType(type): def __init_subclass__(cls) -> None: ...
def __init__(cls, name, bases, attrs) -> None: ...
Command: Any
class Help(Command): class Help(Command):
def run(self, args) -> None: ... def run(self, args) -> None: ...

15
odoo-stubs/cli/db.pyi Normal file
View File

@@ -0,0 +1,15 @@
from typing import Callable
from . import Command
eprint: Callable
class Db(Command):
name: str
def run(self, cmdargs): ...
def load(self, args) -> None: ...
def dump(self, args) -> None: ...
def duplicate(self, args) -> None: ...
def rename(self, args) -> None: ...
def drop(self, args) -> None: ...
def _check_target(self, target, *, delete_if_exists) -> None: ...

View File

@@ -0,0 +1,7 @@
from . import Command
class GenProxyToken(Command):
command_name: str
def __init__(self) -> None: ...
def generate_token(self, length: int = ...): ...
def run(self, cmdargs) -> None: ...

View File

@@ -0,0 +1,4 @@
from . import Command
class Neutralize(Command):
def run(self, args) -> None: ...

View File

@@ -1,11 +1,11 @@
from . import Command from . import Command
from typing import Any from ..api import Environment
from ..models import BaseModel
_logger: Any
class Populate(Command): class Populate(Command):
def run(self, cmdargs) -> None: ... def run(self, cmdargs) -> None: ...
@classmethod @classmethod
def populate(cls, env, size, model_patterns: bool = ...): ... def populate(cls, env: Environment, size, model_patterns: bool = ..., profiling_enabled: bool = ...,
commit: bool = ...) -> dict: ...
@classmethod @classmethod
def _get_ordered_models(cls, env, model_patterns: bool = ...): ... def _get_ordered_models(cls, env: Environment, model_patterns: bool = ...) -> list[BaseModel]: ...

View File

@@ -1,4 +1,2 @@
from typing import Any addons_paths: list[str]
server_wide_modules: list[str]
addons_paths: Any
server_wide_modules: Any

View File

@@ -1,26 +1,27 @@
from typing import Any from typing import Any
_logger: Any from .fields import Field
from .models import BaseModel
class UserError(Exception): class UserError(Exception):
def __init__(self, message) -> None: ... def __init__(self, message: str) -> None: ...
@property @property
def name(self): ... def name(self): ...
class RedirectWarning(Exception): class RedirectWarning(Exception):
def __init__(self, message, action, button_text, additional_context: Any | None = ...) -> None: ... def __init__(self, message: str, action: int, button_text: str, additional_context: dict | None = ...) -> None: ...
@property @property
def name(self): ... def name(self): ...
class AccessDenied(UserError): class AccessDenied(UserError):
__cause__: Any __cause__: Any
traceback: Any traceback: tuple[str, str, str]
def __init__(self, message: str = ...) -> None: ... def __init__(self, message: str = ...) -> None: ...
class AccessError(UserError): ... class AccessError(UserError): ...
class CacheMiss(KeyError): class CacheMiss(KeyError):
def __init__(self, record, field) -> None: ... def __init__(self, record: BaseModel, field: Field) -> None: ...
class MissingError(UserError): ... class MissingError(UserError): ...
class ValidationError(UserError): ... class ValidationError(UserError): ...
@@ -30,6 +31,3 @@ class except_orm(UserError):
class Warning(UserError): class Warning(UserError):
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
class QWebException(Exception):
def __init__(self, *args, **kwargs) -> None: ...

View File

@@ -1,274 +1,296 @@
import datetime import datetime
import enum import enum
from typing import Any from typing import Any, Callable, Container, Collection, Iterator, Sequence, TypeVar, Union
from .tools import date_utils import psycopg2
from markupsafe import Markup
DATE_LENGTH: Any from .api import Environment, Registry
DATETIME_LENGTH: Any from .models import BaseModel
from .tools import date_utils, float_utils
_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])
DATE_LENGTH: int
DATETIME_LENGTH: int
NO_ACCESS: str NO_ACCESS: str
IR_MODELS: Any IR_MODELS: tuple[str, ...]
_logger: Any NoneType: type[None]
_schema: Any Default: object
Default: Any
def first(records): ... def first(records: _ModelT) -> _ModelT: ...
def resolve_mro(model, name, predicate): ... def resolve_mro(model: BaseModel, name: str, predicate: Callable[..., bool]): ...
class MetaField(type): class MetaField(type):
by_type: Any by_type: dict
def __init__(cls, name, bases, attrs) -> None: ... def __init__(cls: type[Field], name, bases, attrs) -> None: ...
_global_seq: Any class Field(metaclass=MetaField):
type: str | None
class Field:
type: Any
relational: bool relational: bool
translate: bool translate: bool
column_type: Any column_type: tuple[str, str] | None
column_format: str
column_cast_from: Any
write_sequence: int write_sequence: int
args: Any args: dict[str, Any] | None
_module: Any _module: str
_modules: Any _modules: tuple[str, ...]
_setup_done: bool _setup_done: bool
_sequence: Any _sequence: int | None
_base_fields: Any _base_fields: tuple[Field, ...]
_extra_keys: Any _extra_keys: tuple[str, ...]
_direct: bool _direct: bool
_toplevel: bool _toplevel: bool
automatic: bool automatic: bool
inherited: bool inherited: bool
inherited_field: Any inherited_field: Field | None
name: Any name: str
model_name: Any model_name: str
comodel_name: Any comodel_name: str | None
store: bool store: bool
index: bool index: bool
manual: bool manual: bool
copy: bool copy: bool
_depends: Any _depends: Collection[str, ...] | None
_depends_context: Any _depends_context: Collection[str, ...] | None
recursive: bool recursive: bool
compute: Any compute: str | Callable | None
compute_sudo: bool compute_sudo: bool
inverse: Any precompute: bool
search: Any inverse: str | Callable | None
related: Any search: str | Callable | None
related: str | None
company_dependent: bool company_dependent: bool
default: Any default: Any
string: Any string: str | None
help: Any help: str | None
invisible: bool invisible: bool
readonly: bool readonly: bool
required: bool required: bool
states: Any states: dict[str, list[tuple]] | None
groups: Any groups: str | None
change_default: bool change_default: bool
deprecated: Any related_field: Field | None
related_field: Any group_operator: str | None
group_operator: Any group_expand: str | None
group_expand: Any
prefetch: bool prefetch: bool
def __init__(self, string=..., **kwargs) -> None: ... default_export_compatible: bool
related_attrs: list[tuple[str, str]]
description_attrs: list[tuple[str, str]]
def __init__(self, string: str = ..., **kwargs) -> None: ...
def new(self, **kwargs): ... def new(self, **kwargs): ...
def __str__(self): ... def __str__(self) -> str: ...
def __repr__(self): ... def __repr__(self) -> str: ...
def __set_name__(self, owner, name) -> None: ... def __set_name__(self, owner: type[BaseModel], name: str) -> None: ...
def _get_attrs(self, model_class, name): ... def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
def _setup_attrs(self, model_class, name): ... def _setup_attrs(self, model_class: type[BaseModel], name: str): ...
def prepare_setup(self) -> None: ... def prepare_setup(self) -> None: ...
def setup(self, model) -> None: ... def setup(self, model: BaseModel) -> None: ...
def setup_nonrelated(self, model) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
def get_depends(self, model): ... def get_depends(self, model: BaseModel) -> tuple: ...
def setup_related(self, model) -> None: ... def setup_related(self, model: BaseModel) -> None: ...
def traverse_related(self, record): ... def traverse_related(self, record: _ModelT) -> tuple[_ModelT, Field]: ...
def _compute_related(self, records) -> None: ... def _compute_related(self, records: BaseModel) -> None: ...
def _process_related(self, value): ... def _process_related(self, value): ...
def _inverse_related(self, records) -> None: ... def _inverse_related(self, records: BaseModel) -> None: ...
def _search_related(self, records, operator, value): ... def _search_related(self, records: BaseModel, operator: str, value) -> list: ...
_related_comodel_name: Any _related_comodel_name: str | None
_related_string: Any _related_string: str | None
_related_help: Any _related_help: str | None
_related_groups: Any _related_groups: str | None
_related_group_operator: Any _related_group_operator: str | None
@property @property
def base_field(self): ... def base_field(self) -> Field: ...
@property @property
def groupable(self): ... def groupable(self) -> bool: ...
def _default_company_dependent(self, model): ... def _default_company_dependent(self, model: BaseModel): ...
def _compute_company_dependent(self, records) -> None: ... def _compute_company_dependent(self, records: BaseModel) -> None: ...
def _inverse_company_dependent(self, records) -> None: ... def _inverse_company_dependent(self, records: BaseModel) -> None: ...
def _search_company_dependent(self, records, operator, value): ... def _search_company_dependent(self, records: BaseModel, operator: str, value): ...
def resolve_depends(self, registry) -> None: ... def resolve_depends(self, registry: Registry) -> Iterator[tuple]: ...
def get_description(self, env): ... def get_description(self, env: Environment, attributes: Container[str] | None = ...) -> dict[str, Any]: ...
_description_store: Any _description_name: str
_description_type: str
_description_store: bool | None
_description_manual: Any _description_manual: Any
_description_related: Any _description_related: str | None
_description_company_dependent: Any _description_company_dependent: bool
_description_readonly: Any _description_readonly: bool
_description_required: Any _description_required: bool
_description_states: Any _description_states: dict[str, list[tuple]] | None
_description_groups: Any _description_groups: str | None
_description_change_default: Any _description_change_default: bool
_description_deprecated: Any _description_group_operator: str | None
_description_group_operator: Any _description_default_export_compatible: bool
def _description_depends(self, env): ... def _description_depends(self, env: Environment): ...
@property @property
def _description_searchable(self): ... def _description_searchable(self) -> bool: ...
@property @property
def _description_sortable(self): ... def _description_sortable(self) -> bool: ...
def _description_string(self, env): ... def _description_string(self, env: Environment) -> str | None: ...
def _description_help(self, env): ... def _description_help(self, env: Environment) -> str | None: ...
def is_editable(self): ... def is_editable(self) -> bool: ...
def null(self, record): ... def null(self, record: BaseModel) -> bool: ...
def convert_to_column(self, value, record, 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, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel): ...
def convert_to_record_multi(self, values, records): ... def convert_to_record_multi(self, values, records: BaseModel): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ... def convert_to_write(self, value, record: BaseModel): ...
def convert_to_onchange(self, value, record, names): ... def convert_to_onchange(self, value, record: BaseModel, names): ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel): ...
def convert_to_display_name(self, value, record): ... def convert_to_display_name(self, value, record: BaseModel): ...
def update_db(self, model, columns): ... @property
def update_db_column(self, model, column) -> None: ... def column_order(self) -> int: ...
def update_db_notnull(self, model, column) -> None: ... def update_db(self, model: BaseModel, columns: dict[str, Any]): ...
def update_db_related(self, model) -> None: ... def update_db_column(self, model: BaseModel, column: dict | None) -> None: ...
def read(self, records) -> None: ... def _convert_db_column(self, model: BaseModel, column: dict | None) -> None: ...
def create(self, record_values) -> None: ... def update_db_notnull(self, model: BaseModel, column: dict | None) -> None: ...
def write(self, records, value): ... def update_db_related(self, model: BaseModel) -> None: ...
# def __get__(self, record, owner): ... def read(self, records: BaseModel) -> None: ...
def mapped(self, records): ... def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def __set__(self, records, value): ... def write(self, records: _ModelT, value) -> _ModelT: ...
def recompute(self, records) -> None: ... def __get__(self, record: Union[BaseModel, None], owner): ...
def compute_value(self, records) -> None: ... def mapped(self, records: BaseModel): ...
def determine_inverse(self, records) -> None: ... def __set__(self, records: BaseModel, value): ...
def determine_domain(self, records, operator, value): ... def recompute(self, records: BaseModel) -> None: ...
def compute_value(self, records: BaseModel) -> None: ...
def determine_inverse(self, records: BaseModel) -> None: ...
def determine_domain(self, records: BaseModel, operator: str, value) -> list: ...
class Boolean(Field): class Boolean(Field):
type: str type: str
column_type: Any column_type: type[str, str]
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> bool: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> bool: ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel): ...
class Integer(Field): class Integer(Field):
type: str type: str
column_type: Any column_type: type[str, str]
group_operator: str group_operator: str
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> int: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> int | None: ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def _update(self, records, value) -> None: ... def _update(self, records: BaseModel, value) -> None: ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record): ...
class Float(Field): class Float(Field):
type: str type: str
column_cast_from: Any _digits: tuple[int, int] | str | None
_digits: Any
group_operator: str group_operator: str
def __init__(self, string=..., digits=..., **kwargs) -> None: ... def __init__(self, string: str = ..., digits: tuple[int, int] | str | None =..., **kwargs) -> None: ...
@property @property
def column_type(self): ... def column_type(self): ...
def get_digits(self, env): ... def get_digits(self, env: Environment) -> tuple[int, int]: ...
_related__digits: Any _related__digits: Any
def _description_digits(self, env): ... def _description_digits(self, env: Environment) -> type[int, int]: ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> float: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> float: ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel): ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel): ...
round: Any round = float_utils.float_round
is_zero: Any is_zero = float_utils.float_is_zero
compare: Any compare = float_utils.float_compare
class Monetary(Field): class Monetary(Field):
type: str type: str
write_sequence: int write_sequence: int
column_type: Any column_type: tuple[str, str]
column_cast_from: Any currency_field: str | None
currency_field: Any
group_operator: str group_operator: str
def __init__(self, string=..., currency_field=..., **kwargs) -> None: ... def __init__(self, string: str = ..., currency_field : str =..., **kwargs) -> None: ...
def _description_currency_field(self, env): ... def _description_currency_field(self, env: Environment) -> str: ...
def get_currency_field(self, model): ... def get_currency_field(self, model: BaseModel) -> str: ...
def setup_nonrelated(self, model) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
def setup_related(self, model) -> None: ... def setup_related(self, model: BaseModel) -> None: ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> float: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> float: ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ... def convert_to_write(self, value, record: BaseModel): ...
class _String(Field): class _String(Field):
translate: bool translate: Callable | bool
prefetch: Any unaccent: bool
def __init__(self, string=..., **kwargs) -> None: ... def __init__(self, string: str = ..., **kwargs) -> None: ...
def _setup_attrs(self, model_class, name) -> None: ... _related_translate: bool
_related_translate: Any def _description_translate(self, env: Environment) -> bool: ...
def _description_translate(self, env): ... def _convert_db_column(self, model: BaseModel, column: dict) -> None: ...
def get_trans_terms(self, value): ... def get_trans_terms(self, value) -> list: ...
def get_trans_func(self, records): ... def get_text_content(self, term): ...
def write(self, records, value): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
def _convert_from_cache_to_column(self, value): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_write(self, value, record: BaseModel): ...
def get_trans_func(self, records: BaseModel) -> Callable: ...
def get_translation_dictionary(self, from_lang_value: str, to_lang_values: dict) -> dict: ...
def _get_stored_translations(self, record: BaseModel) -> dict[str, str]: ...
def write(self, records: _ModelT, value) -> _ModelT: ...
class Char(_String): class Char(_String):
type: str type: str
column_cast_from: Any size: int | None
size: Any
trim: bool trim: bool
def _setup_attrs(self, model_class, name) -> None: ... def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
@property @property
def column_type(self): ... def column_type(self) -> tuple[str, str]: ...
def update_db_column(self, model, column) -> None: ... def update_db_column(self, model: BaseModel, column: dict | None) -> None: ...
_related_size: Any _related_size: int | None
_related_trim: Any _related_trim: bool
_description_size: Any _description_size: int | None
_description_trim: Any _description_trim: bool
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> str | None: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> str | None: ...
class Text(_String): class Text(_String):
type: str type: str
column_type: Any @property
column_cast_from: Any def column_type(self) -> tuple[str, str]: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record, validate: bool = ...) -> str | None: ...
class Html(_String): class Html(_String):
type: str type: str
column_type: Any
column_cast_from: Any
sanitize: bool sanitize: bool
sanitize_overridable: bool
sanitize_tags: bool sanitize_tags: bool
sanitize_attributes: bool sanitize_attributes: bool
sanitize_style: bool sanitize_style: bool
sanitize_form: bool sanitize_form: bool
strip_style: bool strip_style: bool
strip_classes: bool strip_classes: bool
def _get_attrs(self, model_class, name): ... def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
_related_sanitize: Any @property
_related_sanitize_tags: Any def column_type(self) -> tuple[str, str]: ...
_related_sanitize_attributes: Any _related_sanitize: bool
_related_sanitize_style: Any _related_sanitize_tags: bool
_related_strip_style: Any _related_sanitize_attributes: bool
_related_strip_classes: Any _related_sanitize_style: bool
_description_sanitize: Any _related_strip_style: bool
_description_sanitize_tags: Any _related_strip_classes: bool
_description_sanitize_attributes: Any _description_sanitize: bool
_description_sanitize_style: Any _description_sanitize_tags: bool
_description_strip_style: Any _description_sanitize_attributes: bool
_description_strip_classes: Any _description_sanitize_style: bool
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... _description_strip_style: bool
def convert_to_cache(self, value, record, validate: bool = ...): ... _description_strip_classes: bool
def convert_to_record(self, value, record): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> Markup | None: ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> Markup | None: ...
def get_trans_terms(self, value): ... def _convert(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 get_trans_terms(self, value) -> list: ...
class Date(Field): class Date(Field):
type: str type: str
column_type: Any column_type: tuple[str, str]
column_cast_from: Any
start_of = date_utils.start_of start_of = date_utils.start_of
end_of = date_utils.end_of end_of = date_utils.end_of
add = date_utils.add add = date_utils.add
@@ -276,19 +298,18 @@ class Date(Field):
@staticmethod @staticmethod
def today(*args) -> datetime.date: ... def today(*args) -> datetime.date: ...
@staticmethod @staticmethod
def context_today(record, timestamp: Any | None = ...) -> datetime.date: ... def context_today(record: BaseModel, timestamp: datetime.datetime | None = ...) -> datetime.date: ...
@staticmethod @staticmethod
def to_date(value) -> datetime.date: ... def to_date(value) -> datetime.date | None: ...
from_string = to_date from_string = to_date
@staticmethod @staticmethod
def to_string(value): ... def to_string(value: datetime.datetime | datetime.date) -> str: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> datetime.date | None: ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel): ...
class Datetime(Field): class Datetime(Field):
type: str type: str
column_type: Any column_type: tuple[str, str]
column_cast_from: Any
start_of = date_utils.start_of start_of = date_utils.start_of
end_of = date_utils.end_of end_of = date_utils.end_of
add = date_utils.add add = date_utils.add
@@ -298,124 +319,189 @@ class Datetime(Field):
@staticmethod @staticmethod
def today(*args) -> datetime.datetime: ... def today(*args) -> datetime.datetime: ...
@staticmethod @staticmethod
def context_timestamp(record, timestamp) -> datetime.datetime: ... def context_timestamp(record: BaseModel, timestamp: datetime.datetime) -> datetime.datetime: ...
@staticmethod @staticmethod
def to_datetime(value) -> datetime.datetime: ... def to_datetime(value) -> datetime.datetime | None: ...
from_string = to_datetime from_string = to_datetime
@staticmethod @staticmethod
def to_string(value): ... def to_string(value: datetime.datetime | datetime.date) -> str: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> datetime.datetime | None: ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel): ...
def convert_to_display_name(self, value, record): ... def convert_to_display_name(self, value, record: BaseModel) -> str: ...
_BINARY = memoryview _BINARY = memoryview
class Binary(Field): class Binary(Field):
type: str type: str
prefetch: bool prefetch: bool
_depends_context: Any _depends_context: tuple[str]
attachment: bool attachment: bool
@property @property
def column_type(self): ... def column_type(self) -> tuple[str, str] | None: ...
def _get_attrs(self, model_class, name): ... def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
_description_attachment: Any _description_attachment: bool
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> psycopg2.Binary | None: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> bytes | None: ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel) -> bytes: ...
def compute_value(self, records) -> None: ... def compute_value(self, records: BaseModel) -> None: ...
def read(self, records) -> None: ... def read(self, records: BaseModel) -> None: ...
def create(self, record_values) -> None: ... def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records, value): ... def write(self, records: _ModelT, value) -> _ModelT: ...
class Image(Binary): class Image(Binary):
max_width: int max_width: int
max_height: int max_height: int
verify_resolution: bool verify_resolution: bool
def create(self, record_values) -> None: ... def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records, value) -> None: ... def write(self, records: BaseModel, value) -> None: ...
def _image_process(self, value): ... def _image_process(self, value): ...
def _process_related(self, value): ... def _process_related(self, value): ...
class Selection(Field): class Selection(Field):
type: str type: str
column_type: Any column_type: tuple[str, str]
selection: Any selection: _SelectionRaw
validate: bool validate: bool
ondelete: Any ondelete: dict[str, Any] | None
def __init__(self, selection=..., string=..., **kwargs) -> None: ... def __init__(self, selection: _SelectionRaw = ..., string: str = ..., **kwargs) -> None: ...
def setup_nonrelated(self, model) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
def setup_related(self, model): ... def setup_related(self, model: BaseModel): ...
def _get_attrs(self, model_class, name): ... def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
def _setup_attrs(self, model_class, name) -> None: ... def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
def _selection_modules(self, model): ... def _selection_modules(self, model: BaseModel) -> dict[str, set[str, str]]: ...
def _description_selection(self, env): ... def _description_selection(self, env: Environment) -> _Selection: ...
def _default_group_expand(self, records, groups, domain, order): ... def _default_group_expand(self, records: BaseModel, groups, domain, order) -> _Selection: ...
def get_values(self, env): ... def get_values(self, env: Environment) -> _Selection: ...
def convert_to_column(self, value, record, 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, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel): ...
class Reference(Selection): class Reference(Selection):
type: str type: str
@property @property
def column_type(self): ... def column_type(self) -> tuple[str, str]: ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ... def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> str | None: ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> str | None: ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel) -> Union[BaseModel, None]: ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...) -> str | bool: ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel) -> str: ...
def convert_to_display_name(self, value, record): ... def convert_to_display_name(self, value, record: BaseModel) -> str: ...
class _Relational(Field): class _Relational(Field):
relational: bool relational: bool
domain: Any domain: _DomainRaw
context: Any context: dict
check_company: bool check_company: bool
# def __get__(self, records, owner): ... def __get__(self, records: Union[BaseModel, None], owner) -> BaseModel: ...
comodel_name: str comodel_name: str
def setup_nonrelated(self, model) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
def get_domain_list(self, model): ... def get_domain_list(self, model: BaseModel) -> _Domain: ...
@property @property
def _related_domain(self): ... def _related_domain(self) -> _DomainRaw: ...
_related_context: Any _related_context: dict
_description_relation: Any _description_relation: str | None
_description_context: Any _description_context: dict
def _description_domain(self, env): ... def _description_domain(self, env: Environment) -> _Domain: ...
def null(self, record): ... def null(self, record: BaseModel) -> BaseModel: ...
class Many2one(_Relational): class Many2one(_Relational):
type: str type: str
column_type: Any column_type: tuple[str, str]
ondelete: Any ondelete: str | None
auto_join: bool auto_join: bool
delegate: bool delegate: bool
def __init__(self, comodel_name=..., string=..., **kwargs) -> None: ... def __init__(self, comodel_name: str = ..., string: str = ..., **kwargs) -> None: ...
def _setup_attrs(self, model_class, name) -> None: ... def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
def setup_nonrelated(self, model) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
def update_db(self, model, columns): ... def update_db(self, model: BaseModel, columns): ...
def update_db_column(self, model, column) -> None: ... def update_db_column(self, model: BaseModel, column) -> None: ...
def update_db_foreign_key(self, model, column) -> None: ... def update_db_foreign_key(self, model: BaseModel, column) -> None: ...
def _update(self, records, value) -> None: ... def _update(self, records: BaseModel, value) -> None: ...
def convert_to_column(self, value, record, 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, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel): ...
def convert_to_record_multi(self, values, records): ... def convert_to_record_multi(self, values, records: BaseModel): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ... def convert_to_write(self, value, record: BaseModel): ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel) -> str: ...
def convert_to_display_name(self, value, record): ... def convert_to_display_name(self, value, record: BaseModel) -> str: ...
def convert_to_onchange(self, value, record, names): ... def convert_to_onchange(self, value, record: BaseModel, names): ...
def write(self, records, value): ... def write(self, records: _ModelT, value) -> _ModelT: ...
def _remove_inverses(self, records, value): ... def _remove_inverses(self, records: BaseModel, value): ...
def _update_inverses(self, records, value) -> None: ... def _update_inverses(self, records: BaseModel, value) -> None: ...
class Many2oneReference(Integer): class Many2oneReference(Integer):
type: str type: str
model_field: Any model_field: str | None
_related_model_field: Any _related_model_field: str | None
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def _remove_inverses(self, records, value) -> None: ... def _remove_inverses(self, records: BaseModel, value) -> None: ...
def _update_inverses(self, records, value) -> None: ... def _update_inverses(self, records: BaseModel, value) -> None: ...
def _record_ids_per_res_model(self, records): ... def _record_ids_per_res_model(self, records: BaseModel) -> dict[str, set]: ...
class Json(Field):
type: str
column_type: tuple[str, str]
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
class Properties(Field):
type: str
column_type: tuple[str, str]
copy: bool
prefetch: bool
write_sequence: int
store: bool
readonly: bool
precompute: bool
definition: str | None
definition_record: str | None
definition_record_field: str | None
_description_definition_record: str | None
_description_definition_record_field: str | None
ALLOWED_TYPES: tuple[str, ...]
_depends: tuple[str, ...]
compute: Callable
def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
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_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record: BaseModel): ...
def convert_to_onchange(self, value, record: BaseModel, names): ...
def read(self, records: BaseModel) -> None: ...
def write(self, records: _ModelT, value) -> _ModelT: ...
def _compute(self, records: BaseModel) -> None: ...
def _add_default_values(self, env: Environment, values: dict[str, Any]): ...
def _get_properties_definition(self, record: BaseModel): ...
@classmethod
def _add_display_name(cls, values_list: list[dict], env: Environment, value_keys: tuple[str] = ...) -> None: ...
@classmethod
def _remove_display_name(cls, values_list: list[dict], value_key: str = ...) -> None: ...
@classmethod
def _add_missing_names(cls, values_list: list[dict]) -> None: ...
@classmethod
def _parse_json_types(cls, values_list: list[dict], env: Environment) -> None: ...
@classmethod
def _list_to_dict(cls, values_list: list[dict]) -> dict: ...
@classmethod
def _dict_to_list(cls, values_dict: dict, properties_definition: Sequence[dict]) -> Sequence[dict]: ...
class PropertiesDefinition(Field):
type: str
column_type: tuple[str, str]
copy: bool
readonly: bool
prefetch: bool
REQUIRED_KEYS: tuple[str, ...]
ALLOWED_KEYS: tuple[str, ...]
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_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
@classmethod
def _validate_properties_definition(cls, properties_definition: Sequence[dict], env): ...
class Command(enum.IntEnum): class Command(enum.IntEnum):
CREATE: int CREATE: int
@@ -426,81 +512,93 @@ class Command(enum.IntEnum):
CLEAR: int CLEAR: int
SET: int SET: int
@classmethod @classmethod
def create(cls, values: dict): ... def create(cls, values: dict) -> tuple[int, int, dict]: ...
@classmethod @classmethod
def update(cls, id: int, values: dict): ... def update(cls, id: int, values: dict) -> tuple[int, int, dict]: ...
@classmethod @classmethod
def delete(cls, id: int): ... def delete(cls, id: int) -> tuple[int, int, int]: ...
@classmethod @classmethod
def unlink(cls, id: int): ... def unlink(cls, id: int) -> tuple[int, int, int]: ...
@classmethod @classmethod
def link(cls, id: int): ... def link(cls, id: int) -> tuple[int, int, int]: ...
@classmethod @classmethod
def clear(cls): ... def clear(cls) -> tuple[int, int, int]: ...
@classmethod @classmethod
def set(cls, ids: list): ... def set(cls, ids: _SeqIntT) -> tuple[int, int, _SeqIntT]: ...
class _RelationalMulti(_Relational): class _RelationalMulti(_Relational):
write_sequence: int write_sequence: int
def _update(self, records, value): ... def _update(self, records: BaseModel, value): ...
def convert_to_cache(self, value, record, validate: bool = ...): ... def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record): ... def convert_to_record(self, value, record: BaseModel): ...
def convert_to_record_multi(self, values, records): ... def convert_to_record_multi(self, values, records: BaseModel): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ... def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ... def convert_to_write(self, value, record: BaseModel): ...
def convert_to_export(self, value, record): ... def convert_to_export(self, value, record: BaseModel) -> str: ...
def convert_to_display_name(self, value, record) -> None: ... def convert_to_display_name(self, value, record: BaseModel) -> None: ...
def get_depends(self, model): ... def get_depends(self, model: BaseModel): ...
def create(self, record_values) -> None: ... def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records, value): ... def write(self, records: BaseModel, value): ...
def write_batch(self, records_commands_list, create: bool = ...): ... def write_batch(self, records_commands_list: _CommandList, create: bool = ...): ...
class One2many(_RelationalMulti): class One2many(_RelationalMulti):
type: str type: str
inverse_name: Any inverse_name: str | None
auto_join: bool auto_join: bool
limit: Any
copy: bool copy: bool
def __init__(self, comodel_name=..., inverse_name=..., string=..., **kwargs) -> None: ... def __init__(self, comodel_name: str = ..., inverse_name: str = ..., string: str = ..., **kwargs) -> None: ...
def setup_nonrelated(self, model) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
_description_relation_field: Any _description_relation_field: str | None
def update_db(self, model, columns) -> None: ... def update_db(self, model: BaseModel, columns) -> None: ...
def get_domain_list(self, records): ... def get_domain_list(self, records: BaseModel): ...
# def __get__(self, records, owner): ... def __get__(self, records: BaseModel, owner) -> BaseModel: ...
def read(self, records): ... def read(self, records: BaseModel): ...
def write_real(self, records_commands_list, create: bool = ...): ... def write_real(self, records_commands_list: _CommandList, create: bool = ...): ...
def write_new(self, records_commands_list): ... def write_new(self, records_commands_list: _CommandList): ...
class Many2many(_RelationalMulti): class Many2many(_RelationalMulti):
type: str type: str
_explicit: bool _explicit: bool
relation: Any relation: str | None
column1: Any column1: str | None
column2: Any column2: str | None
auto_join: bool auto_join: bool
limit: Any ondelete: str
ondelete: Any def __init__(self, comodel_name: str =..., relation: str = ..., column1: str = ..., column2: str = ..., string: str = ..., **kwargs) -> None: ...
def __init__(self, comodel_name=..., relation=..., column1=..., column2=..., string=..., **kwargs) -> None: ... def setup_nonrelated(self, model: BaseModel) -> None: ...
def setup_nonrelated(self, model) -> None: ... def update_db(self, model: BaseModel, columns) -> None: ...
def update_db(self, model, columns) -> None: ... def update_db_foreign_keys(self, model: BaseModel) -> None: ...
def update_db_foreign_keys(self, model) -> None: ...
@property @property
def groupable(self): ... def groupable(self) -> bool: ...
def read(self, records) -> None: ... def read(self, records: BaseModel) -> None: ...
def write_real(self, records_commands_list, create: bool = ...): ... def write_real(self, records_commands_list: _CommandList, create: bool = ...): ...
def write_new(self, records_commands_list): ... def write_new(self, records_commands_list: _CommandList): ...
class Id(Field): class Id(Field):
type: str type: str
column_type: Any column_type: tuple[str, str]
string: str string: str
store: bool store: bool
readonly: bool readonly: bool
prefetch: bool prefetch: bool
def update_db(self, model, columns) -> None: ... def update_db(self, model: BaseModel, columns) -> None: ...
def __get__(self, record, owner): ... def __get__(self, record: BaseModel, owner): ...
def __set__(self, record, value) -> None: ... def __set__(self, record: BaseModel, value) -> None: ...
def prefetch_many2one_ids(record, field): ... class PrefetchMany2one:
def prefetch_x2many_ids(record, field): ... __slots__ = 'record', 'field'
def apply_required(model, field_name) -> None: ... record: BaseModel
field: Field
def __init__(self, record: BaseModel, field: Field) -> None: ...
def __iter__(self) -> Iterator[int]: ...
def __reversed__(self) -> Iterator[int]: ...
class PrefetchX2many:
__slots__ = 'record', 'field'
record: BaseModel
field: Field
def __init__(self, record: BaseModel, field: Field) -> None: ...
def __iter__(self) -> Iterator[int]: ...
def __reversed__(self) -> Iterator[int]: ...
def apply_required(model: BaseModel, field_name: str) -> None: ...

View File

@@ -1,188 +1,254 @@
from typing import Any, Union from abc import ABC, abstractmethod
from collections import defaultdict
from collections.abc import MutableMapping
from contextlib import nullcontext
from typing import Any, Callable, Generator, Iterable, Literal, Mapping, Sequence, TypeVar
import werkzeug.wrappers import werkzeug
from werkzeug.datastructures import Headers
from werkzeug.exceptions import NotFound
from werkzeug.local import LocalStack
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
from werkzeug.routing import Map, Rule
from werkzeug.urls import URL
from .api import Environment from .api import Environment
from .models import BaseModel
from .modules.registry import Registry from .modules.registry import Registry
from .sql_db import Cursor from .sql_db import Cursor
from .tools._vendor import sessions from .tools._vendor import sessions
from .tools.geoipresolver import GeoIPResolver
from .tools.profiler import Profiler
_logger: Any _T = TypeVar('_T')
rpc_request: Any
rpc_response: Any
STATIC_CACHE: Any
STATIC_CACHE_LONG: Any
ALLOWED_DEBUG_MODES: Any
_request_stack: Any
request: Union[HttpRequest, JsonRequest]
def replace_request_password(args): ... ProxyFix: Callable[..., ProxyFix_]
CORS_MAX_AGE: int
CSRF_FREE_METHODS: tuple[str, ...]
CSRF_TOKEN_SALT: int
DEFAULT_LANG: str
NO_POSTMORTEM: Any def get_default_session() -> dict[str, Any]: ...
def dispatch_rpc(service_name, method, params): ... JSON_MIMETYPES: tuple[str, ...]
MISSING_CSRF_WARNING: str
ROUTING_KEYS: set[str]
SESSION_LIFETIME: int
STATIC_CACHE: int
STATIC_CACHE_LONG: int
class WebRequest: class SessionExpiredException(Exception): ...
httprequest: werkzeug.wrappers.Request
httpresponse: Response def content_disposition(filename: str) -> str: ...
disable_db: bool def db_list(force: bool = ..., host: str | None = ...) -> list[str]: ...
endpoint: Any def db_filter(dbs: Iterable[str], host: str | None = ...) -> list[str]: ...
endpoint_arguments: Any def is_cors_preflight(request: Request, endpoint) -> bool: ...
auth_method: Any def serialize_exception(exception: Exception): ...
website = Environment['website'] def send_file(filepath_or_fp, mimetype: str | None = ..., as_attachment: bool = ..., filename: str | None = ...,
lang = Environment['res.lang'] mtime: str | None = ..., add_etags: bool = ..., cache_timeout: int = ..., conditional: bool = ...) -> werkzeug.Response: ...
_cr: Cursor
_uid: int class Stream:
_context: dict type: str
_env: Environment data: bytes | None
_failed: Any path: str | None
def __init__(self, httprequest) -> None: ... url: str | None
mimetype: str | None
as_attachment: bool
download_name: str | None
conditional: bool
etag: bool
last_modified: float | None
max_age: int | None
immutable: bool
size: int | None
def __init__(self, **kwargs) -> None: ...
@classmethod
def from_path(cls, path: str, filter_ext: tuple[str, ...] = ...) -> Stream: ...
@classmethod
def from_attachment(cls, attachment: 'odoo.model.ir_attachment') -> Stream: ...
@classmethod
def from_binary_field(cls, record: BaseModel, field_name: str) -> Stream: ...
def read(self) -> bytes: ...
def get_response(self, as_attachment: bool | None = ..., immutable: bool | None = ..., **send_file_kwargs) -> werkzeug.Response: ...
class Controller:
children_classes: defaultdict[Any, list]
@classmethod
def __init_subclass__(cls) -> None: ...
def route(route: str | list[str] | None = ...,
type: str = ...,
auth: str = ...,
methods: list[str] = ...,
cors: str = ...,
csrf: bool = ...,
**kw): ...
def _generate_routing_rules(modules: Sequence[str], nodb_only: bool, converters: Any | None = ...) -> Generator[tuple[str, Any], None, None]: ...
class FilesystemSessionStore(sessions.FilesystemSessionStore):
def get_session_filename(self, sid: str) -> str: ...
def save(self, session: Session) -> None: ...
def get(self, sid: str) -> Session: ...
def rotate(self, session: Session, env: Environment) -> None: ...
def vacuum(self) -> None: ...
class Session(MutableMapping):
__slots__ = ('can_save', 'data', 'is_dirty', 'is_explicit', 'is_new', 'should_rotate', 'sid')
can_save: bool
data: dict
is_dirty: bool
is_explicit: bool
is_new: bool
should_rotate: bool
sid: str
def __init__(self, data: dict, sid: str, new: bool = ...) -> None: ...
def __getitem__(self, item: str): ...
def __setitem__(self, item: str, value) -> None: ...
def __delitem__(self, item: str) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterable[str]: ...
def __getattr__(self, attr: str): ...
def __setattr__(self, key: str, val) -> None: ...
uid: int | None
pre_login: str | None
pre_uid: int
def authenticate(self, dbname: str, login: str | None = ..., password: str | None = ...) -> int: ...
def finalize(self, env: Environment) -> None: ...
def logout(self, keep_db: bool = ...) -> None: ...
def touch(self) -> None: ...
_request_stack: LocalStack
request: Request
class Response(werkzeug.Response):
default_mimetype: str
def __init__(self, *args, **kw) -> None: ...
@classmethod
def load(cls, result, fname: str = ...): ...
template: Any
qcontext: dict
uid: int
def set_default(self, template: Any | None = ..., qcontext: dict | None = ..., uid: int | None = ...) -> None: ...
@property @property
def cr(self) -> Cursor: ... def is_qweb(self) -> bool: ...
def render(self): ...
def flatten(self) -> None: ...
def set_cookie(self, key: str, value: str = ..., max_age: Any | None = ..., expires: Any | None = ...,
path: str = ..., domain: str | None = ..., secure: bool = ..., httponly: bool = ...,
samesite: str | None = ..., cookie_type: str = ...) -> None: ...
class FutureResponse:
charset: str
max_cookie_size: int
headers: Headers
def __init__(self) -> None: ...
def set_cookie(self, key: str, value: str = ..., max_age: Any | None = ..., expires: Any | None = ...,
path: str = ..., domain: str | None = ..., secure: bool = ..., httponly: bool = ...,
samesite: str | None = ..., cookie_type: str = ...) -> None: ...
class Request:
httprequest: werkzeug.Request
future_response: FutureResponse | None
dispatcher: Dispatcher
registry: Registry | None
session: Session
db: str | None
env: Environment | None
website: 'odoo.model.website'
lang: 'odoo.model.res_lang'
def __init__(self, httprequest: werkzeug.Request) -> None: ...
def _get_session_and_dbname(self) -> tuple[Session, str]: ...
def update_env(self, user: 'odoo.model.res_users | int | None' = ..., context: dict[str, Any] | None = ...,
su: bool | None = ...) -> None: ...
def update_context(self, **overrides) -> None: ...
@property
def context(self) -> dict[str, Any]: ...
@context.setter
def context(self, value) -> None: ...
@property @property
def uid(self) -> int: ... def uid(self) -> int: ...
@uid.setter @uid.setter
def uid(self, val) -> None: ... def uid(self, value) -> None: ...
@property @property
def context(self): ... def cr(self) -> Cursor: ...
@context.setter @cr.setter
def context(self, val) -> None: ... def cr(self, value) -> None: ...
_cr: Cursor
@property @property
def env(self) -> Environment: ... def geoip(self) -> dict[str, Any]: ...
def csrf_token(self, time_limit: int | None = ...) -> str: ...
def validate_csrf(self, csrf: str) -> bool: ...
def default_context(self) -> dict: ...
def default_lang(self) -> str: ...
def _geoip_resolve(self) -> dict[str, Any]: ...
def get_http_params(self) -> dict: ...
def get_json_data(self): ...
def _get_profiler_context_manager(self) -> Profiler | nullcontext: ...
def _inject_future_response(self, response: werkzeug.Response): ...
def make_response(self, data: str, headers: list[tuple[str, Any]] | None = ..., cookies: Mapping | None = ...,
status: int = ...) -> Response: ...
def make_json_response(self, data, headers: list[tuple[str, Any]] | None = ..., cookies: Mapping | None = ...,
status: int = ...) -> Response: ...
def not_found(self, description: str | None = ...) -> NotFound: ...
def redirect(self, location: URL | str, code: int = ..., local: bool = ...) -> werkzeug.Response: ...
def redirect_query(self, location: str, query: Mapping[str, str] | Iterable[tuple[str, str]] | None = ...,
code: int = ..., local: bool = ...) -> werkzeug.Response: ...
def render(self, template: str, qcontext: dict | None = ..., lazy: bool = ..., **kw): ...
def _save_session(self) -> None: ...
def _set_request_dispatcher(self, rule: Rule) -> None: ...
def _serve_static(self) -> werkzeug.Response: ...
def _serve_nodb(self): ...
def _serve_db(self): ...
params: dict
def _serve_ir_http(self): ...
_dispatchers: dict[str, type[Dispatcher]]
class Dispatcher(ABC):
routing_type: str
@classmethod
def __init_subclass__(cls) -> None: ...
request: Request
def __init__(self, request: Request) -> None: ...
@classmethod
@abstractmethod
def is_compatible_with(cls, request: Request) -> bool: ...
def pre_dispatch(self, rule: Rule, args) -> None: ...
@abstractmethod
def dispatch(self, endpoint, args): ...
def post_dispatch(self, response: werkzeug.Response) -> None: ...
@abstractmethod
def handle_error(self, exc: Exception): ...
class HttpDispatcher(Dispatcher):
routing_type: str
@classmethod
def is_compatible_with(cls, request: Request) -> Literal[True]: ...
def dispatch(self, endpoint, args): ...
def handle_error(self, exc: Exception): ...
class JsonRPCDispatcher(Dispatcher):
routing_type: str
jsonrequest: dict
def __init__(self, request: Request) -> None: ...
@classmethod
def is_compatible_with(cls, request: Request) -> bool: ...
def dispatch(self, endpoint, args): ...
def handle_error(self, exc: Exception) -> Response: ...
def _response(self, result: Any | None = ..., error: Any | None = ...) -> Response: ...
class Application:
@property @property
def session(self) -> OpenERPSession: ... def statics(self) -> dict[str, str]: ...
def __enter__(self): ... def get_static_file(self, url: str, host: str = ...) -> str | None: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def set_handler(self, endpoint, arguments, auth) -> None: ...
def _handle_exception(self, exception) -> None: ...
def redirect(self, location, code: int = ..., local: bool = ...): ...
def redirect_query(self, location, query: Any | None = ..., code: int = ..., local: bool = ...): ...
def _is_cors_preflight(self, endpoint): ...
def _call_function(self, *args, **kwargs): ...
def registry_cr(self) -> None: ...
@property @property
def registry(self) -> Registry: ... def nodb_routing_map(self) -> Map: ...
@property @property
def db(self): ... def session_store(self) -> FilesystemSessionStore: ...
def csrf_token(self, time_limit: Any | None = ...): ...
def validate_csrf(self, csrf): ...
def route(route: Any | None = ..., **kw): ...
class JsonRequest(WebRequest):
_request_type: str
params: Any
jsonrequest: Any
context: Any
def __init__(self, *args) -> None: ...
def _json_response(self, result: Any | None = ..., error: Any | None = ...): ...
def _handle_exception(self, exception): ...
def dispatch(self): ...
def serialize_exception(e): ...
class HttpRequest(WebRequest):
_request_type: str
params: Any
def __init__(self, *args) -> None: ...
def _handle_exception(self, exception): ...
def _is_cors_preflight(self, endpoint): ...
def dispatch(self): ...
def make_response(self, data, headers: Any | None = ..., cookies: Any | None = ...): ...
def render(self, template, qcontext: Any | None = ..., lazy: bool = ..., **kw): ...
def not_found(self, description: Any | None = ...): ...
addons_manifest: Any
controllers_per_module: Any
class ControllerType(type):
def __init__(cls, name, bases, attrs) -> None: ...
Controller: Any
class EndPoint:
method: Any
original: Any
routing: Any
arguments: Any
def __init__(self, method, routing) -> None: ...
@property @property
def first_arg_is_req(self): ... def geoip_resolver(self) -> GeoIPResolver | None: ...
def __call__(self, *args, **kw): ... def get_db_router(self, db: str): ...
def set_csp(self, response: werkzeug.Response) -> None: ...
def __call__(self, environ: dict, start_response: Callable): ...
def _generate_routing_rules(modules, nodb_only, converters: Any | None = ...): ... root: Application
class AuthenticationError(Exception): ...
class SessionExpiredException(Exception): ...
class OpenERPSession(sessions.Session):
inited: bool
modified: bool
rotate: bool
def __init__(self, *args, **kwargs) -> None: ...
def __getattr__(self, attr): ...
def __setattr__(self, k, v): ...
pre_uid: Any
db: Any
login: Any
def authenticate(self, db, login: Any | None = ..., password: Any | None = ...): ...
session_token: Any
def finalize(self) -> None: ...
def check_security(self) -> None: ...
def logout(self, keep_db: bool = ...) -> None: ...
def _default_values(self) -> None: ...
context: Any
def get_context(self): ...
def _fix_lang(self, context) -> None: ...
def save_action(self, action): ...
def get_action(self, key): ...
def save_request_data(self) -> None: ...
def load_request_data(self) -> None: ...
def session_gc(session_store) -> None: ...
ODOO_DISABLE_SESSION_GC: Any
session_gc: Any
class Response(werkzeug.wrappers.Response):
default_mimetype: str
def __init__(self, *args, **kw) -> None: ...
template: Any
qcontext: Any
uid: Any
def set_default(self, template: Any | None = ..., qcontext: Any | None = ..., uid: Any | None = ...) -> None: ...
@property
def is_qweb(self): ...
def render(self): ...
def flatten(self) -> None: ...
class DisableCacheMiddleware:
app: Any
def __init__(self, app) -> None: ...
def __call__(self, environ, start_response): ...
class Root:
_loaded: bool
def __init__(self) -> None: ...
def session_store(self): ...
def nodb_routing_map(self): ...
def __call__(self, environ, start_response): ...
def load_addons(self) -> None: ...
def setup_session(self, httprequest): ...
def setup_db(self, httprequest) -> None: ...
def setup_lang(self, httprequest) -> None: ...
def get_request(self, httprequest): ...
def get_response(self, httprequest, result, explicit_session): ...
def dispatch(self, environ, start_response): ...
def get_profiler_context_manager(self, request): ...
def get_db_router(self, db): ...
def db_list(force: bool = ..., httprequest: Any | None = ...): ...
def db_filter(dbs, httprequest: Any | None = ...): ...
def db_monodb(httprequest: Any | None = ...): ...
def send_file(filepath_or_fp, mimetype: Any | None = ..., as_attachment: bool = ..., filename: Any | None = ..., mtime: Any | None = ..., add_etags: bool = ..., cache_timeout=..., conditional: bool = ...): ...
def content_disposition(filename): ...
def set_safe_image_headers(headers, content): ...
def set_header_field(headers, name, value): ...
root: Any

View File

@@ -1,4 +1,4 @@
from typing import Any from typing import Generator
LOG_NOTSET: str LOG_NOTSET: str
LOG_DEBUG: str LOG_DEBUG: str
@@ -7,9 +7,9 @@ LOG_WARNING: str
LOG_ERROR: str LOG_ERROR: str
LOG_CRITICAL: str LOG_CRITICAL: str
def get_encodings(hint_encoding: str = ...) -> None: ... def get_encodings(hint_encoding: str = ...) -> Generator[str, None, None]: ...
text_type: Any text_type: type[str]
def ustr(value, hint_encoding: str = ..., errors: str = ...): ... def ustr(value, hint_encoding: str = ..., errors: str = ...) -> str: ...
def exception_to_unicode(e): ... def exception_to_unicode(e: BaseException) -> str: ...

View File

@@ -1,329 +1,337 @@
from collections.abc import MutableMapping from collections import defaultdict
from typing import Any, Generator, List, TypeVar from re import Pattern
from typing import Any, Callable, Collection, Container, Iterable, Iterator, MutableMapping, Sequence, TypeVar, Union
import psycopg2
from . import api, fields from . import api, fields
from .api import Environment from .api import Environment
from .fields import Field
from .modules.registry import Registry from .modules.registry import Registry
from .sql_db import Cursor from .sql_db import Cursor
from .tools.query import Query
_M = TypeVar('_M') _T = TypeVar('_T')
_ModelT = TypeVar('_ModelT', bound=BaseModel)
_Domain = list
_logger: Any regex_order: Pattern[str]
_schema: Any regex_object_name: Pattern[str]
_unlink: Any regex_pg_name: Pattern[str]
regex_order: Any regex_field_agg: Pattern[str]
regex_object_name: Any
regex_pg_name: Any
regex_field_agg: Any
AUTOINIT_RECALCULATE_STORED_FIELDS: int AUTOINIT_RECALCULATE_STORED_FIELDS: int
INSERT_BATCH_SIZE: int
SQL_DEFAULT: psycopg2.extensions.AsIs
def check_object_name(name): ... def check_object_name(name: str) -> bool: ...
def raise_on_invalid_object_name(name) -> None: ... def raise_on_invalid_object_name(name: str) -> None: ...
def check_pg_name(name) -> None: ... def check_pg_name(name: str) -> None: ...
regex_private: Any regex_private: Pattern[str]
def check_method_name(name) -> None: ... def check_method_name(name: str) -> None: ...
def same_name(f, g): ... def fix_import_export_id_paths(fieldname: str) -> list[str]: ...
def fix_import_export_id_paths(fieldname): ... def merge_trigger_trees(trees: list, select: Callable[[Any], bool] = ...) -> dict: ...
def trigger_tree_merge(node1, node2) -> None: ...
class MetaModel(api.Meta): class MetaModel(api.Meta):
module_to_models: Any module_to_models: defaultdict[str, list[type[BaseModel]]]
def __new__(meta, name, bases, attrs): ... def __new__(meta, name: str, bases: tuple, attrs: dict): ...
def __init__(self, name, bases, attrs) -> None: ... def __init__(self: type[BaseModel], name: str, bases: tuple, attrs: dict) -> None: ...
class NewId: class NewId:
__slots__: Any __slots__: list[str]
origin: Any origin: int | None
ref: Any ref: Any
def __init__(self, origin: Any | None = ..., ref: Any | None = ...) -> None: ... def __init__(self, origin: int | None = ..., ref: Any | None = ...) -> None: ...
def __bool__(self): ... def __bool__(self) -> bool: ...
def __eq__(self, other): ... def __eq__(self, other) -> bool: ...
def __hash__(self): ... def __hash__(self) -> int: ...
def __repr__(self): ... def __repr__(self) -> str: ...
def __str__(self): ... def __str__(self) -> str: ...
def origin_ids(ids): ... def origin_ids(ids: Iterable) -> Iterator[int]: ...
def expand_ids(id0, ids) -> None: ...
IdType: Any class OriginIds:
__slots__ = ['ids']
ids: Sequence[int]
def __init__(self, ids: Sequence[int]) -> None: ...
def __iter__(self) -> Iterator[int]: ...
def __reversed__(self) -> Iterator[int]: ...
def expand_ids(id0: _T, ids: Iterable) -> Iterator[_T]: ...
IdType: tuple[type[int], type[str], type[NewId]]
PREFETCH_MAX: int PREFETCH_MAX: int
LOG_ACCESS_COLUMNS: Any LOG_ACCESS_COLUMNS: list[str]
MAGIC_COLUMNS: Any MAGIC_COLUMNS: list[str]
VALID_AGGREGATE_FUNCTIONS: Any VALID_AGGREGATE_FUNCTIONS: set[str]
def is_definition_class(cls): ... def is_definition_class(cls) -> bool: ...
def is_registry_class(cls): ... def is_registry_class(cls) -> bool: ...
class BaseModel(metaclass=MetaModel): class BaseModel(metaclass=MetaModel):
__slots__: Any __slots__: list[str]
_auto: bool _auto: bool
_register: bool _register: bool
_abstract: bool _abstract: bool
_transient: bool _transient: bool
_name: str _name: str
_description: str _description: str
_module: Any _module: str
_custom: bool _custom: bool
_inherit: Any _inherit: tuple[str]
_inherits: Any _inherits: dict[str, str]
_table: str _table: str
_table_query: Any _table_query: str | None
_sequence: Any _sql_constraints: list[tuple[str, str, str]]
_sql_constraints: Any _rec_name: str | None
_rec_name: str _rec_names_search: Sequence[str] | None
_order: str _order: str
_parent_name: str _parent_name: str
_parent_store: bool _parent_store: bool
_active_name: Any _active_name: str | None
_date_name: str
_fold_name: str _fold_name: str
_needaction: bool
_translate: bool _translate: bool
_check_company_auto: bool _check_company_auto: bool
_depends: Any _depends: dict[str, Iterable[str]]
_transient_max_count: Any _transient_max_count: int
_transient_max_hours: Any _transient_max_hours: float
_fields: dict[str, fields.Field] _original_module: str
_ids: List[int] _inherit_module: dict[str, str]
_prefetch_ids: List[int] _inherit_children: set[str]
_inherits_children: set[str]
_fields: dict[str, Field]
_field_definitions: list[Field]
_log_access: bool
_ids: tuple
_prefetch_ids: Iterable[int]
__base_classes: tuple[type[BaseModel] | type, ...]
env: Environment = ... env: Environment = ...
pool: Registry pool: Registry
id = fields.Id() id = fields.Id()
display_name = fields.Char() display_name = fields.Char(string='Display Name')
create_uid = fields.Many2one('res.users') create_uid = fields.Many2one('res.users', string='Created by')
create_date = fields.Datetime() create_date = fields.Datetime(string='Created on')
write_uid = fields.Many2one('res.users') write_uid = fields.Many2one('res.users', string='Last Updated by')
write_date = fields.Datetime() write_date = fields.Datetime(string='Last Updated on')
CONCURRENCY_CHECK_FIELD: str CONCURRENCY_CHECK_FIELD: str
def view_init(self, fields_list) -> None: ... def _valid_field_parameter(self, field: Field, name: str) -> bool: ...
def _valid_field_parameter(self, field, name): ... def _add_field(self, name: str, field: Field) -> None: ...
def _add_field(self, name, field) -> None: ... def _pop_field(self, name: str) -> Field: ...
def _pop_field(self, name): ...
def _compute_concurrency_field(self) -> None: ... def _compute_concurrency_field(self) -> None: ...
@classmethod @classmethod
def _build_model(cls, pool, cr): ... def _build_model(cls, pool: Registry, cr: Cursor) -> BaseModel: ...
@classmethod @classmethod
def _build_model_check_base(model_class, cls) -> None: ... def _build_model_check_base(model_class, cls: type[BaseModel]) -> None: ...
@classmethod @classmethod
def _build_model_check_parent(model_class, cls, parent_class) -> None: ... def _build_model_check_parent(model_class, cls: type[BaseModel], parent_class: type[BaseModel]) -> None: ...
@classmethod @classmethod
def _build_model_attributes(cls, pool) -> None: ... def _build_model_attributes(cls, pool: Registry) -> None: ...
@classmethod @classmethod
def _init_constraints_onchanges(cls) -> None: ... def _init_constraints_onchanges(cls) -> None: ...
@property @property
def _constraint_methods(self): ... def _constraint_methods(self) -> list: ...
@property @property
def _ondelete_methods(self): ... def _ondelete_methods(self) -> list: ...
@property @property
def _onchange_methods(self): ... def _onchange_methods(self) -> dict[str, list]: ...
def __new__(cls) -> None: ... def _is_an_ordinary_table(self) -> bool: ...
def __init__(self, pool, cr) -> None: ... def __ensure_xml_id(self: _ModelT, skip: bool = ...) -> Iterator[tuple[_ModelT, str | None]]: ...
def _is_an_ordinary_table(self): ... def _export_rows(self, fields: list[list[str]], *, _is_toplevel_call: bool = ...) -> list[list]: ...
def __ensure_xml_id(self, skip: bool = ...): ... def export_data(self, fields_to_export: list[str]) -> dict[str, list[list]]: ...
def _export_rows(self, fields, *, _is_toplevel_call: bool = ...): ... def load(self, fields: list[str], data: list[list[str]]) -> dict[str, Any]: ...
__export_rows: Any def _add_fake_fields(self, fields: dict[str | None, Field]) -> dict[str | None, Field]: ...
def export_data(self, fields_to_export): ... def _extract_records(self, fields_: Iterable[Sequence[str]], data, log: Callable = ..., limit: float = ...) -> Iterator[tuple[BaseModel, dict[str, dict[str, int]]]]: ...
def load(self, fields, data): ... def _convert_records(self, records, log: Callable = ...) -> Iterator[tuple[Any, Any, Any, dict]]: ...
def _add_fake_fields(self, fields): ... def _validate_fields(self, field_names: Iterable[str], excluded_names: Iterable[str] = ...) -> None: ...
def _extract_records(self, fields_, data, log=..., limit=...): ... def default_get(self, fields_list: list[str]) -> dict[str, Any]: ...
def _convert_records(self, records, log=...) -> None: ... def fields_get_keys(self) -> list[str]: ...
def _validate_fields(self, field_names, excluded_names=...) -> None: ... def _rec_name_fallback(self) -> str: ...
def default_get(self, fields_list): ... def user_has_groups(self, groups: str) -> bool: ...
def fields_get_keys(self): ... def search_count(self, domain: _Domain, limit: int | None = ...) -> int: ...
def _rec_name_fallback(self): ... def search(self: _ModelT, domain: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: bool = ...) -> _ModelT | int: ...
def view_header_get(self, view_id: Any | None = ..., view_type: str = ...): ...
def user_has_groups(self, groups): ...
def _get_default_form_view(self): ...
def _get_default_search_view(self): ...
def _get_default_tree_view(self): ...
def _get_default_pivot_view(self): ...
def _get_default_kanban_view(self): ...
def _get_default_graph_view(self): ...
def _get_default_calendar_view(self): ...
def load_views(self, views, options: Any | None = ...): ...
def _fields_view_get(self, view_id: Any | None = ..., view_type: str = ..., toolbar: bool = ..., submenu: bool = ...): ...
def fields_view_get(self, view_id: Any | None = ..., view_type: str = ..., toolbar: bool = ..., submenu: bool = ...): ...
def get_formview_id(self, access_uid: Any | None = ...): ...
def get_formview_action(self, access_uid: Any | None = ...): ...
def get_access_action(self, access_uid: Any | None = ...): ...
def search_count(self, args) -> int: ...
def search(self: _M, args, offset: int = ..., limit: Any | None = ..., order: Any | None = ..., count: bool = ...) -> _M: ...
def _compute_display_name(self) -> None: ... def _compute_display_name(self) -> None: ...
def name_get(self): ... def name_get(self) -> list[tuple[int, str]]: ...
def name_create(self, name): ... def name_create(self, name: str) -> tuple[int, str]: ...
def name_search(self, name: str = ..., args: Any | None = ..., operator: str = ..., limit: 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: Any | None = ..., operator: str = ..., limit: int = ..., name_get_uid: Any | None = ...): ... 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): ... def _add_missing_default_values(self, values: dict[str, Any]) -> dict[str, Any]: ...
@classmethod @classmethod
def clear_caches(cls) -> None: ... def clear_caches(cls) -> None: ...
def _read_group_expand_full(self, groups, domain, order): ... def _read_group_expand_full(self, groups: _ModelT, domain: _Domain | None, order: str | None) -> _ModelT: ...
def _read_group_fill_results(self, domain, groupby, remaining_groupbys, aggregated_fields, count_field, read_group_result, read_group_order: Any | None = ...): ... 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, groupby, aggregated_fields, annotated_groupbys, fill_from: bool = ..., fill_to: bool = ..., min_groups: bool = ...): ... 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, aggregated_fields, annotated_groupbys, query): ... 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, query): ... def _read_group_process_groupby(self, gb: str, query: Query) -> dict[str, Any]: ...
def _read_group_prepare_data(self, key, value, groupby_dict): ... def _read_group_prepare_data(self, key, value, groupby_dict: dict[str, dict[str, Any]]) -> Any: ...
def _read_group_format_result(self, data, annotated_groupbys, groupby, domain): ... def _read_group_format_result(self, data: dict, annotated_groupbys: list[dict], groupby: list, domain: _Domain) -> dict: ...
def read_group(self, domain, fields, groupby, offset: int = ..., limit: Any | None = ..., orderby: bool = ..., lazy: bool = ...): ... 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, fields, groupby, offset: int = ..., limit: Any | None = ..., orderby: bool = ..., lazy: bool = ...): ... 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_resolve_many2x_fields(self, data, fields) -> None: ... 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 _inherits_join_add(self, current_model, parent_model_name, query): ... def _read_group_resolve_many2x_fields(self, data: list[dict[str, Any]], fields: list[dict[str, Any]]) -> None: ...
def _inherits_join_calc(self, alias, fname, query): ... 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 _parent_store_compute(self): ...
def _check_removed_columns(self, log: bool = ...) -> None: ... def _check_removed_columns(self, log: bool = ...) -> None: ...
def _init_column(self, column_name) -> None: ... def _init_column(self, column_name: str) -> None: ...
def _table_has_rows(self): ... def _table_has_rows(self) -> int: ...
def _auto_init(self): ... def _auto_init(self): ...
def init(self) -> None: ... def init(self) -> None: ...
def _create_parent_columns(self) -> None: ... def _check_parent_path(self) -> None: ...
def _add_sql_constraints(self) -> None: ... def _add_sql_constraints(self) -> None: ...
def _execute_sql(self) -> None: ...
def _add_inherited_fields(self) -> None: ... def _add_inherited_fields(self) -> None: ...
def _inherits_check(self) -> None: ... def _inherits_check(self) -> None: ...
def _prepare_setup(self) -> None: ... def _prepare_setup(self) -> None: ...
def _setup_base(self) -> None: ... def _setup_base(self) -> None: ...
def _setup_fields(self) -> None: ... def _setup_fields(self) -> None: ...
def _setup_complete(self) -> None: ... def _setup_complete(self) -> None: ...
def fields_get(self, allfields: Any | None = ..., attributes: Any | None = ...): ... def fields_get(self, allfields: list[str] | None = ..., attributes: list[str] | None = ...) -> dict[str, dict[str, Any]]: ...
def get_empty_list_help(self, help): ... def check_field_access_rights(self, operation: str, fields: Collection[str]): ...
def check_field_access_rights(self, operation, fields): ... def read(self, fields: Collection[str] | None = ..., load: str = ...) -> list[dict[str, Any]]: ...
def read(self, fields: list[str] | None = ..., load: str = ...) -> list[dict[str, Any]]: ... def update_field_translations(self, field_name: str, translations: dict[str, Any]) -> bool: ...
def _read_format(self, fnames, load: str = ...): ... def _update_field_translations(self, field_name: str, translations: dict[str, Any], digest: Callable | None = ...) ->bool: ...
def _fetch_field(self, field) -> None: ... def get_field_translations(self, field_name: str, langs: list[str] | None = ...) -> tuple[list[dict[str, Any]], dict[str, Any]]: ...
def _read(self, fields: list[str]): ... def _read_format(self, fnames: Collection[str], load: str = ...) -> list[dict[str, Any]]: ...
def get_metadata(self): ... def _fetch_field(self, field: Field) -> None: ...
def get_base_url(self): ... def _read(self, field_names: Collection[str]): ...
def _check_concurrency(self) -> None: ... def get_metadata(self) -> list[dict[str, Any]]: ...
def _check_company(self, fnames: Any | None = ...) -> None: ... def get_base_url(self) -> str: ...
def check_access_rights(self, operation, raise_exception: bool = ...): ... def _check_company(self, fnames: Collection[str] | None = ...) -> None: ...
def check_access_rule(self, operation) -> None: ... def check_access_rights(self, operation: str, raise_exception: bool = ...) -> bool: ...
def _filter_access_rules(self, operation): ... def check_access_rule(self, operation: str) -> None: ...
def _filter_access_rules_python(self, operation): ... def _filter_access_rules(self: _ModelT, operation: str) -> _ModelT: ...
def _filter_access_rules_python(self, operation: str) -> _ModelT: ...
def unlink(self): ... def unlink(self): ...
def write(self, vals: dict[str, Any]): ... def write(self, vals: dict[str, Any]): ...
def _write(self, vals: dict[str, Any]): ... def _write(self, vals: dict[str, Any]) -> None: ...
def create(self: _M, vals_list: list[dict[str, Any]] | dict[str, Any]) -> _M: ... def create(self: _ModelT, vals_list: list[dict[str, Any]] | dict[str, Any]) -> _ModelT: ...
def _create(self: _M, data_list: list[dict[str, Any]]) -> _M: ... def _prepare_create_values(self, vals_list: list[dict[str, Any]]) -> list[dict[str, Any]]: ...
def _compute_field_value(self, field) -> None: ... def _add_precomputed_values(self, vals_list: list[dict[str, Any]]) -> None: ...
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: ... def _parent_store_create(self) -> None: ...
def _parent_store_update_prepare(self, vals): ... def _parent_store_update_prepare(self: _ModelT, vals: dict) -> _ModelT: ...
def _parent_store_update(self) -> None: ... def _parent_store_update(self) -> None: ...
def _load_records_write(self, values) -> None: ... def _load_records_write(self, values: dict[str, Any]) -> None: ...
def _load_records_create(self, values): ... def _load_records_create(self, values: list[dict[str, Any]]): ...
def _load_records(self, data_list, update: bool = ...): ... def _load_records(self, data_list: list[dict], update: bool = ...) -> BaseModel: ...
def _where_calc(self, domain, active_test: bool = ...): ... def _where_calc(self, domain: _Domain, active_test: bool = ...) -> Query: ...
def _check_qorder(self, word): ... def _check_qorder(self, word: str) -> bool: ...
def _apply_ir_rules(self, query, mode: str = ...) -> None: ... def _apply_ir_rules(self, query: Query, mode: str = ...) -> None: ...
def _generate_translated_field(self, table_alias, field, query): ... def _generate_m2o_order_by(self, alias: str, order_field: str, query: Query, reverse_direction: bool, seen: set | None) -> list[str]: ...
def _generate_m2o_order_by(self, alias, order_field, query, reverse_direction, seen): ... 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_inner(self, alias, order_spec, query, reverse_direction: bool = ..., seen: Any | None = ...): ... def _generate_order_by(self, order_spec: str | None, query: Query) -> str: ...
def _generate_order_by(self, order_spec, query): ... def _flush_search(self, domain: _Domain, fields: Sequence[str] | None = ..., order: str | None = ..., seen: set | None = ...) -> None: ...
def _flush_search(self, domain, fields: Any | None = ..., order: Any | None = ..., seen: Any | None = ...) -> None: ... def _search(self: _ModelT, domain: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: bool = ..., access_rights_uid: int | None = ...) -> Query | int: ...
def _search(self: _M, args, offset: int = ..., limit: Any | None = ..., order: Any | None = ..., count: bool = ..., access_rights_uid: Any | None = ...) -> _M: ... def copy_data(self, default: dict[str, Any] | None = ...) -> list[dict[str, Any]]: ...
def copy_data(self, default: Any | None = ...): ... def copy_translations(self: _ModelT, new: _ModelT, excluded: Container[str] = ...) -> None: ...
def copy_translations(old, new, excluded=...): ... def copy(self: _ModelT, default: dict[str, Any] | None = ...) -> _ModelT: ...
def copy(self: _M, default: Any | None = ...) -> _M: ... def exists(self: _ModelT) -> _ModelT: ...
def exists(self: _M) -> _M: ... def _check_recursion(self, parent: str | None = ...) -> bool: ...
def _check_recursion(self, parent: Any | None = ...): ... def _check_m2m_recursion(self, field_name: str) -> bool: ...
def _check_m2m_recursion(self, field_name): ... def _get_external_ids(self) -> dict[int, list[str]]: ...
def _get_external_ids(self): ... def get_external_id(self) -> dict[int, str]: ...
def get_external_id(self): ... def get_xml_id(self) -> dict[int, str]: ...
get_xml_id: Any
_get_xml_ids: Any
@classmethod @classmethod
def is_transient(cls): ... def is_transient(cls) -> bool: ...
def search_read(self, domain: Any | None = ..., fields: Any | None = ..., offset: int = ..., limit: Any | None = ..., order: Any | None = ..., **read_kwargs): ... 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 toggle_active(self) -> None: ...
def action_archive(self): ... def action_archive(self): ...
def action_unarchive(self): ... def action_unarchive(self): ...
def _register_hook(self) -> None: ... def _register_hook(self) -> None: ...
def _unregister_hook(self) -> None: ... def _unregister_hook(self) -> None: ...
@classmethod @classmethod
def _patch_method(cls, name, method) -> None: ... def _patch_method(cls, name: str, method) -> None: ...
@classmethod @classmethod
def _revert_method(cls, name) -> None: ... def _revert_method(cls, name: str) -> None: ...
@classmethod def __init__(self, env: Environment, ids: tuple, prefetch_ids: Iterable[int]) -> None: ...
def _browse(cls, env, ids, prefetch_ids): ... def browse(self: _ModelT, ids: int | NewId | Iterable[int | NewId] | None = ...) -> _ModelT: ...
def browse(self: _M, ids: Any | None = ...) -> _M: ...
@property @property
def ids(self) -> list[int]: ... def ids(self) -> list[int]: ...
_cr: Cursor _cr: Cursor
_uid: int _uid: int
_context: dict _context: dict
def ensure_one(self: _M) -> _M: ... def ensure_one(self: _ModelT) -> _ModelT: ...
def with_env(self: _M, env) -> _M: ... def with_env(self: _ModelT, env: Environment) -> _ModelT: ...
def sudo(self: _M, flag: bool = ...) -> _M: ... def sudo(self: _ModelT, flag: bool = ...) -> _ModelT: ...
def with_user(self: _M, user) -> _M: ... def with_user(self: _ModelT, user: Union['odoo.model.res_partner', int]) -> _ModelT: ...
def with_company(self: _M, company) -> _M: ... def with_company(self: _ModelT, company: Union['odoo.model.res_company', int]) -> _ModelT: ...
def with_context(self: _M, *args, **kwargs) -> _M: ... def with_context(self: _ModelT, *args, **kwargs) -> _ModelT: ...
def with_prefetch(self: _M, prefetch_ids: Any | None = ...) -> _M: ... def with_prefetch(self: _ModelT, prefetch_ids: Iterable[int] | None = ...) -> _ModelT: ...
def _update_cache(self, values, validate: bool = ...): ... def _update_cache(self, values: dict[str, Any], validate: bool = ...): ...
def _convert_to_record(self, values): ... def _convert_to_record(self, values: dict[str, Any]): ...
def _convert_to_write(self, values: dict[str, Any]) -> dict[str, Any]: ... def _convert_to_write(self, values: dict[str, Any]) -> dict[str, Any]: ...
def _mapped_func(self, func): ... def _mapped_func(self, func: Callable): ...
def mapped(self, func): ... def mapped(self, func: Callable | str): ...
def _mapped_cache(self, name_seq): ... def filtered(self: _ModelT, func: Callable | str) -> _ModelT: ...
def filtered(self: _M, func) -> _M: ... def filtered_domain(self: _ModelT, domain: _Domain) -> _ModelT: ...
def filtered_domain(self: _M, domain) -> _M: ... def sorted(self: _ModelT, key: Callable | str | None = ..., reverse: bool = ...) -> _ModelT: ...
def sorted(self: _M, key: Any | None = ..., reverse: bool = ...) -> _M: ... def update(self, values: dict[str, Any]) -> None: ...
def update(self, values) -> None: ... def flush(self, fnames: Collection[str] | None = ..., records: BaseModel | None = ...) -> None: ...
def flush(self, fnames: Any | None = ..., records: Any | None = ...) -> None: ... def flush_model(self, fnames: Iterable[str] | None = ...) -> None: ...
def new(self: _M, values=..., origin: Any | None = ..., ref: Any | None = ...) -> _M: ... def flush_recordset(self, fnames: Iterable[str] | None = ...) -> None: ...
def _flush(self, fnames: Iterable[str] | None = ...) -> None: ...
def new(self: _ModelT, values: dict[str, Any] | None = ..., origin: _ModelT | None = ..., ref: Any | None = ...) -> _ModelT: ...
@property @property
def _origin(self: _M) -> _M: ... def _origin(self: _ModelT) -> _ModelT: ...
def __bool__(self) -> bool: ... def __bool__(self) -> bool: ...
__nonzero__: Any
def __len__(self) -> int: ... def __len__(self) -> int: ...
def __iter__(self: _M) -> Generator[_M]: ... def __iter__(self: _ModelT) -> Iterator[_ModelT]: ...
def __contains__(self, item) -> bool: ... def __reversed__(self) -> Iterator[_ModelT]: ...
def __add__(self: _M, other) -> _M: ... def __contains__(self: _ModelT, item: _ModelT | str) -> bool: ...
def concat(self: _M, *args) -> _M: ... def __add__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def __sub__(self: _M, other) -> _M: ... def concat(self: _ModelT, *args: _ModelT) -> _ModelT: ...
def __and__(self: _M, other) -> _M: ... def __sub__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def __or__(self: _M, other) -> _M: ... def __and__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def union(self: _M, *args) -> _M: ... def __or__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def __eq__(self, other) -> bool: ... def union(self: _ModelT, *args: _ModelT) -> _ModelT: ...
def __lt__(self, other) -> bool: ... def __eq__(self: _ModelT, other: _ModelT) -> bool: ...
def __le__(self, other) -> bool: ... def __lt__(self: _ModelT, other: _ModelT) -> bool: ...
def __gt__(self, other) -> bool: ... def __le__(self: _ModelT, other: _ModelT) -> bool: ...
def __ge__(self, other) -> bool: ... def __gt__(self: _ModelT, other: _ModelT) -> bool: ...
def __ge__(self: _ModelT, other: _ModelT) -> bool: ...
def __int__(self): ... def __int__(self): ...
def __repr__(self): ... def __repr__(self) -> str: ...
def __hash__(self) -> int: ... def __hash__(self) -> int: ...
def __getitem__(self, key): ... def __getitem__(self, key: str | int | slice): ...
def __setitem__(self, key, value): ... def __setitem__(self, key: str, value): ...
@property @property
def _cache(self): ... def _cache(self) -> RecordCache: ...
def _in_cache_without(self, field, limit=...): ... def _in_cache_without(self: _ModelT, field: Field, limit: int = ...) -> _ModelT: ...
def refresh(self) -> None: ... def refresh(self) -> None: ...
def invalidate_cache(self, fnames: Any | None = ..., ids: Any | None = ...): ... def invalidate_cache(self, fnames: Collection[str] | None = ..., ids: Iterable[int] | None = ...) -> None: ...
def modified(self, fnames, create: bool = ..., before: bool = ...) -> None: ... def invalidate_model(self, fnames: Iterable[str] | None = ..., flush: bool = ...) -> None: ...
def _modified_triggers(self, tree, create: bool = ...): ... def invalidate_recordset(self, fnames: Iterable[str] | None = ..., flush: bool = ...) -> None: ...
def recompute(self, fnames: Any | None = ..., records: Any | None = ...) -> None: ... def _invalidate_cache(self, fnames: Iterable[str] | None = ..., ids: Iterable[int] | None = ...) -> None: ...
def _dependent_fields(self, field): ... def modified(self, fnames: Collection[str], create: bool = ..., before: bool = ...) -> None: ...
def _has_onchange(self, field, other_fields): ... def _modified_triggers(self: _ModelT, tree: dict[Field | None, Any], create: bool = ...) -> Iterator[tuple[Field, _ModelT, bool]]: ...
def _onchange_spec(self, view_info: Any | None = ...): ... def recompute(self, fnames: Collection[str] | None = ..., records: Union[BaseModel, None] = ...) -> None: ...
def _onchange_eval(self, field_name, onchange, result) -> None: ... def _recompute_model(self, fnames: Iterable[str] | None = ...) -> None: ...
def onchange(self, values, field_name, field_onchange): ... def _recompute_recordset(self, fnames: Iterable[str] | None = ...) -> None: ...
def _get_placeholder_filename(self, field): ... def _recompute_field(self, field: Field, ids: Iterable[int] | None = ...) -> None: ...
def _populate_factories(self): ... @classmethod
def _dependent_fields(cls, field: Field) -> Iterator[Field]: ...
def _has_onchange(self, field: Field, other_fields: Container[Field]) -> bool: ...
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 _get_placeholder_filename(self, field: str) -> str | bool: ...
def _populate_factories(self) -> list[tuple[str, Callable[..., Iterator]]]: ...
@property @property
def _populate_sizes(self): ... def _populate_sizes(self) -> dict[str, int]: ...
@property @property
def _populate_dependencies(self): ... def _populate_dependencies(self) -> list[str]: ...
def _populate(self, size): ... def _populate(self: _ModelT, size: str) -> _ModelT: ...
class RecordCache(MutableMapping): class RecordCache(MutableMapping):
__slots__: Any _record: BaseModel
_record: Any def __init__(self, record: BaseModel) -> None: ...
def __init__(self, record) -> None: ... def __contains__(self, name: str) -> bool: ...
def __contains__(self, name): ... def __getitem__(self, name: str) -> Any: ...
def __getitem__(self, name): ... def __setitem__(self, name: str, value: Any) -> None: ...
def __setitem__(self, name, value) -> None: ... def __delitem__(self, name: str) -> None: ...
def __delitem__(self, name) -> None: ... def __iter__(self) -> Iterator[str]: ...
def __iter__(self): ... def __len__(self) -> int: ...
def __len__(self): ...
AbstractModel = BaseModel AbstractModel = BaseModel
class Model(AbstractModel): class Model(AbstractModel):
@@ -338,14 +346,14 @@ class TransientModel(Model):
_abstract: bool _abstract: bool
_transient: bool _transient: bool
def _transient_vacuum(self) -> None: ... def _transient_vacuum(self) -> None: ...
def _transient_clean_old_rows(self, max_count) -> None: ... def _transient_clean_old_rows(self, max_count: int) -> None: ...
def _transient_clean_rows_older_than(self, seconds) -> None: ... def _transient_clean_rows_older_than(self, seconds) -> None: ...
def itemgetter_tuple(items): ... def itemgetter_tuple(items) -> Callable[..., tuple]: ...
def convert_pgerror_not_null(model, fields, info, e): ... 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, fields, info, e): ... def convert_pgerror_unique(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
def convert_pgerror_constraint(model, fields, info, e): ... def convert_pgerror_constraint(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
PGERROR_TO_OE: Any PGERROR_TO_OE: dict[str, Callable]
def lazy_name_get(self): ... def lazy_name_get(self: BaseModel) -> list[tuple[int, str]]: ...

View File

@@ -1,3 +1,26 @@
from . import db as db, graph as graph, loading as loading, migration as migration, module as module, registry as registry from . import (
from odoo.modules.loading import load_modules as load_modules, reset_modules_state as reset_modules_state db as db,
from odoo.modules.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 graph as graph,
loading as loading,
migration as migration,
module as module,
neutralize as neutralize,
registry as registry
)
from .loading import (
load_modules as load_modules,
reset_modules_state as reset_modules_state
)
from .module import (
adapt_version as adapt_version,
check_resource_path as check_resource_path,
get_manifest as get_manifest,
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_openerp_module as load_openerp_module
)

View File

@@ -1,9 +1,15 @@
from typing import Any from enum import IntEnum
_logger: Any from ..sql_db import Cursor
def is_initialized(cr): ... def is_initialized(cr: Cursor) -> bool: ...
def initialize(cr) -> None: ... def initialize(cr: Cursor) -> None: ...
def create_categories(cr, categories): ... def create_categories(cr: Cursor, categories: list[str]) -> int | None: ...
def has_unaccent(cr): ...
def has_trigram(cr): ... class FunctionStatus(IntEnum):
MISSING: int
PRESENT: int
INDEXABLE: int
def has_unaccent(cr: Cursor) -> bool: ...
def has_trigram(cr: Cursor) -> bool: ...

View File

@@ -1,30 +1,34 @@
from typing import Any from typing import Any, Iterable, Iterator
_logger: Any from ..sql_db import Cursor
class Graph(dict): class Graph(dict[str, Node]):
def add_node(self, name, info): ... def add_node(self, name: str, info: dict[str, Any]) -> Node: ...
def update_from_db(self, cr) -> None: ... def update_from_db(self, cr: Cursor) -> None: ...
def add_module(self, cr, module, force: Any | None = ...) -> None: ... def add_module(self, cr: Cursor, module: str, force: list | None = ...) -> None: ...
def add_modules(self, cr, module_list, force: Any | None = ...): ... def add_modules(self, cr: Cursor, module_list: list[str], force: list | None = ...): ...
def __iter__(self): ... def __iter__(self) -> Iterator[Node]: ...
def __str__(self): ... def __str__(self) -> str: ...
class Node: class Node:
def __new__(cls, name, graph, info): ... def __new__(cls, name: str, graph: Graph, info: dict[str, Any]) -> Node: ...
name: Any id: int
graph: Any name: str
info: Any graph: Graph
children: Any info: dict[str, Any]
children: list[Node]
depth: int depth: int
def __init__(self, name, graph, info) -> None: ... dbdemo: bool
state: str
installed_version: str
def __init__(self, name: str, graph: Graph, info: dict[str, Any] | None) -> None: ...
@property @property
def data(self): ... def data(self) -> dict[str, Any]: ...
def add_child(self, name, info): ... def add_child(self, name: str, info: dict[str, Any]): ...
def __setattr__(self, name, value) -> None: ... def __setattr__(self, name: str, value) -> None: ...
def __iter__(self): ... def __iter__(self) -> Iterator[Node]: ...
def __str__(self): ... def __str__(self) -> str: ...
def _pprint(self, depth: int = ...): ... def _pprint(self, depth: int = ...) -> str: ...
def should_have_demo(self): ... def should_have_demo(self) -> bool: ...
@property @property
def parents(self): ... def parents(self) -> Iterable[Node]: ...

View File

@@ -1,13 +1,17 @@
from typing import Any from typing import Any, Iterable
_logger: Any from .graph import Graph, Node
_test_logger: Any from .registry import Registry
from ..sql_db import Cursor
from ..tests.runner import OdooTestResult
def load_data(cr, idref, mode, kind, package): ... def load_data(cr: Cursor, idref: dict, mode: str, kind: str, package: Node) -> bool: ...
def load_demo(cr, package, idref, mode): ... def load_demo(cr: Cursor, package: Node, idref: dict, mode: str) -> bool: ...
def force_demo(cr) -> None: ... def force_demo(cr: Cursor) -> None: ...
def load_module_graph(cr, graph, status: Any | None = ..., perform_checks: bool = ..., skip_modules: Any | None = ..., report: Any | None = ..., models_to_check: Any | None = ...): ... def load_module_graph(cr: Cursor, graph: Graph, status: Any | None = ..., perform_checks: Any = ..., skip_modules: list[str] | None = ...,
def _check_module_names(cr, module_names) -> None: ... report: OdooTestResult | None = ..., models_to_check: set[str] | None = ...) -> tuple[list[str], list[str]]: ...
def load_marked_modules(cr, graph, states, force, progressdict, report, loaded_modules, perform_checks, models_to_check: Any | None = ...): ... def _check_module_names(cr: Cursor, module_names: Iterable[str]) -> None: ...
def load_modules(registry, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...): ... def load_marked_modules(cr: Cursor, graph: Graph, states: list[str], force: list[str], progressdict, report: OdooTestResult,
def reset_modules_state(db_name) -> None: ... 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: ...

View File

@@ -1,13 +1,14 @@
from typing import Any from types import ModuleType
_logger: Any from .graph import Graph, Node
from ..sql_db import Cursor
def load_script(path, module_name): ... def load_script(path: str, module_name: str) -> ModuleType: ...
class MigrationManager: class MigrationManager:
cr: Any cr: Cursor
graph: Any graph: Graph
migrations: Any migrations: dict
def __init__(self, cr, graph) -> None: ... def __init__(self, cr: Cursor, graph: Graph) -> None: ...
def _get_files(self): ... def _get_files(self) -> None: ...
def migrate_module(self, pkg, stage): ... def migrate_module(self, pkg: Node, stage: str) -> None: ...

View File

@@ -1,41 +1,45 @@
from typing import Any from types import ModuleType
from typing import Any, Literal, MutableSequence
MANIFEST_NAMES: Any from ..tools import pycompat as pycompat
README: Any
_logger: Any
def ad_paths(): ... MANIFEST_NAMES: tuple[str, ...]
README: list[str]
_DEFAULT_MANIFEST: dict[str, Any]
loaded: Any def ad_paths() -> MutableSequence[str]: ...
loaded: list
class AddonsHook: class AddonsHook:
def find_module(self, name, path: Any | None = ...): ... def find_module(self, name: str, path: Any | None = ...) -> AddonsHook | None: ...
def load_module(self, name): ... def load_module(self, name: str) -> ModuleType | None: ...
class OdooHook: class OdooHook:
def find_module(self, name, path: Any | None = ...): ... def find_module(self, name: str, path: Any | None = ...) -> OdooHook | None: ...
def load_module(self, name): ... def load_module(self, name: str) -> ModuleType | None: ...
class UpgradeHook: class UpgradeHook:
def find_module(self, name, path: Any | None = ...): ... def find_module(self, name: str, path: Any | None = ...) -> UpgradeHook | None: ...
def load_module(self, name): ... def load_module(self, name: str) -> ModuleType | None: ...
def initialize_sys_path() -> None: ... def initialize_sys_path() -> None: ...
def get_module_path(module, downloaded: bool = ..., display_warning: bool = ...): ... def get_module_path(module: str, downloaded: bool = ..., display_warning: bool = ...) -> str | Literal[False]: ...
def get_module_filetree(module, dir: str = ...): ... def get_module_filetree(module: str, dir: str = ...) -> dict: ...
def get_resource_path(module, *args): ... def get_resource_path(module: str, *args) -> str | Literal[False]: ...
def check_resource_path(mod_path, *args): ... def check_resource_path(mod_path: str, *args) -> str | Literal[False]: ...
get_module_resource = get_resource_path get_module_resource = get_resource_path
def get_resource_from_path(path): ... def get_resource_from_path(path: str) -> tuple[str, str, str] | None: ...
def get_module_icon(module): ... def get_module_icon(module: str) -> str: ...
def module_manifest(path): ... def module_manifest(path: str) -> str | None: ...
def read_manifest(addons_path, module): ... def get_module_root(path: str) -> str | None: ...
def get_module_root(path): ... def load_manifest(module: str, mod_path: str | None = ...) -> dict[str, Any]: ...
def load_information_from_description_file(module, mod_path: Any | None = ...): ... def get_manifest(module: str, mod_path: str | None = ...) -> dict[str, Any]: ...
def load_openerp_module(module_name) -> None: ... def load_information_from_description_file(module: str, mod_path: str | None = ...) -> dict: ...
def get_modules(): ... def load_openerp_module(module_name: str) -> None: ...
def get_modules_with_version(): ... def get_modules() -> list[str]: ...
def adapt_version(version): ... def get_modules_with_version() -> dict[str, Any]: ...
def adapt_version(version: str) -> str: ...
current_test: Any current_test: Any

View File

@@ -0,0 +1,6 @@
from typing import Iterable, Iterator
from ..sql_db import Cursor
def get_installed_modules(cursor: Cursor) -> list[str]: ...
def get_neutralization_queries(modules: Iterable[str]) -> Iterator[str]: ...

View File

@@ -1,89 +1,99 @@
import threading
from collections import defaultdict, deque
from collections.abc import Mapping from collections.abc import Mapping
from typing import Any from threading import RLock
from typing import Any, Callable, ClassVar, Iterable, Iterator
from ..sql_db import Cursor from .graph import Node
from ..models import BaseModel
from ..fields import Field
from ..sql_db import Connection, Cursor
from ..tests.runner import OdooTestResult
from ..tools import Collector, ignore as ignore
from ..tools.lru import LRU
_logger: Any class Registry(Mapping[str, type[BaseModel]]):
_schema: Any _lock: RLock
_saved_lock: RLock | None
class Registry(Mapping): registries: ClassVar[LRU]
_lock: Any def __new__(cls, db_name: str) -> Registry: ...
_saved_lock: Any
def registries(cls): ...
def __new__(cls, db_name): ...
@classmethod @classmethod
def new(cls, db_name, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...): ... def new(cls, db_name: str, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...) -> Registry: ...
models: Any models: dict[str, type[BaseModel]]
_sql_constraints: Any _sql_constraints: set
_init: bool _init: bool
_assertion_report: Any _assertion_report: OdooTestResult
_fields_by_model: Any _fields_by_model: Any
_ordinary_tables: Any _ordinary_tables: set[str] | None
_constraint_queue: Any _constraint_queue: deque
__cache: Any __cache: LRU
_init_modules: Any _init_modules: set[str]
updated_modules: Any updated_modules: list[str]
loaded_xmlids: Any loaded_xmlids: set
db_name: Any db_name: str
_db: Any _db: Connection
test_cr: Any test_cr: Cursor | None
test_lock: Any test_lock: RLock | None
loaded: bool loaded: bool
ready: bool ready: bool
field_depends: Any field_depends: Collector
field_depends_context: Any field_depends_context: Collector
field_inverses: Any field_inverses: Collector
registry_sequence: Any registry_sequence: int | None
cache_sequence: Any cache_sequence: int | None
_invalidation_flags: Any _invalidation_flags: threading.local
has_unaccent: Any has_unaccent: bool
has_trigram: Any has_trigram: bool
def init(self, db_name) -> None: ... def init(self, db_name: str) -> None: ...
@classmethod @classmethod
def delete(cls, db_name) -> None: ... def delete(cls, db_name: str) -> None: ...
@classmethod @classmethod
def delete_all(cls) -> None: ... def delete_all(cls) -> None: ...
def __len__(self): ... def __len__(self) -> int: ...
def __iter__(self): ... def __iter__(self) -> Iterator[str]: ...
def __getitem__(self, model_name): ... def __getitem__(self, model_name: str) -> type[BaseModel]: ...
def __call__(self, model_name): ... def __call__(self, model_name: str) -> type[BaseModel]: ...
def __setitem__(self, model_name, model) -> None: ... def __setitem__(self, model_name: str, model: type[BaseModel]) -> None: ...
def __delitem__(self, model_name) -> None: ... def __delitem__(self, model_name: str) -> None: ...
def descendants(self, model_names, *kinds): ... def descendants(self, model_names: Iterable[str], *kinds) -> set[str]: ...
def load(self, cr, module): ... def load(self, cr: Cursor, module: Node) -> set[str]: ...
_m2m: Any _m2m: defaultdict[Any, list]
def setup_models(self, cr) -> None: ... def setup_models(self, cr: Cursor) -> None: ...
def field_computed(self): ... @property
def field_triggers(self): ... def field_computed(self) -> dict[Field, list[Field]]: ...
def post_init(self, func, *args, **kwargs) -> None: ... @property
def post_constraint(self, func, *args, **kwargs) -> None: ... def field_triggers(self) -> dict[Field, Any]: ...
@property
def fields_modifying_relations(self) -> set[Field]: ...
def post_init(self, func: Callable, *args, **kwargs) -> None: ...
def post_constraint(self, func: Callable, *args, **kwargs) -> None: ...
def finalize_constraints(self) -> None: ... def finalize_constraints(self) -> None: ...
_post_init_queue: Any _post_init_queue: deque
_foreign_keys: Any _foreign_keys: Any
_is_install: Any _is_install: bool
def init_models(self, cr, model_names, context, install: bool = ...) -> None: ... def init_models(self, cr: Cursor, model_names: Iterable[str], context: dict, install: bool = ...) -> None: ...
def check_indexes(self, cr, model_names) -> 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) -> None: ... def check_foreign_keys(self, cr: Cursor) -> None: ...
def check_tables_exist(self, cr) -> None: ... def check_tables_exist(self, cr: Cursor) -> None: ...
def _clear_cache(self) -> None: ... def _clear_cache(self) -> None: ...
def clear_caches(self) -> None: ... def clear_caches(self) -> None: ...
def is_an_ordinary_table(self, model): ... def is_an_ordinary_table(self, model: BaseModel) -> bool: ...
@property @property
def registry_invalidated(self): ... def registry_invalidated(self) -> bool: ...
@registry_invalidated.setter @registry_invalidated.setter
def registry_invalidated(self, value) -> None: ... def registry_invalidated(self, value: bool) -> None: ...
@property @property
def cache_invalidated(self): ... def cache_invalidated(self) -> bool: ...
@cache_invalidated.setter @cache_invalidated.setter
def cache_invalidated(self, value) -> None: ... def cache_invalidated(self, value: bool) -> None: ...
def setup_signaling(self) -> None: ... def setup_signaling(self) -> None: ...
def check_signaling(self): ... def check_signaling(self) -> Registry: ...
def signal_changes(self) -> None: ... def signal_changes(self) -> None: ...
def reset_changes(self) -> None: ... def reset_changes(self) -> None: ...
def manage_changes(self) -> None: ... def manage_changes(self) -> None: ...
def in_test_mode(self): ... def in_test_mode(self) -> bool: ...
def enter_test_mode(self, cr) -> None: ... def enter_test_mode(self, cr: Cursor) -> None: ...
def leave_test_mode(self) -> None: ... def leave_test_mode(self) -> None: ...
def cursor(self) -> Cursor: ... def cursor(self) -> Cursor: ...

View File

@@ -1,50 +1,50 @@
import logging.handlers import logging.handlers
from typing import Any import warnings
from logging import Logger, LogRecord
from typing import TextIO
_logger: Any def log(logger: Logger, level: int, prefix: str, msg, depth: int | None = ...) -> None: ...
def log(logger, level, prefix, msg, depth: Any | None = ...) -> None: ...
class PostgreSQLHandler(logging.Handler): class PostgreSQLHandler(logging.Handler):
def emit(self, record) -> None: ... def emit(self, record: LogRecord) -> None: ...
BLACK: Any BLACK: int
RED: Any RED: int
GREEN: Any GREEN: int
YELLOW: Any YELLOW: int
BLUE: Any BLUE: int
MAGENTA: Any MAGENTA: int
CYAN: Any CYAN: int
WHITE: Any WHITE: int
_NOTHING: Any _NOTHING: int
DEFAULT: Any DEFAULT: int
RESET_SEQ: str RESET_SEQ: str
COLOR_SEQ: str COLOR_SEQ: str
BOLD_SEQ: str BOLD_SEQ: str
COLOR_PATTERN: Any COLOR_PATTERN: str
LEVEL_COLOR_MAPPING: Any LEVEL_COLOR_MAPPING: dict[int, tuple[int, int]]
class PerfFilter(logging.Filter): class PerfFilter(logging.Filter):
def format_perf(self, query_count, query_time, remaining_time): ... def format_perf(self, query_count: int, query_time: float, remaining_time: float): ...
def filter(self, record): ... def filter(self, record: LogRecord): ...
class ColoredPerfFilter(PerfFilter): class ColoredPerfFilter(PerfFilter):
def format_perf(self, query_count, query_time, remaining_time): ... def format_perf(self, query_count: int, query_time: float, remaining_time: float): ...
class DBFormatter(logging.Formatter): class DBFormatter(logging.Formatter):
def format(self, record): ... def format(self, record: LogRecord): ...
class ColoredFormatter(DBFormatter): class ColoredFormatter(DBFormatter):
def format(self, record): ... def format(self, record: LogRecord): ...
_logger_init: bool _logger_init: bool
def init_logger(): ... def init_logger(): ...
DEFAULT_LOG_CONFIGURATION: Any DEFAULT_LOG_CONFIGURATION: list[str]
PSEUDOCONFIG_MAPPER: Any PSEUDOCONFIG_MAPPER: dict[str, list[str]]
showwarning: Any showwarning = warnings.showwarning
IGNORE: Any IGNORE: set[str]
def showwarning_with_traceback(message, category, filename, lineno, file: Any | None = ..., line: Any | 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: ... def runbot(self, message, *args, **kws) -> None: ...

View File

@@ -1,44 +1,51 @@
from ..models import MAGIC_COLUMNS as MAGIC_COLUMNS from typing import Any, Callable
from functools import partial as partial
from odoo.tools.misc import get_lang as get_lang from ..fields import Field
from typing import Any from ..models import BaseModel, MAGIC_COLUMNS as MAGIC_COLUMNS
from ..sql_db import Cursor
from ..tools.query import Query
_Domain = list
NOT_OPERATOR: str NOT_OPERATOR: str
OR_OPERATOR: str OR_OPERATOR: str
AND_OPERATOR: str AND_OPERATOR: str
DOMAIN_OPERATORS: Any DOMAIN_OPERATORS: tuple[str, ...]
TERM_OPERATORS: Any TERM_OPERATORS: tuple[str, ...]
NEGATIVE_TERM_OPERATORS: Any NEGATIVE_TERM_OPERATORS: tuple[str, ...]
DOMAIN_OPERATORS_NEGATION: Any DOMAIN_OPERATORS_NEGATION: dict[str, str]
TERM_OPERATORS_NEGATION: Any TERM_OPERATORS_NEGATION: dict[str, str]
TRUE_LEAF: Any TRUE_LEAF: tuple
FALSE_LEAF: Any FALSE_LEAF: tuple
TRUE_DOMAIN: Any TRUE_DOMAIN: list[tuple]
FALSE_DOMAIN: Any FALSE_DOMAIN: list[tuple]
_logger: Any
def normalize_domain(domain): ... def normalize_domain(domain: _Domain) -> _Domain: ...
def is_false(model, domain): ... def is_false(model, domain: _Domain) -> bool: ...
def combine(operator, unit, zero, domains): ... def combine(operator: str, unit, zero, domains: list[_Domain]) -> _Domain: ...
def AND(domains): ... def AND(domains: list[_Domain]) -> _Domain: ...
def OR(domains): ... def OR(domains: list[_Domain]) -> _Domain: ...
def distribute_not(domain): ... def distribute_not(domain: _Domain) -> _Domain: ...
def _quote(to_quote): ... def _quote(to_quote: str) -> str: ...
def normalize_leaf(element): ... def normalize_leaf(element): ...
def is_operator(element): ... def is_operator(element) -> bool: ...
def is_leaf(element, internal: bool = ...): ... def is_leaf(element, internal: bool = ...) -> bool: ...
def is_boolean(element): ... def is_boolean(element) -> bool: ...
def check_leaf(element, internal: bool = ...) -> None: ... def check_leaf(element, internal: bool = ...) -> None: ...
def get_unaccent_wrapper(cr): ... def _unaccent_wrapper(x) -> str: ...
def get_unaccent_wrapper(cr: Cursor) -> Callable[[Any], str]: ...
class expression: class expression:
_unaccent: Any _unaccent_wrapper: Callable[[Any], str]
root_model: Any _has_trigram: bool
root_alias: Any root_model: BaseModel
expression: Any root_alias: str | None
query: Any expression: _Domain
def __init__(self, domain, model, alias: Any | None = ..., query: Any | None = ...) -> None: ... query: Query | None
def get_tables(self): ... result: tuple[str, list]
def __init__(self, domain: _Domain, model: BaseModel, alias: str | None = ..., query: Query | None = ...) -> None: ...
def _unaccent(self, field: Field) -> Callable[[Any], str]: ...
def get_tables(self) -> tuple[str, ...]: ...
def parse(self): ... def parse(self): ...
def __leaf_to_sql(self, leaf, model, alias): ... def __leaf_to_sql(self, leaf, model: BaseModel, alias: str) -> tuple[str, list]: ...
def to_sql(self): ... def to_sql(self) -> tuple[str, list]: ...

View File

@@ -1,37 +0,0 @@
from typing import Any
IDENT_RE: Any
def _from_table(table, alias): ...
def _generate_table_alias(src_table_alias, link): ...
class Query:
_cr: Any
_tables: Any
_joins: Any
_where_clauses: Any
_where_params: Any
order: Any
limit: Any
offset: Any
def __init__(self, cr, alias, table: Any | None = ...) -> None: ...
def add_table(self, alias, table: Any | None = ...) -> None: ...
def add_where(self, where_clause, where_params=...) -> None: ...
def join(self, lhs_alias, lhs_column, rhs_table, rhs_column, link, extra: Any | None = ..., extra_params=...): ...
def left_join(self, lhs_alias, lhs_column, rhs_table, rhs_column, link, extra: Any | None = ..., extra_params=...): ...
def _join(self, kind, lhs_alias, lhs_column, rhs_table, rhs_column, link, extra: Any | None = ..., extra_params=...): ...
def select(self, *args): ...
def subselect(self, *args): ...
def get_sql(self): ...
def _result(self): ...
def __str__(self): ...
def __bool__(self): ...
def __len__(self): ...
def __iter__(self): ...
@property
def tables(self): ...
@property
def where_clause(self): ...
@property
def where_clause_params(self): ...
def add_join(self, connection, implicit: bool = ..., outer: bool = ..., extra: Any | None = ..., extra_params=...): ...

View File

@@ -1,16 +1,14 @@
from typing import Any RELEASE_LEVELS: list[str]
ALPHA: str
RELEASE_LEVELS: Any BETA: str
ALPHA: Any RELEASE_CANDIDATE: str
BETA: Any FINAL: str
RELEASE_CANDIDATE: Any RELEASE_LEVELS_DISPLAY: dict[str, str]
FINAL: Any version_info: tuple
RELEASE_LEVELS_DISPLAY: Any version: str
version_info: Any series: str
version: Any serie: str
series: Any major_version: str
serie: Any
major_version: Any
product_name: str product_name: str
description: str description: str
long_desc: str long_desc: str
@@ -19,4 +17,4 @@ url: str
author: str author: str
author_email: str author_email: str
license: str license: str
nt_service_name: Any nt_service_name: str

View File

@@ -1 +1,7 @@
from . import common as common, db as db, model as model, server as server, wsgi_server as wsgi_server from typing import Any, Callable
from . import server as server
_dispatchers: dict[str, Callable[[str, Any], Any]]
def dispatch_rpc(service_name: str, method: str, params): ...

View File

@@ -1,11 +1,11 @@
from typing import Any from logging import Logger
from typing import Any, Literal
_logger: Any RPC_VERSION_1: dict[str, Any]
RPC_VERSION_1: Any
def exp_login(db, login, password): ... def exp_login(db: str, login: str, password: str) -> int: ...
def exp_authenticate(db, login, password, user_agent_env): ... def exp_authenticate(db: str, login: str, password: str, user_agent_env: dict | None) -> int: ...
def exp_version(): ... def exp_version() -> dict[str, Any]: ...
def exp_about(extended: bool = ...): ... def exp_about(extended: bool = ...) -> str | tuple[str, str]: ...
def exp_set_loglevel(loglevel, logger: Any | None = ...): ... def exp_set_loglevel(loglevel, logger: Logger | None = ...) -> Literal[True]: ...
def dispatch(method, params): ... def dispatch(method: str, params): ...

View File

@@ -1,31 +1,35 @@
from functools import wraps as wraps from functools import wraps as wraps
from typing import Any from typing import Any, Callable, IO, Iterable, Literal, TypeVar
_logger: Any from ..sql_db import Cursor
_CallableT = TypeVar('_CallableT', bound=Callable)
class DatabaseExists(Warning): ... class DatabaseExists(Warning): ...
def check_db_management_enabled(method): ... def check_db_management_enabled(method: _CallableT) -> _CallableT: ...
def check_super(passwd): ... def check_super(passwd: str) -> Literal[True]: ...
def _initialize_db(id, db_name, demo, lang, user_password, login: str = ..., country_code: Any | None = ..., phone: Any | None = ...) -> None: ... def _initialize_db(id, db_name: str, demo: bool, lang: str, user_password: str, login: str = ...,
def _create_empty_database(name) -> None: ... country_code: str | None = ..., phone: str | None = ...) -> None: ...
def exp_create_database(db_name, demo, lang, user_password: str = ..., login: str = ..., country_code: Any | None = ..., phone: Any | None = ...): ... def _create_empty_database(name: str) -> None: ...
def exp_duplicate_database(db_original_name, db_name): ... def exp_create_database(db_name: str, demo: bool, lang: str, user_password: str = ..., login: str = ...,
def _drop_conn(cr, db_name) -> None: ... country_code: str | None = ..., phone: str | None = ...) -> Literal[True]: ...
def exp_drop(db_name): ... def exp_duplicate_database(db_original_name: str, db_name: str) -> Literal[True]: ...
def exp_dump(db_name, format): ... def _drop_conn(cr: Cursor, db_name: str) -> None: ...
def dump_db_manifest(cr): ... def exp_drop(db_name: str) -> bool: ...
def dump_db(db_name, stream, backup_format: str = ...): ... def exp_dump(db_name: str, format: str) -> str: ...
def exp_restore(db_name, data, copy: bool = ...): ... def dump_db_manifest(cr: Cursor) -> dict[str, Any]: ...
def restore_db(db, dump_file, copy: bool = ...) -> None: ... def dump_db(db_name: str, stream, backup_format: str = ...) -> IO | None: ...
def exp_rename(old_name, new_name): ... def exp_restore(db_name: str, data, copy: bool = ...) -> Literal[True]: ...
def exp_change_admin_password(new_password): ... def restore_db(db: str, dump_file: str, copy: bool = ...) -> None: ...
def exp_migrate_databases(databases): ... def exp_rename(old_name: str, new_name: str) -> Literal[True]: ...
def exp_db_exist(db_name): ... def exp_change_admin_password(new_password: str) -> Literal[True]: ...
def list_dbs(force: bool = ...): ... def exp_migrate_databases(databases: Iterable[str]) -> Literal[True]: ...
def list_db_incompatible(databases): ... def exp_db_exist(db_name: str) -> bool: ...
def exp_list(document: bool = ...): ... def list_dbs(force: bool = ...) -> list[str]: ...
def exp_list_lang(): ... def list_db_incompatible(databases: Iterable[str]) -> list[str]: ...
def exp_list_countries(): ... def exp_list(document: bool = ...) -> list[str]: ...
def exp_server_version(): ... def exp_list_lang() -> list[tuple[str, str]]: ...
def dispatch(method, params): ... def exp_list_countries() -> list[tuple[str, str]]: ...
def exp_server_version() -> str: ...
def dispatch(method: str, params): ...

View File

@@ -1,11 +1,20 @@
from typing import Any from typing import Any, Callable, Iterator, TypeVar
_logger: Any from psycopg2 import IntegrityError
PG_CONCURRENCY_ERRORS_TO_RETRY: Any
from ..api import Environment
from ..exceptions import ValidationError
from ..sql_db import Cursor
PG_CONCURRENCY_ERRORS_TO_RETRY: tuple[str, str, str]
MAX_TRIES_ON_CONCURRENCY_FAILURE: int MAX_TRIES_ON_CONCURRENCY_FAILURE: int
def dispatch(method, params): ... _CallableT = TypeVar('_CallableT', bound=Callable)
def check(f): ...
def execute_cr(cr, uid, obj, method, *args, **kw): ... def dispatch(method: str, params): ...
def execute_kw(db, uid, obj, method, args, kw: Any | None = ...): ... def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...
def execute(db, uid, obj, method, *args, **kw): ... 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): ...
def _as_validation_error(env: Environment, exc: IntegrityError) -> ValidationError: ...
def retrying(func: Callable[[], Any], env: Environment): ...
def _traverse_containers(val, type_) -> Iterator: ...

View File

@@ -1,3 +1,8 @@
def check(db, uid, passwd): ... from typing import Literal
def compute_session_token(session, env): ...
def check_session(session, env): ... from ..api import Environment
from ..http import Session
def check(db: str, uid: int, passwd: str) -> None: ...
def compute_session_token(session: Session, env: Environment) -> str | Literal[False]: ...
def check_session(session: Session, env: Environment) -> bool: ...

View File

@@ -1,15 +1,27 @@
import werkzeug.serving from socket import socket as socket_
from ..tests import runner as runner from threading import Semaphore, Thread
from gevent.pywsgi import WSGIServer
from itertools import chain as chain from itertools import chain as chain
from typing import Any from typing import Any, Callable, Iterable, Literal, TypeVar
import werkzeug.serving
from inotify.adapters import InotifyTrees
from psutil import Process
from watchdog.observers import Observer
from ..modules.registry import Registry
from ..sql_db import Cursor
from ..tests import runner as runner
_WorkerT = TypeVar('_WorkerT', bound=Worker)
INOTIFY_LISTEN_EVENTS: Any INOTIFY_LISTEN_EVENTS: Any
_logger: Any
SLEEP_INTERVAL: int SLEEP_INTERVAL: int
def memory_info(process): ... def memory_info(process: Process): ...
def set_limit_memory_hard() -> None: ... def set_limit_memory_hard() -> None: ...
def empty_pipe(fd) -> None: ... def empty_pipe(fd: int) -> None: ...
class LoggingBaseWSGIServerMixIn: class LoggingBaseWSGIServerMixIn:
def handle_error(self, request, client_address) -> None: ... def handle_error(self, request, client_address) -> None: ...
@@ -19,16 +31,17 @@ class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGI
def server_activate(self) -> None: ... def server_activate(self) -> None: ...
class RequestHandler(werkzeug.serving.WSGIRequestHandler): class RequestHandler(werkzeug.serving.WSGIRequestHandler):
timeout: int
def setup(self) -> None: ... def setup(self) -> None: ...
protocol_version: str
def make_environ(self) -> dict[str, Any]: ...
class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer): class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer):
max_http_threads: Any max_http_threads: Any
http_threads_sem: Any http_threads_sem: Semaphore
daemon_threads: bool daemon_threads: bool
def __init__(self, host, port, app) -> None: ... def __init__(self, host: str, port: int, app) -> None: ...
reload_socket: bool reload_socket: bool
socket: Any socket: socket_
def server_bind(self) -> None: ... def server_bind(self) -> None: ...
def server_activate(self) -> None: ... def server_activate(self) -> None: ...
def process_request(self, request, client_address) -> None: ... def process_request(self, request, client_address) -> None: ...
@@ -36,10 +49,10 @@ class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.
def shutdown_request(self, request) -> None: ... def shutdown_request(self, request) -> None: ...
class FSWatcherBase: class FSWatcherBase:
def handle_file(self, path): ... def handle_file(self, path: str) -> Literal[True]: ...
class FSWatcherWatchdog(FSWatcherBase): class FSWatcherWatchdog(FSWatcherBase):
observer: Any observer: Observer
def __init__(self) -> None: ... def __init__(self) -> None: ...
def dispatch(self, event) -> None: ... def dispatch(self, event) -> None: ...
def start(self) -> None: ... def start(self) -> None: ...
@@ -47,36 +60,37 @@ class FSWatcherWatchdog(FSWatcherBase):
class FSWatcherInotify(FSWatcherBase): class FSWatcherInotify(FSWatcherBase):
started: bool started: bool
watcher: Any watcher: InotifyTrees
def __init__(self) -> None: ... def __init__(self) -> None: ...
def run(self) -> None: ... def run(self) -> None: ...
thread: Any thread: Thread
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
class CommonServer: class CommonServer:
app: Any app: Any
_on_stop_funcs: Any _on_stop_funcs: list[Callable]
interface: Any interface: str
port: Any port: int
pid: Any pid: int
def __init__(self, app) -> None: ... def __init__(self, app) -> None: ...
def close_socket(self, sock) -> None: ... def close_socket(self, sock: socket_) -> None: ...
def on_stop(self, func) -> None: ... @classmethod
def on_stop(cls, func: Callable) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
class ThreadedServer(CommonServer): class ThreadedServer(CommonServer):
main_thread_id: Any main_thread_id: int | None
quit_signals_received: int quit_signals_received: int
httpd: Any httpd: ThreadedWSGIServerReloadable | None
limits_reached_threads: Any limits_reached_threads: set[Thread]
limit_reached_time: Any limit_reached_time: float | None
def __init__(self, app) -> None: ... def __init__(self, app) -> None: ...
def signal_handler(self, sig, frame) -> None: ... def signal_handler(self, sig, frame) -> None: ...
def process_limit(self) -> None: ... def process_limit(self) -> None: ...
def cron_thread(self, number) -> None: ... def cron_thread(self, number) -> None: ...
def cron_spawn(self) -> None: ... def cron_spawn(self) -> None: ...
def http_thread(self): ... def http_thread(self) -> None: ...
def http_spawn(self) -> None: ... def http_spawn(self) -> None: ...
def start(self, stop: bool = ...): ... def start(self, stop: bool = ...): ...
def stop(self) -> None: ... def stop(self) -> None: ...
@@ -84,63 +98,64 @@ class ThreadedServer(CommonServer):
def reload(self) -> None: ... def reload(self) -> None: ...
class GeventServer(CommonServer): class GeventServer(CommonServer):
port: Any port: int
httpd: Any httpd: WSGIServer | None
def __init__(self, app) -> None: ... def __init__(self, app) -> None: ...
def process_limits(self) -> None: ... def process_limits(self) -> None: ...
ppid: Any ppid: int
def watchdog(self, beat: int = ...) -> None: ... def watchdog(self, beat: int = ...) -> None: ...
client_address: Any client_address: Any
response_use_chunked: bool
def start(self): ... def start(self): ...
def stop(self) -> None: ... def stop(self) -> None: ...
def run(self, preload, stop) -> None: ... def run(self, preload, stop: bool) -> None: ...
class PreforkServer(CommonServer): class PreforkServer(CommonServer):
population: Any population: int
timeout: Any timeout: int
limit_request: Any limit_request: int
cron_timeout: Any cron_timeout: int
beat: int beat: int
socket: Any socket: socket_ | None
workers_http: Any workers_http: dict[int, WorkerHTTP]
workers_cron: Any workers_cron: dict[int, WorkerCron]
workers: Any workers: dict[int, Worker]
generation: int generation: int
queue: Any queue: list
long_polling_pid: Any long_polling_pid: int | None
def __init__(self, app) -> None: ... def __init__(self, app) -> None: ...
def pipe_new(self): ... def pipe_new(self) -> tuple[int, int]: ...
def pipe_ping(self, pipe) -> None: ... def pipe_ping(self, pipe: tuple[int, int]) -> None: ...
def signal_handler(self, sig, frame) -> None: ... def signal_handler(self, sig: int, frame) -> None: ...
def worker_spawn(self, klass, workers_registry): ... def worker_spawn(self, klass: Callable[..., _WorkerT], workers_registry: dict[int, _WorkerT]) -> _WorkerT | None: ...
def long_polling_spawn(self) -> None: ... def long_polling_spawn(self) -> None: ...
def worker_pop(self, pid) -> None: ... def worker_pop(self, pid: int) -> None: ...
def worker_kill(self, pid, sig) -> None: ... def worker_kill(self, pid: int, sig: int) -> None: ...
def process_signals(self) -> None: ... def process_signals(self) -> None: ...
def process_zombie(self) -> None: ... def process_zombie(self) -> None: ...
def process_timeout(self) -> None: ... def process_timeout(self) -> None: ...
def process_spawn(self) -> None: ... def process_spawn(self) -> None: ...
def sleep(self) -> None: ... def sleep(self) -> None: ...
pipe: Any pipe: tuple[int, int]
def start(self) -> None: ... def start(self) -> None: ...
def stop(self, graceful: bool = ...) -> None: ... def stop(self, graceful: bool = ...) -> None: ...
def run(self, preload, stop): ... def run(self, preload, stop: bool): ...
class Worker: class Worker:
multi: Any multi: PreforkServer
watchdog_time: Any watchdog_time: float
watchdog_pipe: Any watchdog_pipe: tuple[int, int]
eintr_pipe: Any eintr_pipe: tuple[int, int]
watchdog_timeout: Any watchdog_timeout: Any
ppid: Any ppid: int
pid: Any pid: int | None
alive: bool alive: bool
request_max: Any request_max: Any
request_count: int request_count: int
def __init__(self, multi) -> None: ... def __init__(self, multi: PreforkServer) -> None: ...
def setproctitle(self, title: str = ...) -> None: ... def setproctitle(self, title: str = ...) -> None: ...
def close(self) -> None: ... def close(self) -> None: ...
def signal_handler(self, sig, frame) -> None: ... def signal_handler(self, sig: int, frame) -> None: ...
def signal_time_expired_handler(self, n, stack) -> None: ... def signal_time_expired_handler(self, n, stack) -> None: ...
def sleep(self) -> None: ... def sleep(self) -> None: ...
def check_limits(self) -> None: ... def check_limits(self) -> None: ...
@@ -151,29 +166,29 @@ class Worker:
def _runloop(self) -> None: ... def _runloop(self) -> None: ...
class WorkerHTTP(Worker): class WorkerHTTP(Worker):
sock_timeout: Any sock_timeout: float
def __init__(self, multi) -> None: ... def __init__(self, multi: PreforkServer) -> None: ...
def process_request(self, client, addr) -> None: ... def process_request(self, client: socket_, addr) -> None: ...
def process_work(self) -> None: ... def process_work(self) -> None: ...
server: Any server: BaseWSGIServerNoBind
def start(self) -> None: ... def start(self) -> None: ...
class WorkerCron(Worker): class WorkerCron(Worker):
db_index: int db_index: int
watchdog_timeout: Any watchdog_timeout: int
def __init__(self, multi) -> None: ... def __init__(self, multi: PreforkServer) -> None: ...
def sleep(self) -> None: ... def sleep(self) -> None: ...
def _db_list(self): ... def _db_list(self): ...
def process_work(self) -> None: ... def process_work(self) -> None: ...
dbcursor: Any dbcursor: Cursor
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
server: Any server: CommonServer | None
def load_server_wide_modules() -> None: ... def load_server_wide_modules() -> None: ...
def _reexec(updated_modules: Any | None = ...) -> None: ... def _reexec(updated_modules: Iterable[str] | None = ...) -> None: ...
def load_test_file_py(registry, test_file) -> None: ... def load_test_file_py(registry: Registry, test_file: str) -> None: ...
def preload_registries(dbnames): ... def preload_registries(dbnames: list[str] | None): ...
def start(preload: Any | None = ..., stop: bool = ...): ... def start(preload: list[str] | None = ..., stop: bool = ...): ...
def restart() -> None: ... def restart() -> None: ...

View File

@@ -1,16 +0,0 @@
from typing import Any
_logger: Any
RPC_FAULT_CODE_CLIENT_ERROR: int
RPC_FAULT_CODE_APPLICATION_ERROR: int
RPC_FAULT_CODE_WARNING: int
RPC_FAULT_CODE_ACCESS_DENIED: int
RPC_FAULT_CODE_ACCESS_ERROR: int
def xmlrpc_handle_exception_int(e): ...
def xmlrpc_handle_exception_string(e): ...
def application_unproxied(environ, start_response): ...
ProxyFix: Any
def application(environ, start_response): ...

View File

@@ -1,118 +1,135 @@
from typing import Any, TypeVar from datetime import datetime
from re import Pattern
from threading import Lock, RLock
from typing import Any, Generator, Iterable, Iterator, Literal, NoReturn, Sequence, TypeVar
import psycopg2.extensions import psycopg2.extensions
from psycopg2.sql import Identifier
from .api import Transaction from .api import Transaction
from .tools import Callbacks from .tools import Callbacks
_T = TypeVar('_T') _T = TypeVar('_T')
_CursorT = TypeVar('_CursorT', bound=Cursor)
_SavepointT = TypeVar('_SavepointT', bound=Savepoint)
_logger: Any def undecimalize(symb, cr: Cursor) -> float | None: ...
def unbuffer(symb, cr): ... re_from: Pattern
def undecimalize(symb, cr): ... re_into: Pattern
def adapt_string(adapted): ...
def flush_env(cr, *, clear: bool = ...) -> None: ...
def clear_env(cr) -> None: ...
re_from: Any
re_into: Any
sql_counter: int sql_counter: int
def check(f, self, *args, **kwargs): ... class Savepoint:
name: str
_name: Identifier
_cr: BaseCursor
closed: bool
def __init__(self, cr: BaseCursor) -> None: ...
def __enter__(self: _SavepointT) -> _SavepointT: ...
def __exit__(self, exc_type, exc_val, exc_tb) -> None: ...
def close(self, *, rollback: bool = ...) -> None: ...
def rollback(self) -> None: ...
def _close(self, rollback: bool) -> None: ...
class _FlushingSavepoint(Savepoint):
def __init__(self, cr: BaseCursor) -> None: ...
def rollback(self) -> None: ...
def _close(self, rollback: bool) -> None: ...
class BaseCursor: class BaseCursor:
precommit: Callbacks precommit: Callbacks
postcommit: Callbacks postcommit: Callbacks
prerollback: Callbacks prerollback: Callbacks
postrollback: Callbacks postrollback: Callbacks
transaction: Transaction transaction: Transaction | None
def __init__(self) -> None: ... def __init__(self) -> None: ...
def execute(self, query, *args, **kwargs): ...
def commit(self): ...
def rollback(self): ...
def close(self): ...
def flush(self) -> None: ... def flush(self) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def reset(self) -> None: ... def reset(self) -> None: ...
def savepoint(self, flush: bool = ...) -> None: ... def savepoint(self, flush: bool = ...) -> Savepoint: ...
def __enter__(self: _T) -> _T: ... def __enter__(self: _CursorT) -> _CursorT: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ... def __exit__(self, exc_type, exc_value, traceback) -> None: ...
class Cursor(BaseCursor): class Cursor(BaseCursor):
IN_MAX: int IN_MAX: int
sql_from_log: Any sql_from_log: dict
sql_into_log: Any sql_into_log: dict
sql_log: Any
sql_log_count: int sql_log_count: int
_closed: bool _closed: bool
__pool: Any __pool: ConnectionPool
dbname: Any dbname: str
_serialized: Any _cnx: PsycoConnection
_cnx: Any _obj: psycopg2.extensions.cursor
_obj: Any __caller: tuple[str, int | str] | Literal[False]
__caller: Any cache: dict
_default_log_exceptions: bool _now: datetime | None
cache: Any def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict, **kwargs) -> None: ...
_now: Any def __build_dict(self, row: Sequence) -> dict[str, Any]: ...
def __init__(self, pool, dbname, dsn, serialized: bool = ...) -> None: ... def dictfetchone(self) -> dict[str, Any] | None: ...
def __build_dict(self, row): ... def dictfetchmany(self, size) -> list[dict[str, Any]]: ...
def dictfetchone(self): ... def dictfetchall(self) -> list[dict[str, Any]]: ...
def dictfetchmany(self, size): ...
def dictfetchall(self): ...
def __del__(self) -> None: ... def __del__(self) -> None: ...
def _format(self, query, params: Any | None = ...): ... def _format(self, query, params: Any | None = ...): ...
def execute(self, query, params: Any | None = ..., log_exceptions: Any | None = ...): ... def execute(self, query, params: Any | None = ..., log_exceptions: bool = ...): ...
def split_for_in_conditions(self, ids, size: Any | None = ...): ... def split_for_in_conditions(self, ids: Iterable, size: int | None = ...) -> Iterator[tuple]: ...
def print_log(self): ... def print_log(self): ...
def _enable_logging(self) -> Generator[None, None, None]: ...
def close(self): ... def close(self): ...
def _close(self, leak: bool = ...) -> None: ... def _close(self, leak: bool = ...) -> None: ...
def autocommit(self, on) -> None: ... def autocommit(self, on: bool) -> None: ...
def after(self, event, func) -> None: ...
def commit(self): ... def commit(self): ...
def rollback(self): ... def rollback(self): ...
def __getattr__(self, name): ... def __getattr__(self, name: str): ...
@property @property
def closed(self): ... def closed(self) -> bool: ...
def now(self): ... def now(self) -> datetime: ...
class TestCursor(BaseCursor): class TestCursor(BaseCursor):
_savepoint_seq: Any _cursors_stack: list[TestCursor]
_now: datetime | None
_closed: bool _closed: bool
_cursor: Any _cursor: Cursor
_lock: Any _lock: RLock
_savepoint: Any _savepoint: Savepoint | None
def __init__(self, cursor, lock) -> None: ... def __init__(self, cursor: Cursor, lock: RLock) -> None: ...
def execute(self, *args, **kwargs): ...
def close(self) -> None: ... def close(self) -> None: ...
def autocommit(self, on) -> None: ... def autocommit(self, on: bool) -> None: ...
def commit(self) -> None: ... def commit(self) -> None: ...
def rollback(self) -> None: ... def rollback(self) -> None: ...
def __getattr__(self, name): ... def __getattr__(self, name: str): ...
def now(self) -> datetime: ...
class PsycoConnection(psycopg2.extensions.connection): ... class PsycoConnection(psycopg2.extensions.connection): ...
class ConnectionPool: class ConnectionPool:
def locked(fun): ... _connections: list[tuple[psycopg2.extensions.connection, bool]]
_connections: Any _maxconn: int
_maxconn: Any _lock: Lock
_lock: Any
def __init__(self, maxconn: int = ...) -> None: ... def __init__(self, maxconn: int = ...) -> None: ...
def __repr__(self): ... def __repr__(self) -> str: ...
def _debug(self, msg, *args) -> None: ... def _debug(self, msg, *args) -> None: ...
def borrow(self, connection_info): ... def borrow(self, connection_info: dict) -> PsycoConnection: ...
def give_back(self, connection, keep_in_pool: bool = ...) -> None: ... def give_back(self, connection: PsycoConnection, keep_in_pool: bool = ...) -> None: ...
def close_all(self, dsn: Any | None = ...) -> None: ... def close_all(self, dsn: dict | None = ...) -> None: ...
class Connection: class Connection:
dbname: Any dbname: str
dsn: Any dsn: dict
__pool: Any __pool: ConnectionPool
def __init__(self, pool, dbname, dsn) -> None: ... def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict) -> None: ...
def cursor(self, serialized: bool = ...): ... def cursor(self, **kwargs) -> Cursor: ...
serialized_cursor: Any def serialized_cursor(self, **kwargs) -> Cursor: ...
def __bool__(self) -> None: ... def __bool__(self) -> NoReturn: ...
__nonzero__: Any
def connection_info_for(db_or_uri): ... def connection_info_for(db_or_uri: str) -> tuple[str, dict]: ...
_Pool: Any _Pool: ConnectionPool | None
def db_connect(to, allow_uri: bool = ...): ... def db_connect(to: str, allow_uri: bool = ...) -> Connection: ...
def close_db(db_name) -> None: ... def close_db(db_name: str) -> None: ...
def close_all() -> None: ... def close_all() -> None: ...

View File

@@ -1,55 +1,82 @@
import collections import collections
import logging import logging
import sys
import unittest import unittest
from typing import Any from concurrent.futures import Future
from re import Pattern
from itertools import count
from subprocess import Popen
from threading import Thread
from typing import Any, Callable, Generator, Generic, Iterator, Mapping, Match, TypeVar
from unittest import TestSuite
from xmlrpc import client as xmlrpclib from xmlrpc import client as xmlrpclib
import requests import requests
from lxml.etree import _Element
from websocket import WebSocket
from .runner import OdooTestResult
from ..api import Environment from ..api import Environment
from ..http import Session
from ..models import BaseModel
from ..modules.registry import Registry from ..modules.registry import Registry
from ..sql_db import BaseCursor, Cursor from ..sql_db import BaseCursor, Cursor
from ..tools import profiler
from ..tools._vendor.sessions import Session
from ..tools.profiler import Profiler
_logger: Any _T = TypeVar('_T')
ADDONS_PATH: Any _CallableT = TypeVar('_CallableT', bound=Callable)
_ModelT = TypeVar('_ModelT', bound=BaseModel)
_FormT = TypeVar('_FormT', bound=Form)
InvalidStateError = Any
ADDONS_PATH: str
HOST: str HOST: str
ADMIN_USER_ID: Any ADMIN_USER_ID: int
CHECK_BROWSER_SLEEP: float
CHECK_BROWSER_ITERATIONS: int
BROWSER_WAIT: float
def get_db_name(): ... def get_db_name() -> str: ...
standalone_tests: Any standalone_tests: collections.defaultdict[str, list]
def standalone(*tags): ... def standalone(*tags: str) -> Callable[[_CallableT], _CallableT]: ...
DB: Any DB: str
def new_test_user(env, login: str = ..., groups: str = ..., context: Any | None = ..., **kwargs): ... def new_test_user(env: Environment, login: str = ..., groups: str = ..., context: dict | None = ..., **kwargs) -> 'odoo.model.res_users': ...
class RecordCapturer: class RecordCapturer:
_model: Any _model: BaseModel
_domain: Any _domain: list
def __init__(self, model, domain) -> None: ... def __init__(self, model: BaseModel, domain: list) -> None: ...
_before: Any _before: BaseModel | None
_after: Any _after: BaseModel | None
def __enter__(self): ... def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type, exc_value, exc_traceback) -> None: ... def __exit__(self, exc_type, exc_value, exc_traceback) -> None: ...
@property @property
def records(self): ... def records(self) -> BaseModel: ...
class OdooSuite(unittest.suite.TestSuite): BackportSuite: type[TestSuite]
def __init__(self, *args, **kwargs) -> None: ...
class OdooSuite(BackportSuite):
def _handleClassSetUp(self, test, result) -> 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 _tearDownPreviousClass(self, test, result) -> None: ... def _tearDownPreviousClass(self, test, result) -> None: ...
class MetaCase(type): class MetaCase(type):
def __init__(cls, name, bases, attrs) -> None: ... def __init__(cls, name, bases, attrs) -> None: ...
def _normalize_arch_for_assert(arch_string, parser_method: str = ...): ... def _normalize_arch_for_assert(arch_string: str, parser_method: str = ...) -> str: ...
class BaseCase(unittest.TestCase, metaclass=MetaCase): class BaseCase(unittest.TestCase, metaclass=MetaCase):
_class_cleanups: Any _class_cleanups: list
tearDown_exceptions: list
registry: Registry
env: Environment
cr: Cursor
@classmethod @classmethod
def addClassCleanup(cls, function, *args, **kwargs) -> None: ... def addClassCleanup(cls, function, *args, **kwargs) -> None: ...
@classmethod @classmethod
@@ -57,39 +84,49 @@ class BaseCase(unittest.TestCase, metaclass=MetaCase):
longMessage: bool longMessage: bool
warm: bool warm: bool
def __init__(self, methodName: str = ...) -> None: ... def __init__(self, methodName: str = ...) -> None: ...
def run(self, result: OdooTestResult) -> None: ...
def shortDescription(self) -> None: ... def shortDescription(self) -> None: ...
def cursor(self) -> Cursor: ... def cursor(self) -> Cursor: ...
@property @property
def uid(self) -> int: ... def uid(self) -> int: ...
env: Environment
@uid.setter @uid.setter
def uid(self, user) -> None: ... def uid(self, user) -> None: ...
def ref(self, xid): ... def ref(self, xid: str) -> int: ...
def browse_ref(self, xid): ... def browse_ref(self, xid: str) -> BaseModel | None: ...
def patch(self, obj, key, val) -> None: ... def patch(self, obj, key, val) -> None: ...
def with_user(self, login) -> None: ... @classmethod
def _assertRaises(self, exception, *, msg: Any | None = ...) -> None: ... def classPatch(cls, obj, key, val) -> None: ...
def assertRaises(self, exception, func: Any | None = ..., *args, **kwargs): ... def startPatcher(self, patcher): ...
def assertQueries(self, expected, flush: bool = ...): ... @classmethod
def assertQueryCount(self, default: int = ..., flush: bool = ..., **counters): ... def startClassPatcher(cls, patcher): ...
def assertRecordValues(self, records, expected_values): ... def with_user(self, login: str) -> None: ...
def assertItemsEqual(self, a, b, msg: Any | None = ...) -> None: ... def debug_mode(self) -> Generator[None, None, None]: ...
def assertTreesEqual(self, n1, n2, msg: Any | None = ...) -> None: ... def _assertRaises(self, exception, *, msg: Any | None = ...) -> Generator[Any, None, None]: ...
def _assertXMLEqual(self, original, expected, parser: str = ...) -> None: ... def assertRaises(self, exception, func: Any | None = ..., *args, **kwargs) -> Generator[Any, None, None] | None: ...
def assertXMLEqual(self, original, expected): ... if sys.version_info < (3, 10):
def assertHTMLEqual(self, original, expected): ... def assertNoLogs(self, logger: str, level: str): ...
profile_session: Any def assertQueries(self, expected, flush: bool = ...) -> Generator[list, None, None]: ...
def profile(self, **kwargs): ... 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) -> None: ...
def assertHTMLEqual(self, original: str, expected: str) -> None: ...
profile_session: str
def profile(self, **kwargs) -> Profiler: ...
savepoint_seq: Any savepoint_seq: count[int]
class TransactionCase(BaseCase): class TransactionCase(BaseCase):
registry: Registry registry: Registry
env: Environment env: Environment
cr: Cursor cr: Cursor
@classmethod @classmethod
def _gc_filestore(cls) -> None: ...
@classmethod
def setUpClass(cls) -> None: ... def setUpClass(cls) -> None: ...
_savepoint_id: Any _savepoint_id: int
def setUp(self): ... def setUp(self): ...
class SavepointCase(TransactionCase): class SavepointCase(TransactionCase):
@@ -97,9 +134,6 @@ class SavepointCase(TransactionCase):
def __init_subclass__(cls) -> None: ... def __init_subclass__(cls) -> None: ...
class SingleTransactionCase(BaseCase): class SingleTransactionCase(BaseCase):
registry: Registry
env: Environment
cr: Cursor
@classmethod @classmethod
def __init_subclass__(cls) -> None: ... def __init_subclass__(cls) -> None: ...
@classmethod @classmethod
@@ -108,64 +142,83 @@ class SingleTransactionCase(BaseCase):
class ChromeBrowserException(Exception): ... class ChromeBrowserException(Exception): ...
def fmap(future, map_fun): ...
def fchain(future, next_callback): ...
class ChromeBrowser: class ChromeBrowser:
_logger: Any remote_debugging_port: int
test_class: Any test_class: type[HttpCase]
devtools_port: Any devtools_port: int | None
ws_url: str ws_url: str
ws: Any ws: WebSocket | None
request_id: int request_id: int
user_data_dir: Any user_data_dir: str
chrome_pid: Any chrome_pid: int | None
screenshots_dir: Any screenshots_dir: str
screencasts_dir: Any screencasts_dir: str | None
screencast_frames: Any screencasts_frames_dir: str | None
window_size: Any screencast_frames: list
window_size: str
touch_enabled: bool
sigxcpu_handler: Any sigxcpu_handler: Any
def __init__(self, logger, window_size, test_class) -> None: ... _request_id: count[int]
_result: Future
error_checker: Any
had_failure: bool
_responses: dict[int, Future]
_frames: dict
_handlers: dict
_receiver: Thread
def __init__(self, test_class: type[HttpCase]) -> None: ...
def signal_handler(self, sig, frame) -> None: ... def signal_handler(self, sig, frame) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
@property @property
def executable(self): ... def executable(self) -> str | None: ...
def _spawn_chrome(self, cmd): ... def _chrome_without_limit(self, cmd) -> Popen: ...
def _spawn_chrome(self, cmd: list[str]) -> int | None: ...
def _chrome_start(self) -> None: ... def _chrome_start(self) -> None: ...
dev_tools_frontend_url: str
def _find_websocket(self) -> None: ... def _find_websocket(self) -> None: ...
def _json_command(self, command, timeout: int = ..., get_key: Any | None = ...): ... def _json_command(self, command: str, timeout: int = ..., get_key: Any | None = ...): ...
def _open_websocket(self) -> None: ... def _open_websocket(self) -> None: ...
def _websocket_send(self, method, params: Any | None = ...): ... def _receive(self, dbname: str) -> None: ...
def _get_message(self, raise_log_error: bool = ...): ... def _websocket_request(self, method: str, *, params: Any | None = ..., timeout: float = ...): ...
_TO_LEVEL: Any def _websocket_send(self, method: str, *, params: Any | None = ..., with_future: bool = ...) -> Future | None: ...
def _websocket_wait_id(self, awaited_id, timeout: int = ...): ... def _handle_console(self, type, args: Any | None = ..., stackTrace: Any | None = ..., **kw) -> None: ...
def _websocket_wait_event(self, method, params: Any | None = ..., timeout: int = ...): ... def _handle_exception(self, exceptionDetails: dict, timestamp) -> None: ...
def take_screenshot(self, prefix: str = ..., suffix: Any | None = ...) -> None: ... def _handle_frame_stopped_loading(self, frameId) -> None: ...
def _handle_screencast_frame(self, sessionId, data, metadata) -> None: ...
_TO_LEVEL: dict[str, int]
def take_screenshot(self, prefix: str = ..., suffix: str | None = ...) -> Future: ...
def _save_screencast(self, prefix: str = ...) -> None: ... def _save_screencast(self, prefix: str = ...) -> None: ...
screencasts_frames_dir: Any
def start_screencast(self) -> None: ... def start_screencast(self) -> None: ...
def set_cookie(self, name, value, path, domain): ... def set_cookie(self, name: str, value, path, domain) -> None: ...
def delete_cookie(self, name, **kwargs): ... def delete_cookie(self, name: str, **kwargs) -> None: ...
def _wait_ready(self, ready_code, timeout: int = ...): ... def _wait_ready(self, ready_code, timeout: int = ...) -> bool: ...
def _wait_code_ok(self, code, timeout): ... def _wait_code_ok(self, code, timeout: float, error_checker: Any | None = ...) -> None: ...
def navigate_to(self, url, wait_stop: bool = ...) -> None: ... def navigate_to(self, url: str, wait_stop: bool = ...) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def _from_remoteobject(self, arg): ... def _from_remoteobject(self, arg: Mapping): ...
LINE_PATTERN: str LINE_PATTERN: str
def _format_stack(self, logrecord) -> None: ... def _format_stack(self, logrecord: Mapping) -> None: ...
def console_formatter(self, args): ... def console_formatter(self, args: list) -> Callable[[Match[str]], str]: ...
class Opener(requests.Session): class Opener(requests.Session):
cr: Any cr: BaseCursor
def __init__(self, cr: BaseCursor) -> None: ... def __init__(self, cr: BaseCursor) -> None: ...
def request(self, *args, **kwargs): ... def request(self, *args, **kwargs): ...
class Transport(xmlrpclib.Transport): class Transport(xmlrpclib.Transport):
cr: Any cr: BaseCursor
def __init__(self, cr: BaseCursor) -> None: ... def __init__(self, cr: BaseCursor) -> None: ...
def request(self, *args, **kwargs): ... def request(self, *args, **kwargs): ...
class HttpCase(TransactionCase): class HttpCase(TransactionCase):
registry_test_mode: bool registry_test_mode: bool
browser: ChromeBrowser browser: ChromeBrowser | None
browser_size: str browser_size: str
touch_enabled: bool
allow_end_on_form: bool
_logger: logging.Logger _logger: logging.Logger
@classmethod @classmethod
def setUpClass(cls) -> None: ... def setUpClass(cls) -> None: ...
@@ -178,102 +231,111 @@ class HttpCase(TransactionCase):
def start_browser(cls) -> None: ... def start_browser(cls) -> None: ...
@classmethod @classmethod
def terminate_browser(cls) -> None: ... def terminate_browser(cls) -> None: ...
def url_open(self, url, data: Any | None = ..., files: Any | None = ..., timeout: int = ..., headers: Any | None = ..., allow_redirects: bool = ..., head: bool = ...): ... def url_open(self, url: str, data: Any | None = ..., files: Mapping | None = ..., timeout: int = ...,
def _wait_remaining_requests(self, 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: ... def logout(self, keep_db: bool = ...) -> None: ...
session: Any session: Session
def authenticate(self, user, password): ... def authenticate(self, user, password) -> Session: ...
def browser_js(self, url_path, code, ready: str = ..., login: Any | None = ..., timeout: int = ..., **kw) -> None: ... def browser_js(self, url_path: str, code: str, ready: str = ..., login: str | None = ..., timeout: int = ...,
cookies: Any | None = ..., error_checker: Any | None = ..., watch: bool = ..., **kw) -> None: ...
@classmethod @classmethod
def base_url(cls): ... def base_url(cls) -> str: ...
def start_tour(self, url_path, tour_name, step_delay: Any | None = ..., **kwargs): ... 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): class HttpSavepointCase(HttpCase):
@classmethod @classmethod
def __init_subclass__(cls) -> None: ... def __init_subclass__(cls) -> None: ...
def users(*logins): ... def no_retry(arg: _T) -> _T: ...
def warmup(func, *args, **kwargs) -> None: ... def users(*logins: str) -> Callable[[_CallableT], _CallableT]: ...
def can_import(module): ... def warmup(func: _CallableT, *args, **kwargs) -> _CallableT: ...
def can_import(module: str) -> bool: ...
ref_re: Any class Form(Generic[_ModelT]):
_env: Environment
class Form: _model: _ModelT
def __init__(self, recordp, view: Any | None = ...) -> None: ... _view: dict
def _o2m_set_edition_view(self, descr, node, level) -> None: ... _values: dict
def __str__(self): ... _changed: set
def _process_fvg(self, model, fvg, level: int = ...) -> None: ... def __init__(self, recordp: _ModelT, view: _ModelT | str | None = ...) -> None: ...
def _init_from_defaults(self, model) -> None: ... def _get_view_fields(self, node: _Element, model: BaseModel) -> dict: ...
def _init_from_values(self, values) -> None: ... def _o2m_set_edition_view(self, descr: dict, node: _Element, level: int) -> None: ...
def __getattr__(self, field): ... def __str__(self) -> str: ...
def _get_modifier(self, field, modifier, default: bool = ..., modmap: Any | None = ..., vals: Any | None = ...): ... def _process_fvg(self, model: BaseModel, fvg: dict, level: int = ...) -> None: ...
_OPS: Any def _init_from_defaults(self, model: BaseModel) -> None: ...
def _get_context(self, field): ... def _init_from_values(self, values: BaseModel) -> None: ...
def __setattr__(self, field, value) -> None: ... def __getattr__(self, field: str): ...
def __enter__(self) -> Form: ... 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: ...
def __enter__(self: _FormT) -> _FormT: ...
def __exit__(self, etype, _evalue, _etb) -> None: ... def __exit__(self, etype, _evalue, _etb) -> None: ...
def save(self): ... def save(self) -> _ModelT: ...
def _values_to_save(self, all_fields: bool = ...): ... def _values_to_save(self, all_fields: bool = ...) -> dict: ...
def _values_to_save_(self, record_values, fields, view, changed, all_fields: bool = ..., modifiers_values: Any | None = ..., parent_link: Any | None = ...): ... def _values_to_save_(self, record_values: dict, fields: dict, view: Any, changed: set, all_fields: bool = ...,
def _perform_onchange(self, fields): ... modifiers_values: dict | None = ..., parent_link: Any | None = ...) -> dict: ...
def _onchange_values(self): ... def _perform_onchange(self, fields: list[str], context: dict | None = ...) -> dict: ...
def _onchange_values_(self, fields, record): ... def _onchange_values(self) -> dict: ...
def _cleanup_onchange(self, descr, value, current): ... def _onchange_values_(self, fields, record: dict) -> dict: ...
def _cleanup_onchange(self, descr: dict, value, current): ...
class O2MForm(Form): class O2MForm(Form):
def __init__(self, proxy, index: Any | None = ...) -> None: ... _proxy: O2MProxy
def _get_modifier(self, field, modifier, default: bool = ..., modmap: Any | None = ..., vals: Any | None = ...): ... _index: int | None
def _onchange_values(self): ... 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 _onchange_values(self) -> dict: ...
def save(self) -> None: ... def save(self) -> None: ...
def _values_to_save(self, all_fields: bool = ...): ... def _values_to_save(self, all_fields: bool = ...) -> UpdateDict: ...
class UpdateDict(dict): class UpdateDict(dict):
_changed: Any _changed: set
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def changed_items(self): ... def changed_items(self) -> Iterator[tuple[Any, Any]]: ...
def update(self, *args, **kw) -> None: ... def update(self, *args, **kw) -> None: ...
class X2MProxy: class X2MProxy:
_parent: Any _parent: Form
_field: Any _field: str
def _assert_editable(self) -> None: ... def _assert_editable(self) -> None: ...
class O2MProxy(X2MProxy): class O2MProxy(X2MProxy):
_parent: Any _records: list[dict]
_field: Any def __init__(self, parent: Form, field: str) -> None: ...
_records: Any def __len__(self) -> int: ...
def __init__(self, parent, field) -> None: ...
def __len__(self): ...
@property @property
def _model(self): ... def _model(self) -> BaseModel: ...
@property @property
def _descr(self): ... def _descr(self) -> dict: ...
def _command_index(self, for_record): ... def _command_index(self, for_record: int) -> int: ...
def new(self): ... def new(self) -> O2MForm: ...
def edit(self, index): ... def edit(self, index: int): ...
def remove(self, index) -> None: ... def remove(self, index: int) -> None: ...
class M2MProxy(X2MProxy, collections.Sequence): class M2MProxy(X2MProxy, collections.Sequence):
_parent: Any def __init__(self, parent: Form, field: str) -> None: ...
_field: Any def __getitem__(self, it) -> BaseModel: ...
def __init__(self, parent, field) -> None: ... def __len__(self) -> int: ...
def __getitem__(self, it): ... def __iter__(self) -> Iterator[BaseModel]: ...
def __len__(self): ... def __contains__(self, record: BaseModel) -> bool: ...
def __iter__(self): ... def add(self, record: BaseModel) -> None: ...
def __contains__(self, record): ... def _get_ids(self) -> list[int]: ...
def add(self, record) -> None: ... def remove(self, id: int | None = ..., index: int | None = ...) -> None: ...
def _get_ids(self): ...
def remove(self, id: Any | None = ..., index: Any | None = ...) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
def record_to_values(fields, record): ... def record_to_values(fields: dict, record: BaseModel) -> dict: ...
def _cleanup_from_default(type_, value): ... def _cleanup_from_default(type_: str, value): ...
def _get_node(view, f, *arg): ... def _get_node(view, f, *arg): ...
def tagged(*tags): ... def tagged(*tags: str) -> Callable[[_CallableT], _CallableT]: ...
class TagsSelector: class TagsSelector:
filter_spec_re: Any filter_spec_re: Pattern
exclude: Any exclude: set
include: Any include: set
def __init__(self, spec) -> None: ... def __init__(self, spec: str) -> None: ...
def check(self, test): ... def check(self, test) -> bool: ...

View File

@@ -1,9 +1,11 @@
from typing import Any from importlib.machinery import ModuleSpec
from typing import Iterator
_logger: Any from .runner import OdooTestResult
from ..tests import OdooSuite
def get_test_modules(module): ... def get_test_modules(module: str) -> list: ...
def _get_tests_modules(path, module): ... def _get_tests_modules(mod: ModuleSpec) -> list: ...
def make_suite(module_names, position: str = ...): ... def make_suite(module_names: list[str], position: str = ...) -> OdooSuite: ...
def run_suite(suite, module_name: Any | None = ...): ... def run_suite(suite: OdooSuite, module_name: str | None = ...) -> OdooTestResult: ...
def unwrap_suite(test) -> None: ... def unwrap_suite(test) -> Iterator: ...

View File

@@ -1,18 +1,36 @@
import unittest import unittest
from typing import Any from collections import defaultdict
from logging import Logger
from re import Pattern
from typing import Any, Generator, NamedTuple
_logger: Any stats_logger: Logger
class Stat(NamedTuple):
time: float
queries: int
def __add__(self, other: Stat) -> Stat: ...
_TEST_ID: Pattern
class OdooTestResult(unittest.result.TestResult): class OdooTestResult(unittest.result.TestResult):
time_start: Any time_start: float | None
queries_start: Any queries_start: int | None
_soft_fail: bool
had_failure: bool
stats: defaultdict[Any, Stat]
def __init__(self) -> None: ... def __init__(self) -> None: ...
def __str__(self): ... def __str__(self) -> str: ...
def soft_fail(self) -> Generator[None, None, None]: ...
shouldStop: Any shouldStop: Any
def update(self, other) -> None: ... 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 log_stats(self) -> None: ...
def getDescription(self, test): ... def getDescription(self, test): ...
def startTest(self, test) -> None: ... def startTest(self, test) -> None: ...
def stopTest(self, test) -> None: ...
def collectStats(self, test_id) -> Generator[None, None, None]: ...
def addError(self, test, err) -> None: ... def addError(self, test, err) -> None: ...
def addFailure(self, test, err) -> None: ... def addFailure(self, test, err) -> None: ...
def addSubTest(self, test, subtest, err) -> None: ... def addSubTest(self, test, subtest, err) -> None: ...

View File

@@ -1,13 +1,12 @@
from typing import Any from argparse import Namespace
_logger: Any BLACKLIST: set[str]
BLACKLIST: Any IGNORE: tuple[str, ...]
IGNORE: Any
def install(db_name, module_id, module_name) -> None: ... def install(db_name: str, module_id: int, module_name: str) -> None: ...
def uninstall(db_name, module_id, module_name) -> None: ... def uninstall(db_name: str, module_id: int, module_name: str) -> None: ...
def cycle(db_name, module_id, module_name) -> None: ... def cycle(db_name: str, module_id: int, module_name: str) -> None: ...
def parse_args(): ... def parse_args() -> Namespace: ...
def test_full(args): ... def test_full(args: Namespace) -> None: ...
def test_uninstall(args) -> None: ... def test_uninstall(args: Namespace) -> None: ...
def test_scripts(args) -> None: ... def test_scripts(args: Namespace) -> None: ...

View File

@@ -1,16 +1,31 @@
from .misc import * from .barcode 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 .date_utils import *
from .convert import * from .debugger import *
from .float_utils import *
from .func import *
from .image import *
from .mail import *
from .misc import *
from .sql import *
from .template_inheritance import * from .template_inheritance import *
from . import _monkeypatches as _monkeypatches, appdirs as appdirs, cloc as cloc, osutil as osutil, pdf as pdf, pycompat as pycompat, win32 as win32 from .translate import *
from .xml_utils import *
from .convert import *
from . import (
_monkeypatches as _monkeypatches,
appdirs as appdirs,
cloc as cloc,
osutil as osutil,
pdf as pdf,
pycompat as pycompat,
win32 as win32
)
from .config import config as config 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 .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 .query import Query as Query, _generate_table_alias as _generate_table_alias
from .sourcemap_generator import SourceMapGenerator as SourceMapGenerator from .sourcemap_generator import SourceMapGenerator as SourceMapGenerator

View File

View File

@@ -0,0 +1,20 @@
from datetime import datetime
from os import PathLike
from typing import Callable, IO
from werkzeug import Response
def send_file(
path_or_file: PathLike | str | IO[bytes],
environ: dict,
mimetype: str | None = ...,
as_attachment: bool = ...,
download_name: str | None = ...,
conditional: bool = ...,
etag: bool | str = ...,
last_modified: datetime | int | float | None = ...,
max_age: int | Callable[[str | None], int | None] | None = ...,
use_x_sendfile: bool = ...,
response_class: type[Response] = ...,
_root_path: PathLike | str | None = ...,
) -> Response: ...

View File

@@ -0,0 +1,53 @@
from re import Pattern
from typing import Any, Generic, TypeVar
from werkzeug.datastructures import CallbackDict
_ModificationTrackingDictT = TypeVar('_ModificationTrackingDictT', bound=ModificationTrackingDict)
_SessionT = TypeVar('_SessionT', bound=Session)
_sha1_re: Pattern
def generate_key(salt: Any = ...) -> str: ...
class ModificationTrackingDict(CallbackDict):
__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')
sid: str
new: bool
def __init__(self, data, sid, new: bool = ...): ...
def __repr__(self) -> str: ...
@property
def should_save(self) -> bool: ...
class SessionStore(Generic[_SessionT]):
session_class: type[_SessionT]
def __init__(self, session_class: type[_SessionT] | None = ...): ...
def is_valid_key(self, key) -> bool: ...
def generate_key(self, salt: Any = ...) -> str: ...
def new(self) -> _SessionT: ...
def save(self, session: _SessionT) -> None: ...
def save_if_modified(self, session: _SessionT) -> None: ...
def delete(self, session: _SessionT) -> None: ...
def get(self, sid: str) -> _SessionT: ...
_fs_transaction_suffix: str
class FilesystemSessionStore(SessionStore[_SessionT]):
path: str | None
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 get_session_filename(self, sid: str) -> str: ...
def save(self, session: _SessionT) -> None: ...
def delete(self, session: _SessionT) -> None: ...
def get(self, sid: str) -> _SessionT: ...
def list(self) -> list[str]: ...

View File

@@ -0,0 +1,23 @@
from re import Pattern
class UserAgentParser(object):
platforms: list[tuple[str, Pattern]]
browsers: list[tuple[str, Pattern]]
_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]: ...
class UserAgent(object):
_parser: UserAgentParser
string: str
platform: str | None
browser: str | None
version: str | None
language: str | None
def __init__(self, environ_or_string: dict | str): ...
def to_header(self) -> str: ...
def __str__(self) -> str: ...
def __nonzero__(self) -> bool: ...
__bool__ = __nonzero__
def __repr__(self) -> str: ...

View File

@@ -1,38 +1,36 @@
from typing import Any from typing import Callable
__version_info__: Any __version_info__: tuple
__version__: Any __version__: str
def user_data_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., roaming: bool = ...): ... def user_data_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ...) -> str: ...
def site_data_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., multipath: bool = ...): ... def site_data_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ...) -> str: ...
def user_config_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., roaming: bool = ...): ... def user_config_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ...) -> str: ...
def site_config_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., multipath: bool = ...): ... def site_config_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ...) -> str: ...
def user_cache_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., opinion: bool = ...): ... def user_cache_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ...) -> str: ...
def user_log_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., opinion: bool = ...): ... def user_log_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ...) -> str: ...
class AppDirs: class AppDirs:
appname: Any appname: str
appauthor: Any appauthor: str | None
version: Any version: str | None
roaming: Any roaming: bool
multipath: Any multipath: bool
def __init__(self, appname, appauthor: Any | None = ..., version: Any | None = ..., roaming: bool = ..., multipath: bool = ...) -> None: ... def __init__(self, appname: str, appauthor: str | None = ..., version: str | None = ..., roaming: bool = ..., multipath: bool = ...) -> None: ...
@property @property
def user_data_dir(self): ... def user_data_dir(self) -> str: ...
@property @property
def site_data_dir(self): ... def site_data_dir(self) -> str: ...
@property @property
def user_config_dir(self): ... def user_config_dir(self) -> str: ...
@property @property
def site_config_dir(self): ... def site_config_dir(self) -> str: ...
@property @property
def user_cache_dir(self): ... def user_cache_dir(self) -> str: ...
@property @property
def user_log_dir(self): ... def user_log_dir(self) -> str: ...
def _get_win_folder_from_registry(csidl_name): ... def _get_win_folder_from_registry(csidl_name: str) -> str: ...
def _get_win_folder_with_pywin32(csidl_name): ... def _get_win_folder_with_pywin32(csidl_name: str) -> str: ...
def _get_win_folder_with_ctypes(csidl_name): ... def _get_win_folder_with_ctypes(csidl_name: str) -> str: ...
_get_win_folder = _get_win_folder_with_pywin32 _get_win_folder: Callable[[str], str]
_get_win_folder = _get_win_folder_with_ctypes
_get_win_folder = _get_win_folder_from_registry

View File

@@ -0,0 +1,2 @@
def get_barcode_check_digit(numeric_barcode: str) -> int: ...
def check_barcode_encoding(barcode: str, encoding: str) -> bool: ...

View File

@@ -1,30 +1,35 @@
from typing import Any from collections import defaultdict
from typing import Any, Callable, TypeVar
from .lru import LRU
from ..models import BaseModel
_T = TypeVar('_T')
_CallableT = TypeVar('_CallableT')
unsafe_eval = eval unsafe_eval = eval
_logger: Any
class ormcache_counter: class ormcache_counter:
__slots__: Any
hit: int hit: int
miss: int miss: int
err: int err: int
def __init__(self) -> None: ... def __init__(self) -> None: ...
@property @property
def ratio(self): ... def ratio(self) -> float: ...
STAT: Any STAT: defaultdict[Any, ormcache_counter]
class ormcache: class ormcache:
args: Any args: Any
skiparg: Any skiparg: Any
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
method: Any method: Callable
def __call__(self, method): ... def __call__(self, method: _CallableT) -> _CallableT: ...
key: Any key: Any
def determine_key(self): ... def determine_key(self): ...
def lru(self, model): ... def lru(self, model: BaseModel) -> tuple[LRU, tuple[str, Callable], ormcache_counter]: ...
def lookup(self, method, *args, **kwargs): ... def lookup(self, method: Callable, *args, **kwargs): ...
def clear(self, model, *args) -> None: ... def clear(self, model: BaseModel, *args) -> None: ...
class ormcache_context(ormcache): class ormcache_context(ormcache):
keys: Any keys: Any
@@ -38,7 +43,7 @@ class ormcache_multi(ormcache):
key_multi: Any key_multi: Any
multi_pos: Any multi_pos: Any
def determine_key(self) -> None: ... def determine_key(self) -> None: ...
def lookup(self, method, *args, **kwargs): ... def lookup(self, method: Callable, *args, **kwargs): ...
class dummy_cache: class dummy_cache:
def __init__(self, *l, **kw) -> None: ... def __init__(self, *l, **kw) -> None: ...

View File

@@ -1,24 +1,32 @@
from typing import Any from typing import Any
from ..api import Environment
VERSION: int VERSION: int
DEFAULT_EXCLUDE: Any DEFAULT_EXCLUDE: list[str]
STANDARD_MODULES: Any STANDARD_MODULES: list[str]
MAX_FILE_SIZE: Any MAX_FILE_SIZE: int
VALID_EXTENSION: list[str]
class Cloc: class Cloc:
modules: Any modules: dict
code: Any code: dict
total: Any total: dict
errors: Any errors: dict
excluded: dict
max_width: int max_width: int
def __init__(self) -> None: ... def __init__(self) -> None: ...
def parse_xml(self, s): ... def parse_c_like(self, s: str, regex: str) -> tuple[int, int]: ...
def parse_py(self, s): ... def parse_xml(self, s: str) -> tuple[int, int]: ...
def parse_js(self, s): ... def parse_py(self, s: str) -> tuple[int, int]: ...
def book(self, module, item: str = ..., count=...) -> None: ... def parse_js(self, s: str) -> tuple[int, int]: ...
def count_path(self, path, exclude: Any | None = ...) -> None: ... def parse_scss(self, s: str) -> tuple[int, int]: ...
def count_modules(self, env) -> None: ... def parse_css(self, s: str) -> tuple[int, int]: ...
def count_customization(self, env) -> None: ... def parse(self, s: str, ext: str) -> tuple[int, int]: ...
def count_env(self, env) -> 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: ...
def count_env(self, env: Environment) -> None: ...
def count_database(self, database) -> None: ... def count_database(self, database) -> None: ...
def report(self, verbose: bool = ..., width: Any | None = ...): ... def report(self, verbose: bool = ..., width: float | None = ...): ...

View File

@@ -1,49 +1,51 @@
import optparse from optparse import Option, OptionParser
from typing import Any from typing import Any
crypt_context: Any from passlib.context import CryptContext
class MyOption(optparse.Option): crypt_context: CryptContext
class MyOption(Option):
my_default: Any my_default: Any
def __init__(self, *opts, **attrs) -> None: ... def __init__(self, *opts, **attrs) -> None: ...
DEFAULT_LOG_HANDLER: str DEFAULT_LOG_HANDLER: str
def _get_default_datadir(): ... def _get_default_datadir() -> str: ...
def _deduplicate_loggers(loggers): ... def _deduplicate_loggers(loggers) -> tuple[str, ...]: ...
class configmanager: class configmanager:
options: Any options: dict[str, Any]
blacklist_for_save: Any blacklist_for_save: set[str]
casts: Any casts: dict
misc: Any misc: dict
config_file: Any config_file: str
_LOGLEVELS: Any _LOGLEVELS: dict
parser: Any parser: OptionParser
def __init__(self, fname: Any | None = ...) -> None: ... def __init__(self, fname: str | None = ...) -> None: ...
def parse_config(self, args: Any | None = ...): ... def parse_config(self, args: list | None = ...): ...
rcfile: Any rcfile: str
def _parse_config(self, args: Any | None = ...): ... def _parse_config(self, args: list | None = ...): ...
def _warn_deprecated_options(self) -> None: ... def _warn_deprecated_options(self) -> None: ...
def _is_addons_path(self, path): ... def _is_addons_path(self, path: str) -> bool: ...
def _check_addons_path(self, option, opt, value, parser) -> None: ... def _check_addons_path(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
def _check_upgrade_path(self, option, opt, value, parser) -> None: ... def _check_upgrade_path(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
def _is_upgrades_path(self, res): ... def _is_upgrades_path(self, res: str) -> bool: ...
def _test_enable_callback(self, option, opt, value, parser) -> None: ... def _test_enable_callback(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
def load(self) -> None: ... def load(self) -> None: ...
def save(self) -> None: ... def save(self, keys: Any | None = ...) -> None: ...
def get(self, key, default: Any | None = ...): ... def get(self, key, default: Any | None = ...): ...
def pop(self, key, default: Any | None = ...): ... def pop(self, key, default: Any | None = ...): ...
def get_misc(self, sect, key, default: Any | None = ...): ... def get_misc(self, sect, key, default: Any | None = ...): ...
def __setitem__(self, key, value) -> None: ... def __setitem__(self, key, value) -> None: ...
def __getitem__(self, key): ... def __getitem__(self, key): ...
@property @property
def addons_data_dir(self): ... def addons_data_dir(self) -> str: ...
@property @property
def session_dir(self): ... def session_dir(self) -> str: ...
def filestore(self, dbname): ... def filestore(self, dbname: str) -> str: ...
def set_admin_password(self, new_password) -> None: ... def set_admin_password(self, new_password) -> None: ...
def verify_admin_password(self, password): ... def verify_admin_password(self, password) -> bool: ...
def _normalize(self, path): ... def _normalize(self, path: str) -> str: ...
config: Any config: configmanager

View File

@@ -1,10 +1,18 @@
from .misc import ustr as ustr from io import BufferedReader
from odoo import api as api from typing import Any, Callable, TextIO
from typing import Any
__all__: Any from lxml.etree import _Element
_logger: Any
safe_eval: Any from .misc import ustr as ustr
from ..api import Environment
from ..sql_db import Cursor
__all__ = [
'convert_file', 'convert_sql_import',
'convert_csv_import', 'convert_xml_import'
]
safe_eval: Callable
class ParseError(Exception): ... class ParseError(Exception): ...
@@ -13,42 +21,42 @@ class RecordDictWrapper(dict):
def __init__(self, record) -> None: ... def __init__(self, record) -> None: ...
def __getitem__(self, key): ... def __getitem__(self, key): ...
def _get_idref(self, env, model_str, idref): ... def _get_idref(self, env: Environment, model_str: str, idref: dict) -> dict: ...
def _fix_multiple_roots(node) -> None: ... def _fix_multiple_roots(node: _Element) -> None: ...
def _eval_xml(self, node, env): ... def _eval_xml(self, node: _Element, env: Environment): ...
def str2bool(value): ... def str2bool(value) -> bool: ...
def nodeattr2bool(node, attr, default: bool = ...): ... def nodeattr2bool(node: _Element, attr, default: bool = ...) -> bool: ...
class xml_import: class xml_import:
def get_env(self, node, eval_context: Any | None = ...): ... def get_env(self, node: _Element, eval_context: dict | None = ...) -> Environment: ...
def make_xml_id(self, xml_id): ... def make_xml_id(self, xml_id: str) -> str: ...
def _test_xml_id(self, xml_id) -> None: ... def _test_xml_id(self, xml_id: str) -> None: ...
def _tag_delete(self, rec) -> None: ... def _tag_delete(self, rec: _Element) -> None: ...
def _tag_report(self, rec): ... def _tag_report(self, rec: _Element): ...
def _tag_function(self, rec) -> None: ... def _tag_function(self, rec: _Element) -> None: ...
def _tag_act_window(self, rec) -> None: ... def _tag_act_window(self, rec: _Element) -> None: ...
def _tag_menuitem(self, rec, parent: Any | None = ...) -> None: ... def _tag_menuitem(self, rec: _Element, parent: Any | None = ...) -> None: ...
def _tag_record(self, rec): ... def _tag_record(self, rec: _Element, extra_vals: dict | None = ...) -> tuple[str, int] | None: ...
def _tag_template(self, el): ... def _tag_template(self, el: _Element) -> tuple[str, int] | None: ...
def id_get(self, id_str, raise_if_not_found: bool = ...): ... def id_get(self, id_str: str, raise_if_not_found: bool = ...) -> int | None: ...
def model_id_get(self, id_str, raise_if_not_found: bool = ...): ... def model_id_get(self, id_str: str, raise_if_not_found: bool = ...) -> tuple[Any, Any]: ...
def _tag_root(self, el) -> None: ... def _tag_root(self, el: _Element) -> None: ...
@property @property
def env(self): ... def env(self) -> Environment: ...
@property @property
def noupdate(self): ... def noupdate(self) -> bool: ...
mode: Any mode: str
module: Any module: str
envs: Any envs: list[Environment]
idref: Any idref: dict
_noupdate: Any _noupdate: list[bool]
xml_filename: Any xml_filename: str
_tags: Any _tags: dict[str, Callable]
def __init__(self, cr, module, idref, mode, noupdate: bool = ..., xml_filename: Any | None = ...) -> None: ... def __init__(self, cr: Cursor, module: str, idref: dict, mode: str, noupdate: bool = ..., xml_filename: str | None = ...) -> None: ...
def parse(self, de) -> None: ... def parse(self, de: _Element) -> None: ...
DATA_ROOTS: Any DATA_ROOTS: list[str]
def convert_file(cr, module, filename, idref, mode: str = ..., noupdate: bool = ..., kind: Any | None = ..., pathname: Any | 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, fp) -> None: ... def convert_sql_import(cr: Cursor, fp: TextIO) -> None: ...
def convert_csv_import(cr, module, fname, csvcontent, idref: Any | None = ..., mode: str = ..., noupdate: bool = ...) -> 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, module, xmlfile, idref: Any | None = ..., mode: str = ..., noupdate: bool = ..., report: Any | None = ...) -> None: ... def convert_xml_import(cr: Cursor, module: str, xmlfile: str | BufferedReader, idref: dict | None = ..., mode: str = ..., noupdate: bool = ..., report: Any | None = ...) -> None: ...

View File

@@ -1,11 +1,18 @@
def get_month(date): ... import datetime
def get_quarter_number(date): ... from typing import Tuple, Iterator, TypeVar
def get_quarter(date): ...
def get_fiscal_year(date, day: int = ..., month: int = ...): ... from dateutil.relativedelta import relativedelta
def get_timedelta(qty, granularity): ...
def start_of(value, granularity): ... _DateTimeT = TypeVar('_DateTimeT', datetime.date, datetime.datetime)
def end_of(value, granularity): ...
def add(value, *args, **kwargs): ... def get_month(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
def subtract(value, *args, **kwargs): ... def get_quarter_number(date) -> int: ...
def json_default(obj): ... def get_quarter(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
def date_range(start, end, step=...): ... def get_fiscal_year(date: _DateTimeT, day: int = ..., month: int = ...) -> Tuple[_DateTimeT, _DateTimeT]: ...
def get_timedelta(qty, granularity) -> relativedelta: ...
def start_of(value: _DateTimeT, granularity) -> _DateTimeT: ...
def end_of(value: _DateTimeT, granularity) -> _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]: ...

View File

@@ -1,6 +1,5 @@
from typing import Any from ..tools.config import configmanager
_logger: Any SUPPORTED_DEBUGGER: set[str]
SUPPORTED_DEBUGGER: Any
def post_mortem(config, info) -> None: ... def post_mortem(config: configmanager, info) -> None: ...

View File

@@ -1,12 +1,9 @@
from typing import Any def round(f: float) -> float: ...
def _float_check_precision(precision_digits: int | None = ..., precision_rounding: float | None = ...) -> float: ...
def round(f): ... def float_round(value: float, precision_digits: int | None = ..., precision_rounding: float | None = ..., rounding_method: str = ...) -> float: ...
def _float_check_precision(precision_digits: Any | None = ..., precision_rounding: Any | None = ...): ... def float_is_zero(value: float, precision_digits: int | None = ..., precision_rounding: float | None = ...) -> bool: ...
def float_round(value, precision_digits: Any | None = ..., precision_rounding: Any | None = ..., rounding_method: str = ...): ... def float_compare(value1: float, value2: float, precision_digits: int | None = ..., precision_rounding: float | None = ...) -> int: ...
def float_is_zero(value, precision_digits: Any | None = ..., precision_rounding: Any | None = ...): ... def float_repr(value: float, precision_digits: int) -> str: ...
def float_compare(value1, value2, precision_digits: Any | None = ..., precision_rounding: Any | None = ...): ...
def float_repr(value, precision_digits): ...
_float_repr = float_repr _float_repr = float_repr
def float_split_str(value: float, precision_digits: int) -> tuple[str, str]: ...
def float_split_str(value, precision_digits): ... def float_split(value: float, precision_digits: int) -> tuple[int, int]: ...
def float_split(value, precision_digits): ...

View File

@@ -1,32 +1,36 @@
from json import JSONEncoder as JSONEncoder from json import JSONEncoder as JSONEncoder
from typing import Any from typing import Callable, Generic, TypeVar
__all__: Any _T = TypeVar('_T')
class lazy_property: class lazy_property(Generic[_T]):
fget: Any fget: Callable[..., _T]
def __init__(self, fget) -> None: ... def __init__(self, fget: Callable[..., _T]) -> None: ...
def __get__(self, obj, cls): ... def __get__(self, obj, cls) -> _T: ...
@property @property
def __doc__(self): ... def __doc__(self): ...
@staticmethod @staticmethod
def reset_all(obj) -> None: ... def reset_all(obj) -> None: ...
class lazy_classproperty(lazy_property): class lazy_classproperty(lazy_property[_T]):
def __get__(self, obj, cls): ... def __get__(self, obj, cls) -> _T: ...
def conditional(condition, decorator): ... def conditional(condition, decorator): ...
def synchronized(lock_attr: str = ...): ... def filter_kwargs(func, kwargs) -> dict: ...
def frame_codeinfo(fframe, back: int = ...): ... def synchronized(lock_attr: str = ...) -> Callable[[_T], _T]: ...
def compose(a, b): ...
class _ClassProperty(property): locked: Callable[[_T], _T]
def __get__(self, cls, owner): ...
def classproperty(func): ... def frame_codeinfo(fframe, back: int = ...) -> tuple[str | None, str | None]: ...
def compose(a: Callable[..., _T], b: Callable) -> Callable[..., _T]: ...
class _ClassProperty(property, Generic[_T]):
def __get__(self, cls, owner) -> _T: ...
def classproperty(func: Callable[..., _T]) -> _ClassProperty[_T]: ...
class lazy: class lazy:
__slots__: Any __slots__ = ['_func', '_args', '_kwargs', '_cached_value']
def __init__(self, func, *args, **kwargs) -> None: ... def __init__(self, func, *args, **kwargs) -> None: ...
@property @property
def _value(self): ... def _value(self): ...

View File

@@ -0,0 +1,12 @@
from typing import Any
class GeoIPResolver:
fname: str
_db: Any
version: int
def __init__(self, fname: str) -> None: ...
def __del__(self) -> None: ...
@classmethod
def open(cls, fname: str) -> GeoIPResolver | None: ...
def resolve(self, ip: str) -> dict: ...
def record_by_addr(self, addr: str) -> dict: ...

View File

@@ -1,31 +1,35 @@
from PIL import IcoImagePlugin as IcoImagePlugin, ImageOps as ImageOps from PIL import IcoImagePlugin as IcoImagePlugin, ImageOps as ImageOps
from typing import Any from typing import Any, Iterable, Literal
FILETYPE_BASE64_MAGICWORD: Any from PIL.Image import Image
FILETYPE_BASE64_MAGICWORD: dict[bytes, str]
EXIF_TAG_ORIENTATION: int EXIF_TAG_ORIENTATION: int
EXIF_TAG_ORIENTATION_TO_TRANSPOSE_METHODS: Any EXIF_TAG_ORIENTATION_TO_TRANSPOSE_METHODS: dict[int, list]
IMAGE_MAX_RESOLUTION: float IMAGE_MAX_RESOLUTION: float
class ImageProcess: class ImageProcess:
base64_source: Any source: bytes
operationsCount: int operationsCount: int
image: bool image: Image | Literal[False]
original_format: Any original_format: str
def __init__(self, base64_source, verify_resolution: bool = ...) -> None: ... def __init__(self, source: bytes, verify_resolution: bool = ...) -> None: ...
def image_base64(self, quality: int = ..., output_format: str = ...): ... def image_quality(self, quality: int = ..., output_format: str = ...) -> bytes | Literal[False]: ...
def resize(self, max_width: int = ..., max_height: int = ...): ... def resize(self, max_width: int = ..., max_height: int = ...) -> ImageProcess: ...
def crop_resize(self, max_width, max_height, center_x: float = ..., center_y: float = ...): ... def crop_resize(self, max_width: int, max_height: int, center_x: float = ..., center_y: float = ...) -> ImageProcess: ...
def colorize(self): ... def colorize(self) -> ImageProcess: ...
def image_process(base64_source, size=..., verify_resolution: bool = ..., quality: int = ..., crop: Any | None = ..., colorize: bool = ..., output_format: str = ...): ... def image_process(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, mitigate: int = ..., max_margin: int = ...): ... def average_dominant_color(colors: list[tuple[Any, Any]], mitigate: int = ..., max_margin: int = ...) -> tuple[Any, Any]: ...
def image_fix_orientation(image): ... def image_fix_orientation(image: Image) -> Image: ...
def base64_to_image(base64_source): ... def binary_to_image(source: bytes) -> Image: ...
def image_to_base64(image, format, **params): ... def base64_to_image(base64_source: bytes) -> Image: ...
def is_image_size_above(base64_source_1, base64_source_2): ... def image_apply_opt(image: Image, output_format: str | None, **params) -> bytes: ...
def image_guess_size_from_field_name(field_name): ... def image_to_base64(image: Image, output_format: str | None, **params) -> bytes: ...
def image_data_uri(base64_source): ... def is_image_size_above(base64_source_1: bytes, base64_source_2: bytes) -> bool: ...
def get_saturation(rgb): ... def image_guess_size_from_field_name(field_name: str) -> tuple[int, int]: ...
def get_lightness(rgb): ... def image_data_uri(base64_source: bytes) -> str: ...
def hex_to_rgb(hx): ... def get_saturation(rgb: Iterable[int]) -> float: ...
def rgb_to_hex(rgb): ... def get_lightness(rgb: Iterable[int]) -> float: ...
def hex_to_rgb(hx: str) -> tuple[int, int, int]: ...
def rgb_to_hex(rgb: Iterable[int]) -> str: ...

View File

@@ -1,76 +1,93 @@
from typing import Any from re import Pattern
def transpile_javascript(url, content): ... def transpile_javascript(url: str, content: str) -> str: ...
URL_RE: Any URL_RE: Pattern
def url_to_module_path(url): ... def url_to_module_path(url: str) -> str: ...
def wrap_with_odoo_define(module_path, content): ... def wrap_with_odoo_define(module_path: str, content: str) -> str: ...
EXPORT_FCT_OR_CLASS_RE: Any EXPORT_FCT_RE: Pattern
def convert_export_function_or_class(content): ... def convert_export_function(content: str) -> str: ...
EXPORT_FCT_OR_CLASS_DEFAULT_RE: Any EXPORT_CLASS_RE: Pattern
def convert_export_function_or_class_default(content): ... def convert_export_class(content: str) -> str: ...
EXPORT_VAR_RE: Any EXPORT_FCT_DEFAULT_RE: Pattern
def convert_variable_export(content): ... def convert_export_function_default(content: str): str: ...
EXPORT_DEFAULT_VAR_RE: Any EXPORT_CLASS_DEFAULT_RE: Pattern
def convert_variable_export_default(content): ... def convert_export_class_default(content: str) -> str: ...
EXPORT_OBJECT_RE: Any EXPORT_VAR_RE: Pattern
def convert_object_export(content): ... def convert_variable_export(content: str) -> str: ...
EXPORT_FROM_RE: Any EXPORT_DEFAULT_VAR_RE: Pattern
def convert_from_export(content): ... def convert_variable_export_default(content: str) -> str: ...
EXPORT_STAR_FROM_RE: Any EXPORT_OBJECT_RE: Pattern
def convert_star_from_export(content): ... def convert_object_export(content: str) -> str: ...
EXPORT_DEFAULT_RE: Any EXPORT_FROM_RE: Pattern
def convert_default_export(content): ... def convert_from_export(content: str) -> str: ...
IMPORT_BASIC_RE: Any EXPORT_STAR_FROM_RE: Pattern
def convert_basic_import(content): ... def convert_star_from_export(content: str) -> str: ...
IMPORT_LEGACY_DEFAULT_RE: Any EXPORT_DEFAULT_RE: Pattern
def convert_legacy_default_import(content): ... def convert_default_export(content: str) -> str: ...
IMPORT_DEFAULT: Any IMPORT_BASIC_RE: Pattern
def convert_default_import(content): ... def convert_basic_import(content: str) -> str: ...
RELATIVE_REQUIRE_RE: Any IMPORT_LEGACY_DEFAULT_RE: Pattern
def convert_relative_require(url, content): ... def convert_legacy_default_import(content: str) -> str: ...
IMPORT_STAR: Any IMPORT_DEFAULT: Pattern
def convert_star_import(content): ... def convert_default_import(content: str) -> str: ...
IMPORT_UNNAMED_RELATIVE_RE: Any IS_PATH_LEGACY_RE: Pattern
IMPORT_DEFAULT_AND_NAMED_RE: Pattern
def convert_unnamed_relative_import(content): ... def convert_default_and_named_import(content: str) -> str: ...
URL_INDEX_RE: Any RELATIVE_REQUIRE_RE: Pattern
def remove_index(content): ... def convert_relative_require(url: str, content: str) -> str: ...
def relative_path_to_module_path(url, path_rel): ...
ODOO_MODULE_RE: Any IMPORT_STAR: Pattern
def is_odoo_module(content): ... def convert_star_import(content: str) -> str: ...
def get_aliased_odoo_define_content(module_path, content): ...
def convert_as(val): ... IMPORT_DEFAULT_AND_STAR: Pattern
def remove_as(val): ...
def convert_default_and_star_import(content: str) -> str: ...
IMPORT_UNNAMED_RELATIVE_RE: Pattern
def convert_unnamed_relative_import(content: str) -> str: ...
URL_INDEX_RE: Pattern
def remove_index(content: str) -> str: ...
def relative_path_to_module_path(url: str, path_rel: str) -> str: ...
ODOO_MODULE_RE: Pattern
def is_odoo_module(content: str) -> str: ...
def get_aliased_odoo_define_content(module_path: str, content: str) -> str: ...
def convert_as(val: str) -> list[str] | str: ...
def remove_as(val: str) -> list[str] | str: ...

View File

@@ -1,12 +1,12 @@
from typing import Any from markupsafe import Markup
JSON_SCRIPTSAFE_MAPPER: Any JSON_SCRIPTSAFE_MAPPER: dict[str, str]
class _ScriptSafe(str): class _ScriptSafe(str):
def __html__(self): ... def __html__(self) -> Markup: ...
class JSON: class JSON:
def loads(self, *args, **kwargs): ... def loads(self, *args, **kwargs): ...
def dumps(self, *args, **kwargs): ... def dumps(self, *args, **kwargs) -> _ScriptSafe: ...
scriptsafe: Any scriptsafe: JSON

View File

@@ -1,17 +1,19 @@
from collections import OrderedDict
from threading import RLock
from typing import Any from typing import Any
__all__: Any __all__ = ['LRU']
class LRU: class LRU:
_lock: Any _lock: RLock
count: Any count: int
d: Any d: OrderedDict
def __init__(self, count, pairs=...) -> None: ... def __init__(self, count: int, pairs: tuple[Any, Any] = ...) -> None: ...
def __contains__(self, obj): ... def __contains__(self, obj) -> bool: ...
def get(self, obj, val: Any | None = ...): ... def get(self, obj, val: Any | None = ...): ...
def __getitem__(self, obj): ... def __getitem__(self, obj): ...
def __setitem__(self, obj, val) -> None: ... def __setitem__(self, obj, val) -> None: ...
def __delitem__(self, obj) -> None: ... def __delitem__(self, obj) -> None: ...
def __len__(self): ... def __len__(self) -> int: ...
def pop(self, key): ... def pop(self, key): ...
def clear(self) -> None: ... def clear(self) -> None: ...

View File

@@ -1,50 +1,56 @@
from lxml.html import clean from email.message import Message
from typing import Any from re import Pattern
from typing import Collection, FrozenSet, Literal
_logger: Any from lxml.etree import _Element
tags_to_kill: Any from lxml.html import clean
tags_to_remove: Any from markupsafe import Markup
allowed_tags: Any
safe_attrs: Any safe_attrs: FrozenSet
SANITIZE_TAGS: dict[str, Collection[str]]
class _Cleaner(clean.Cleaner): class _Cleaner(clean.Cleaner):
_style_re: Any _style_re: Pattern
_style_whitelist: Any _style_whitelist: list[str]
strip_classes: bool strip_classes: bool
sanitize_style: bool sanitize_style: bool
def __call__(self, doc) -> None: ... def __call__(self, doc: _Element) -> None: ...
def tag_quote(self, el): ... def tag_quote(self, el: _Element) -> None: ...
def strip_class(self, el) -> None: ... def strip_class(self, el: _Element) -> None: ...
def parse_style(self, el) -> None: ... def parse_style(self, el: _Element) -> None: ...
def html_sanitize(src, silent: bool = ..., sanitize_tags: bool = ..., sanitize_attributes: bool = ..., sanitize_style: bool = ..., sanitize_form: bool = ..., strip_style: bool = ..., strip_classes: bool = ...): ... 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 URL_REGEX: str
TEXT_URL_REGEX: str TEXT_URL_REGEX: str
HTML_TAG_URL_REGEX: Any HTML_TAG_URL_REGEX: str
HTML_TAGS_REGEX: Pattern
HTML_NEWLINES_REGEX: Pattern
def validate_url(url): ... def validate_url(url: str) -> str: ...
def is_html_empty(html_content): ... def is_html_empty(html_content: str) -> bool: ...
def html_keep_url(text): ... def html_keep_url(text: str) -> str: ...
def html2plaintext(html, body_id: Any | None = ..., encoding: str = ...): ... def html_to_inner_content(html: str) -> str: ...
def plaintext2html(text, container_tag: bool = ...): ... def html2plaintext(html: str, body_id: str | None = ..., encoding: str = ...) -> str: ...
def append_content_to_html(html, content, plaintext: bool = ..., preserve: bool = ..., container_tag: bool = ...): ... def plaintext2html(text: str, container_tag: str = ...) -> Markup: ...
def prepend_html_content(html_body, html_content): ... 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: Any email_re: Pattern
single_email_re: Any single_email_re: Pattern
mail_header_msgid_re: Any mail_header_msgid_re: Pattern
email_addr_escapes_re: Any email_addr_escapes_re: Pattern
def generate_tracking_message_id(res_id): ... def generate_tracking_message_id(res_id: str) -> str: ...
def email_split_tuples(text): ... def email_split_tuples(text: str) -> list[str]: ...
def email_split(text): ... def email_split(text: str) -> list[str]: ...
def email_split_and_format(text): ... def email_split_and_format(text: str) -> list[str]: ...
def email_normalize(text): ... def email_normalize(text: str, strict: bool = ...) -> str | Literal[False]: ...
def email_domain_extract(email): ... def email_domain_extract(email: str) -> str | Literal[False]: ...
def email_domain_normalize(domain): ... def email_domain_normalize(domain: str) -> str | Literal[False]: ...
def url_domain_extract(url): ... def url_domain_extract(url: str) -> str | Literal[False]: ...
def email_escape_char(email_address): ... def email_escape_char(email_address: str) -> str: ...
def decode_message_header(message, header, separator: str = ...): ... def decode_message_header(message: Message, header: str, separator: str = ...) -> str: ...
def formataddr(pair, charset: str = ...): ... def formataddr(pair: tuple[str, str], charset: str = ...) -> str: ...
def encapsulate_email(old_email, new_email): ... def encapsulate_email(old_email: str, new_email: str) -> str: ...

View File

@@ -1,33 +1,32 @@
from typing import Any, NamedTuple import collections
from re import Pattern
from typing import Any, Literal
__all__: Any __all__ = ['guess_mimetype']
_logger: Any _ooxml_dirs: dict[str, str]
_ooxml_dirs: Any
def _check_ooxml(data): ... def _check_ooxml(data: bytes) -> str | Literal[False]: ...
_mime_validator: Any _mime_validator: Pattern
def _check_open_container_format(data): ... def _check_open_container_format(data: bytes) -> str | Literal[False]: ...
_xls_pattern: Any _xls_pattern: Pattern
_ppt_pattern: Any _ppt_pattern: Pattern
def _check_olecf(data): ... def _check_olecf(data: bytes) -> str | Literal[False]: ...
def _check_svg(data): ... def _check_svg(data: bytes) -> str | None: ...
class _Entry(NamedTuple): _Entry = collections.namedtuple('_Entry', ['mimetype', 'signatures', 'discriminants'])
mimetype: Any _mime_mappings: tuple[_Entry, ...]
signatures: Any
discriminants: Any
_mime_mappings: Any
def _odoo_guess_mimetype(bin_data, default: str = ...): ... def _odoo_guess_mimetype(bin_data: str, default: str = ...) -> str: ...
_guesser: Any _guesser: Any
ms: Any ms: Any
def guess_mimetype(bin_data, default: Any | None = ...): ... def guess_mimetype(bin_data: str, default: str | None = ...) -> str: ...
guess_mimetype = _odoo_guess_mimetype
def neuter_mimetype(mimetype, user): ... def neuter_mimetype(mimetype: str, user: 'odoo.model.res_users') -> str: ...
def get_extension(filename: str) -> str: ...

View File

@@ -1,214 +1,260 @@
from .cache import * import datetime
import pickle as pickle_ import pickle as pickle_
from collections import deque
from collections.abc import Mapping, MutableMapping, MutableSet
from contextlib import ContextDecorator, suppress
from logging import Handler, LogRecord
from re import Pattern
from types import ModuleType
from typing import Any, Collection, Generic, IO, AnyStr, ItemsView, Iterable, Iterator, NoReturn, TypeVar, Callable
import markupsafe
import xlsxwriter import xlsxwriter
import xlwt import xlwt
from babel.core import Locale
from xlwt import Worksheet
from .cache import *
from .parse_version import parse_version as parse_version from .parse_version import parse_version as parse_version
from collections.abc import Mapping, MutableMapping, MutableSet from ..api import Environment
from odoo.loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings from ..loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings
from typing import Any
_logger: Any _T = TypeVar('_T')
SKIPPED_ELEMENT_TYPES: Any _T1 = TypeVar('_T1')
_KT = TypeVar('_KT')
_VT = TypeVar('_VT')
_CallableT = TypeVar('_CallableT', bound=Callable)
_LowerLoggingT = TypeVar('_LowerLoggingT', bound=lower_logging)
_ReplaceExceptionsT = TypeVar('_ReplaceExceptionsT', bound=replace_exceptions)
def find_in_path(name): ... SKIPPED_ELEMENT_TYPES: tuple
def _exec_pipe(prog, args, env: Any | None = ...): ... NON_BREAKING_SPACE: str
def exec_command_pipe(name, *args): ...
def find_pg_tool(name): ... def find_in_path(name: str) -> str: ...
def exec_pg_environ(): ... def _exec_pipe(prog, args, env: Mapping[str, str] | None = ...) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def exec_pg_command(name, *args) -> None: ... def exec_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def exec_pg_command_pipe(name, *args): ... def find_pg_tool(name: str) -> str: ...
def file_path(file_path, filter_ext=...): ... def exec_pg_environ() -> dict[str, str]: ...
def file_open(name, mode: str = ..., filter_ext: Any | None = ...): ... def exec_pg_command(name: str, *args) -> None: ...
def flatten(list): ... 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 flatten(list) -> list: ...
def reverse_enumerate(l): ... def reverse_enumerate(l): ...
def partition(pred, elems): ... def partition(pred: Callable[[_T], bool], elems: Iterable[_T]) -> tuple[list[_T], list[_T]]: ...
def topological_sort(elems): ... def topological_sort(elems: dict[_T, Any]) -> list[_T]: ...
def merge_sequences(*iterables): ... def merge_sequences(*iterables: Iterable[_T]) -> list[_T]: ...
class PatchedWorkbook(xlwt.Workbook): class PatchedWorkbook(xlwt.Workbook):
def add_sheet(self, name, cell_overwrite_ok: bool = ...): ... def add_sheet(self, name: str, cell_overwrite_ok: bool = ...) -> Worksheet: ...
class PatchedXlsxWorkbook(xlsxwriter.Workbook): class PatchedXlsxWorkbook(xlsxwriter.Workbook):
def add_worksheet(self, name: Any | None = ..., **kw): ... def add_worksheet(self, name: str | None = ..., **kw) -> Worksheet: ...
def to_xml(s): ... def to_xml(s: str) -> str: ...
def get_iso_codes(lang): ... def get_iso_codes(lang: str) -> str: ...
def scan_languages(): ... def scan_languages() -> list[tuple[str, str]]: ...
def mod10r(number): ... def mod10r(number: str) -> str: ...
def str2bool(s, default: Any | None = ...): ... def str2bool(s: str, default: Any | None = ...) -> bool: ...
def human_size(sz): ... def human_size(sz) -> str: ...
def logged(f): ... def logged(f: _CallableT) -> _CallableT: ...
class profile: class profile:
fname: Any fname: str | None
def __init__(self, fname: Any | None = ...) -> None: ... def __init__(self, fname: str | None = ...) -> None: ...
def __call__(self, f): ... def __call__(self, f: _CallableT) -> _CallableT: ...
def detect_ip_addr(): ... def detect_ip_addr() -> str: ...
DEFAULT_SERVER_DATE_FORMAT: str DEFAULT_SERVER_DATE_FORMAT: str
DEFAULT_SERVER_TIME_FORMAT: str DEFAULT_SERVER_TIME_FORMAT: str
DEFAULT_SERVER_DATETIME_FORMAT: Any DEFAULT_SERVER_DATETIME_FORMAT: str
DATE_LENGTH: Any DATE_LENGTH: int
DATETIME_FORMATS_MAP: Any DATETIME_FORMATS_MAP: dict[str, str]
POSIX_TO_LDML: Any POSIX_TO_LDML: dict[str, str]
def posix_to_ldml(fmt, locale): ... def posix_to_ldml(fmt: str, locale: Locale) -> str: ...
def split_every(n, iterable, piece_maker=...) -> None: ... def split_every(n: int, iterable: Iterable[_T], piece_maker: Callable[[Iterable[_T]], _T1] = ...) -> Iterator[_T1]: ...
def get_and_group_by_field(cr, uid, obj, ids, field, context: Any | None = ...): ...
def get_and_group_by_company(cr, uid, obj, ids, context: Any | None = ...): ... raise_error: object
def resolve_attr(obj, attr): ...
def resolve_attr(obj, attr: str, default: object = ...): ...
def attrgetter(*items): ... def attrgetter(*items): ...
def discardattr(obj, key) -> None: ... def discardattr(obj, key: str) -> None: ...
def remove_accents(input_str): ... def remove_accents(input_str: str) -> str: ...
class unquote(str): class unquote(str):
def __repr__(self): ... def __repr__(self) -> str: ...
class UnquoteEvalContext(defaultdict): class mute_logger(Handler):
def __init__(self, *args, **kwargs) -> None: ... loggers: tuple[str]
def __missing__(self, key): ... old_params: dict[str, tuple[list[Handler], bool]]
def __init__(self, *loggers: str) -> None: ...
class mute_logger:
loggers: Any
def __init__(self, *loggers) -> None: ...
def filter(self, record): ...
def __enter__(self) -> None: ... 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): ... def __call__(self, func: _CallableT) -> _CallableT: ...
def emit(self, record: LogRecord) -> None: ...
class lower_logging(Handler):
old_handlers: list[Handler] | None
old_propagate: bool | None
had_error_log: bool
max_level: int | None
to_level: int | None
def __init__(self, max_level: int, to_level: int | None = ...) -> None: ...
def __enter__(self: _LowerLoggingT) -> _LowerLoggingT: ...
def __exit__(self, exc_type: Any | None = ..., exc_val: Any | None = ..., exc_tb: Any | None = ...) -> None: ...
def emit(self, record: LogRecord) -> None: ...
_ph: Any _ph: Any
class CountingStream: class CountingStream(Generic[_T]):
stream: Any stream: Iterator[_T]
index: Any index: int
stopped: bool stopped: bool
def __init__(self, stream, start: int = ...) -> None: ... def __init__(self, stream: Iterable[_T], start: int = ...) -> None: ...
def __iter__(self): ... def __iter__(self) -> CountingStream[_T]: ...
def next(self): ... def next(self) -> _T: ...
__next__: Any __next__ = next
def stripped_sys_argv(*strip_args): ... def stripped_sys_argv(*strip_args: str) -> list[str]: ...
class ConstantMapping(Mapping): class ConstantMapping(Mapping[_KT, _VT]):
__slots__: Any __slots__ = ['_value']
_value: Any _value: _VT
def __init__(self, val) -> None: ... def __init__(self, val: _VT) -> None: ...
def __len__(self): ... def __len__(self) -> int: ...
def __iter__(self): ... def __iter__(self) -> Iterator: ...
def __getitem__(self, item): ... 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): ... def freehash(arg) -> int: ...
def clean_context(context): ... def clean_context(context: dict[str, Any]) -> dict[str, Any]: ...
class frozendict(dict): class frozendict(dict):
__slots__: Any __slots__ = ()
def __delitem__(self, key) -> None: ... def __delitem__(self, key) -> NoReturn: ...
def __setitem__(self, key, val) -> None: ... def __setitem__(self, key, val) -> NoReturn: ...
def clear(self) -> None: ... def clear(self) -> NoReturn: ...
def pop(self, key, default: Any | None = ...) -> None: ... def pop(self, key, default: Any | None = ...) -> NoReturn: ...
def popitem(self) -> None: ... def popitem(self) -> NoReturn: ...
def setdefault(self, key, default: Any | None = ...) -> None: ... def setdefault(self, key, default: Any | None = ...) -> NoReturn: ...
def update(self, *args, **kwargs) -> None: ... def update(self, *args, **kwargs) -> NoReturn: ...
def __hash__(self): ... def __hash__(self) -> int: ...
class Collector(dict): class Collector(dict[_KT, tuple[_T]]):
__slots__: Any __slots__ = ()
def __getitem__(self, key): ... def __getitem__(self, key: _KT) -> tuple[_T]: ...
def __setitem__(self, key, val) -> None: ... def __setitem__(self, key: _KT, val: Iterable[_T]) -> None: ...
def add(self, key, val) -> None: ... def add(self, key: _KT, val: _T) -> None: ...
def discard_keys_and_values(self, excludes: Collection): ...
class StackMap(MutableMapping): class StackMap(MutableMapping):
__slots__: Any __slots__ = ['_maps']
_maps: Any _maps: list[MutableMapping]
def __init__(self, m: Any | None = ...) -> None: ... def __init__(self, m: MutableMapping | None = ...) -> None: ...
def __getitem__(self, key): ... def __getitem__(self, key): ...
def __setitem__(self, key, val) -> None: ... def __setitem__(self, key, val) -> None: ...
def __delitem__(self, key) -> None: ... def __delitem__(self, key) -> None: ...
def __iter__(self): ... def __iter__(self) -> Iterator: ...
def __len__(self): ... def __len__(self) -> int: ...
def __str__(self): ... def __str__(self) -> str: ...
def pushmap(self, m: Any | None = ...) -> None: ... def pushmap(self, m: MutableMapping | None = ...) -> None: ...
def popmap(self): ... def popmap(self) -> MutableMapping: ...
class OrderedSet(MutableSet): class OrderedSet(MutableSet):
__slots__: Any __slots__ = ['_map']
_map: Any _map: dict
def __init__(self, elems=...) -> None: ... def __init__(self, elems: Iterable = ...) -> None: ...
def __contains__(self, elem): ... def __contains__(self, elem) -> bool: ...
def __iter__(self): ... def __iter__(self) -> Iterator: ...
def __len__(self): ... def __len__(self) -> int: ...
def add(self, elem) -> None: ... def add(self, elem) -> None: ...
def discard(self, elem) -> None: ... def discard(self, elem) -> None: ...
def update(self, elems) -> None: ... def update(self, elems: Iterable) -> None: ...
def difference_update(self, elems) -> None: ... def difference_update(self, elems: Iterable) -> None: ...
def __repr__(self): ... def __repr__(self) -> str: ...
class LastOrderedSet(OrderedSet): class LastOrderedSet(OrderedSet):
def add(self, elem) -> None: ... def add(self, elem) -> None: ...
class Callbacks: class Callbacks:
__slots__: Any __slots__ = ['_funcs', 'data']
_funcs: Any _funcs: deque
data: Any data: dict
def __init__(self) -> None: ... def __init__(self) -> None: ...
def add(self, func) -> None: ... def add(self, func: Callable) -> None: ...
def run(self) -> None: ... def run(self) -> None: ...
def clear(self) -> None: ... def clear(self) -> None: ...
class IterableGenerator: class ReversedIterable(Generic[_T]):
__slots__: Any __slots__ = ['iterable']
func: Any iterable: Iterable[_T]
args: Any def __init__(self, iterable: Iterable[_T]) -> None: ...
def __init__(self, func, *args) -> None: ... def __iter__(self) -> Iterator[_T]: ...
def __iter__(self): ... def __reversed__(self) -> Iterator[_T]: ...
def groupby(iterable, key: Any | None = ...): ... def groupby(iterable: Iterable[_T], key: Callable[..., _T1] | None = ...) -> ItemsView[_T1, _T]: ...
def unique(it) -> None: ... def unique(it: Iterable[_T]) -> Iterator[_T]: ...
def submap(mapping: Mapping[_KT, _VT], keys: Iterable[_KT]) -> dict[_KT, _VT]: ...
class Reverse: class Reverse:
__slots__: Any __slots__ = ['val']
val: Any val: Any
def __init__(self, val) -> None: ... def __init__(self, val) -> None: ...
def __eq__(self, other): ... def __eq__(self, other) -> bool: ...
def __ne__(self, other): ... def __ne__(self, other) -> bool: ...
def __ge__(self, other): ... def __ge__(self, other) -> bool: ...
def __gt__(self, other): ... def __gt__(self, other) -> bool: ...
def __le__(self, other): ... def __le__(self, other) -> bool: ...
def __lt__(self, other): ... def __lt__(self, other) -> bool: ...
def ignore(*exc) -> None: ... def ignore(*exc) -> suppress: ...
html_escape: Any class replace_exceptions(ContextDecorator):
exceptions: tuple[type[Exception], ...]
by: Exception
def __init__(self, *exceptions: type[Exception], by: Exception) -> None: ...
def __enter__(self: _ReplaceExceptionsT) -> _ReplaceExceptionsT: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def get_lang(env, lang_code: str = ...): ... html_escape = markupsafe.escape
def babel_locale_parse(lang_code): ...
def formatLang(env, value, digits: Any | None = ..., grouping: bool = ..., monetary: bool = ..., dp: bool = ..., currency_obj: bool = ...): ...
def format_date(env, value, lang_code: str = ..., date_format: bool = ...): ...
def parse_date(env, value, lang_code: str = ...): ...
def format_datetime(env, value, tz: str = ..., dt_format: str = ..., lang_code: str = ...): ...
def format_time(env, value, tz: str = ..., time_format: str = ..., lang_code: str = ...): ...
def _format_time_ago(env, time_delta, lang_code: str = ..., add_direction: bool = ...): ...
def format_decimalized_number(number, decimal: int = ...): ...
def format_decimalized_amount(amount, currency: Any | None = ...): ...
def format_amount(env, amount, currency, lang_code: str = ...): ...
def format_duration(value): ...
def _consteq(str1, str2): ...
consteq: Any 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 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_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_duration(value: float) -> str: ...
consteq: Callable[[str, str], bool]
class Unpickler(pickle_.Unpickler): class Unpickler(pickle_.Unpickler):
find_global: Any find_global: Any
find_class: Any find_class: Any
def _pickle_load(stream, encoding: str = ..., errors: bool = ...): ... def _pickle_load(stream: pickle_._ReadableFileobj, encoding: str = ..., errors: bool = ...): ...
pickle: Any pickle: ModuleType
class DotDict(dict): class DotDict(dict):
def __getattr__(self, attrib): ... def __getattr__(self, attrib): ...
def get_diff(data_from, data_to, custom_style: bool = ...): ... def get_diff(data_from: tuple[str, str], data_to: tuple[str, str], custom_style: bool = ...) -> str: ...
def traverse_containers(val, type_) -> None: ... def hmac(env: Environment, scope, message, hash_function = ...) -> str: ...
def hmac(env, scope, message, hash_function=...): ...
ADDRESS_REGEX: Pattern
def street_split(street: str) -> dict[str, str]: ...
def is_list_of(values: list | tuple, type_: type | tuple[type, ...]) -> bool: ...
def has_list_types(values: list | tuple, types: Collection[type | tuple[type, ...]]) -> bool: ...

View File

@@ -1,18 +1,10 @@
import ctypes from re import Pattern
from typing import Any from typing import BinaryIO, Callable, Iterable
_logger: Any WINDOWS_RESERVED: Pattern
WINDOWS_RESERVED: Any
def clean_filename(name, replacement: str = ...): ... def clean_filename(name: str, replacement: str = ...) -> str: ...
def listdir(dir, recursive: bool = ...): ... def listdir(dir: str, recursive: bool = ...) -> Iterable[str]: ...
def walksymlinks(top, topdown: bool = ..., onerror: Any | None = ...): ... def zip_dir(path: str, stream: str | BinaryIO, include_dir: bool = ..., fnct_sort: Callable | None = ...) -> None: ...
def tempdir() -> None: ...
def zip_dir(path, stream, include_dir: bool = ..., fnct_sort: Any | None = ...) -> None: ...
getppid: Any is_running_as_nt_service: Callable[[], bool]
is_running_as_nt_service: Any
_TH32CS_SNAPPROCESS: int
class _PROCESSENTRY32(ctypes.Structure):
_fields_: Any

View File

@@ -1,7 +1,8 @@
from typing import Any from re import Pattern
from typing import Callable, Iterator
component_re: Any component_re: Pattern
replace: Any replace: Callable
def _parse_version_parts(s) -> None: ... def _parse_version_parts(s: str) -> Iterator[str]: ...
def parse_version(s): ... def parse_version(s: str) -> tuple[str]: ...

View File

@@ -1,9 +1,14 @@
from io import BytesIO
from re import Pattern
from typing import Any, BinaryIO, Iterable
from PyPDF2 import PdfFileReader, PdfFileWriter from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import ArrayObject as ArrayObject from PyPDF2.generic import ArrayObject as ArrayObject, IndirectObject
from PyPDF2.utils import b_ as b_ from PyPDF2.utils import b_ as b_
from typing import Any
DEFAULT_PDF_DATETIME_FORMAT: str DEFAULT_PDF_DATETIME_FORMAT: str
REGEX_SUBTYPE_UNFORMATED: Pattern
REGEX_SUBTYPE_FORMATED: Pattern
def _unwrapping_get(self, key, default: Any | None = ...): ... def _unwrapping_get(self, key, default: Any | None = ...): ...
@@ -11,14 +16,22 @@ class BrandedFileWriter(PdfFileWriter):
def __init__(self) -> None: ... def __init__(self) -> None: ...
PdfFileWriter = BrandedFileWriter PdfFileWriter = BrandedFileWriter
def merge_pdf(pdf_data): ... def merge_pdf(pdf_data: Iterable[bytes]) -> bytes: ...
def rotate_pdf(pdf): ... def rotate_pdf(pdf: bytes) -> bytes: ...
def add_banner(pdf_stream: str | BinaryIO, text: str | None = ..., logo: bool = ..., thickness: float = ...) -> BytesIO: ...
old_init: Any
class OdooPdfFileReader(PdfFileReader): class OdooPdfFileReader(PdfFileReader):
def getAttachments(self): ... def getAttachments(self) -> Iterable[tuple[Any, Any]]: ...
class OdooPdfFileWriter(PdfFileWriter): class OdooPdfFileWriter(PdfFileWriter):
def _create_attachment_object(self, attachment): ... _reader: PdfFileReader | None
def addAttachment(self, fname, fdata) -> None: ... is_pdfa: bool
_header: bytes
_ID: Any
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 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: ...

View File

@@ -1,15 +1,26 @@
from odoo.tools import pycompat as pycompat import datetime
from typing import Any import random
from typing import Any, Callable, Iterable, Iterator, Sequence, TypeVar
def Random(seed): ... from dateutil.relativedelta import relativedelta
def format_str(val, counter, values): ...
def chain_factories(field_factories, model_name): ... from ..tools import pycompat as pycompat
def root_factory() -> None: ...
def randomize(vals, weights: Any | None = ..., seed: bool = ..., formatter=..., counter_offset: int = ...): ... _T = TypeVar('_T')
def cartesian(vals, weights: Any | None = ..., seed: bool = ..., formatter=..., then: Any | None = ...): ...
def iterate(vals, weights: Any | None = ..., seed: bool = ..., formatter=..., then: Any | None = ...): ... def Random(seed) -> random.Random: ...
def constant(val, formatter=...): ... def format_str(val: _T, counter, values) -> _T: ...
def compute(function, seed: Any | None = ...): ... def chain_factories(field_factories: Iterable[tuple[str, Callable[..., Iterator]]], model_name: str) -> Iterator: ...
def randint(a, b, seed: Any | None = ...): ... def root_factory() -> Iterator[dict]: ...
def randfloat(a, b, seed: Any | None = ...): ... def randomize(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
def randdatetime(*, base_date: Any | None = ..., relative_before: Any | None = ..., relative_after: Any | None = ..., seed: Any | None = ...): ... 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]]: ...

View File

@@ -1,89 +1,97 @@
from typing import Any from datetime import datetime
from threading import Thread
from types import FrameType
from typing import Any, Callable, ContextManager, Generic, Iterable, TypeVar
_logger: Any from ..sql_db import Cursor
def _format_frame(frame): ... _T = TypeVar('_T')
def _format_stack(stack): ...
def get_current_frame(thread: Any | None = ...): ... real_datetime_now: Callable[..., datetime]
def _get_stack_trace(frame, limit_frame: Any | None = ...): ... real_time: Callable[[], float]
def stack_size(): ...
def make_session(name: str = ...): ... 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 stack_size() -> int: ...
def make_session(name: str = ...) -> str: ...
def force_hook() -> None: ... def force_hook() -> None: ...
class Collector: class Collector:
name: Any name: str | None
_registry: Any _registry: dict[str, Any]
@classmethod @classmethod
def __init_subclass__(cls) -> None: ... def __init_subclass__(cls) -> None: ...
@classmethod @classmethod
def make(cls, name, *args, **kwargs): ... def make(cls, name: str, *args, **kwargs): ...
_processed: bool _processed: bool
_entries: Any _entries: list[dict]
profiler: Any profiler: Profiler | None
def __init__(self) -> None: ... def __init__(self) -> None: ...
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
def add(self, entry: Any | None = ..., frame: Any | None = ...) -> None: ... def add(self, entry: dict | None = ..., frame: FrameType | None = ...) -> None: ...
def _get_stack_trace(self, frame: Any | None = ...): ... def _get_stack_trace(self, frame: FrameType | None = ...) -> list[tuple[str, int, str, str]]: ...
def post_process(self) -> None: ... def post_process(self) -> None: ...
@property @property
def entries(self): ... def entries(self) -> list[dict]: ...
class SQLCollector(Collector): class SQLCollector(Collector):
name: str name: str
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
def hook(self, cr, query, params, query_start, query_time) -> None: ... def hook(self, cr: Cursor, query, params, query_start, query_time) -> None: ...
class PeriodicCollector(Collector): class PeriodicCollector(Collector):
name: str name: str
active: bool active: bool
frame_interval: Any frame_interval: float
thread: Any thread: Thread
last_frame: Any last_frame: FrameType | None
def __init__(self, interval: float = ...) -> None: ... def __init__(self, interval: float = ...) -> None: ...
def run(self) -> None: ... def run(self) -> None: ...
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
def add(self, entry: Any | None = ..., frame: Any | None = ...) -> None: ... def add(self, entry: dict | None = ..., frame: FrameType | None = ...) -> None: ...
class SyncCollector(Collector): class SyncCollector(Collector):
name: str name: str
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
def hook(self, _frame, event, _arg: Any | None = ...): ... def hook(self, _frame: FrameType, event: str, _arg: Any | None = ...): ...
def _get_stack_trace(self, frame: Any | None = ...) -> None: ... def _get_stack_trace(self, frame: FrameType | None = ...) -> None: ...
def post_process(self) -> None: ... def post_process(self) -> None: ...
class QwebTracker: class QwebTracker:
@classmethod @classmethod
def wrap_render(cls, method_render): ... def wrap_render(cls, method_render: _T) -> _T: ...
@classmethod @classmethod
def wrap_compile(cls, method_compile): ... def wrap_compile(cls, method_compile: _T) -> _T: ...
@classmethod @classmethod
def wrap_compile_directive(cls, method_compile_directive): ... def wrap_compile_directive(cls, method_compile_directive: _T) -> _T: ...
execution_context_enabled: Any execution_context_enabled: Any
qweb_hooks: Any qweb_hooks: Iterable[Callable]
context_stack: Any context_stack: list[ExecutionContext]
cr: Any cr: Cursor
view_id: Any view_id: Any
def __init__(self, view_id, arch, cr) -> None: ... def __init__(self, view_id, arch, cr) -> None: ...
def enter_directive(self, directive, attrib, xpath) -> None: ... def enter_directive(self, directive, attrib, xpath) -> None: ...
def leave_directive(self) -> None: ... def leave_directive(self, directive, attrib, xpath) -> None: ...
class QwebCollector(Collector): class QwebCollector(Collector):
name: str name: str
events: Any events: list
hook: Any hook: Callable
def __init__(self) -> None: ... def __init__(self) -> None: ...
def _get_directive_profiling_name(self, directive, attrib): ... def _get_directive_profiling_name(self, directive: str, attrib: dict) -> str: ...
def start(self) -> None: ... def start(self) -> None: ...
def stop(self) -> None: ... def stop(self) -> None: ...
def post_process(self) -> None: ... def post_process(self) -> None: ...
class ExecutionContext: class ExecutionContext:
context: Any context: dict
previous_context: Any previous_context: tuple | None
def __init__(self, **context) -> None: ... def __init__(self, **context) -> None: ...
def __enter__(self) -> None: ... def __enter__(self) -> None: ...
def __exit__(self, *_args) -> None: ... def __exit__(self, *_args) -> None: ...
@@ -92,26 +100,29 @@ class Profiler:
start_time: int start_time: int
duration: int duration: int
profile_session: Any profile_session: Any
description: Any description: str | None
init_frame: Any init_frame: FrameType | None
init_stack_trace: Any init_stack_trace: list[tuple[str, int, str, str]] | None
init_thread: Any init_thread: Thread | None
disable_gc: Any disable_gc: bool
filecache: Any filecache: dict
params: Any params: Any
db: Any profile_id: Any
collectors: Any db: str | None
def __init__(self, collectors: Any | None = ..., db=..., profile_session: Any | None = ..., description: Any | None = ..., disable_gc: bool = ..., params: Any | None = ...) -> None: ... collectors: list[Collector]
def __enter__(self): ... 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 __exit__(self, *args) -> None: ...
def _add_file_lines(self, stack) -> None: ... def _add_file_lines(self, stack: list[tuple[str, int, str, str]]) -> None: ...
def entry_count(self): ... def entry_count(self) -> int: ...
def format_path(self, path): ... def format_path(self, path: str) -> str: ...
def json(self): ... def json(self) -> str: ...
class Nested: class Nested(Generic[_T]):
profiler: Any profiler: Profiler
context_manager: Any context_manager: ContextManager[_T]
def __init__(self, profiler, context_manager) -> None: ... def __init__(self, profiler: Profiler, context_manager: ContextManager[_T]) -> None: ...
def __enter__(self): ... def __enter__(self) -> _T: ...
def __exit__(self, exc_type, exc_value, traceback): ... def __exit__(self, exc_type, exc_value, traceback): ...

View File

@@ -1,8 +1,26 @@
from typing import Any from codecs import StreamReader, StreamWriter
from csv import Dialect
from typing import BinaryIO, Iterable, Iterator, Protocol
_reader: Any class _StreamReader(Protocol):
_writer: Any def __call__(self, stream: BinaryIO, errors: str = ...) -> StreamReader: ...
def csv_reader(stream, **params): ... class _StreamWriter(Protocol):
def csv_writer(stream, **params): ... def __call__(self, stream: BinaryIO, errors: str = ...) -> StreamWriter: ...
def to_text(source): ...
class _CsvReader(Iterator[list[str]]):
dialect: Dialect
line_num: int
def __next__(self) -> list[str]: ...
class _CsvWriter:
dialect: Dialect
def writerow(self, row: Iterable): ...
def writerows(self, rows: Iterable[Iterable]) -> None: ...
_reader: _StreamReader
_writer: _StreamWriter
def csv_reader(stream: BinaryIO, **params) -> _CsvReader: ...
def csv_writer(stream: BinaryIO, **params) -> _CsvWriter: ...
def to_text(source) -> str: ...

View File

@@ -0,0 +1,41 @@
from re import Pattern
from typing import Iterable, Iterator
from ..sql_db import Cursor
IDENT_RE: Pattern
def _from_table(table: str, alias: str) -> str: ...
def _generate_table_alias(src_table_alias: str, link: str) -> str: ...
class Query:
_cr: Cursor
_tables: dict[str, str]
_joins: dict[str, tuple]
_where_clauses: list[str]
_where_params: list
order: str | None
limit: int | None
offset: int | None
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 select(self, *args) -> tuple[str, list]: ...
def subselect(self, *args) -> tuple[str, list]: ...
def get_sql(self) -> tuple[str, str, list]: ...
@property
def _result(self) -> list: ...
def __str__(self) -> str: ...
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator: ...
@property
def tables(self) -> tuple[str, ...]: ...
@property
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]: ...

View File

@@ -1,11 +1,14 @@
from typing import Any from re import Pattern
from typing import Any, Iterable
INLINE_TEMPLATE_REGEX: Any from markupsafe import Markup
INLINE_TEMPLATE_REGEX: Pattern
def relativedelta_proxy(*args, **kwargs): ... def relativedelta_proxy(*args, **kwargs): ...
template_env_globals: Any template_env_globals: dict[str, Any]
def parse_inline_template(text): ... def parse_inline_template(text: str) -> list[tuple[str, str]]: ...
def convert_inline_template_to_qweb(template): ... def convert_inline_template_to_qweb(template: str) -> Markup: ...
def render_inline_template(template_instructions, variables): ... def render_inline_template(template_instructions: Iterable[tuple[str, str]], variables: dict) -> str: ...

View File

@@ -1,40 +1,41 @@
from opcode import HAVE_ARGUMENT as HAVE_ARGUMENT from opcode import HAVE_ARGUMENT as HAVE_ARGUMENT
from typing import Any from types import CodeType
from typing import Any, Iterable, Iterator, Literal
unsafe_eval = eval unsafe_eval = eval
__all__: Any _ALLOWED_MODULES: list[str]
_ALLOWED_MODULES: Any _UNSAFE_ATTRIBUTES: list[str]
_UNSAFE_ATTRIBUTES: Any
def to_opcodes(opnames, _opmap=...) -> None: ... def to_opcodes(opnames: Iterable[str], _opmap: dict[str, int] =...) -> Iterator[int]: ...
_BLACKLIST: Any _BLACKLIST: set[int]
_CONST_OPCODES: Any _CONST_OPCODES: set[int]
_operations: Any _operations: list[str]
_EXPR_OPCODES: Any _EXPR_OPCODES: set[int]
_SAFE_OPCODES: Any _SAFE_OPCODES: set[int]
_logger: Any
def assert_no_dunder_name(code_obj, expr) -> None: ... def assert_no_dunder_name(code_obj: CodeType, expr: str) -> None: ...
def assert_valid_codeobj(allowed_codes, code_obj, expr) -> None: ... def assert_valid_codeobj(allowed_codes: set[int], code_obj: CodeType, expr: str) -> None: ...
def test_expr(expr, allowed_codes, mode: str = ...): ... def test_expr(expr: str, allowed_codes: set[int], mode: str = ..., filename: str | None = ...): ...
def const_eval(expr): ... def const_eval(expr: str): ...
def expr_eval(expr): ... def expr_eval(expr: str): ...
def _import(name, globals: Any | None = ..., locals: Any | None = ..., fromlist: Any | None = ..., level: int = ...): ... def _import(name: str, globals: dict | None = ..., locals: dict | None = ..., fromlist: list | None = ..., level: int = ...): ...
_BUILTINS: Any _BUILTINS: dict[str, Any]
def safe_eval(expr, globals_dict: Any | None = ..., locals_dict: Any | None = ..., mode: str = ..., nocopy: bool = ..., locals_builtins: bool = ...): ... def safe_eval(expr: str, globals_dict: dict | None = ..., locals_dict: dict | None = ..., mode: str = ...,
def test_python_expr(expr, mode: str = ...): ... nocopy: bool = ..., locals_builtins: bool = ..., filename: str | None = ...): ...
def check_values(d): ... def test_python_expr(expr: str, mode: str = ...) -> str | Literal[False]: ...
def check_values(d: dict): ...
class wrap_module: class wrap_module:
_repr: Any _repr: str
def __init__(self, module, attributes) -> None: ... def __init__(self, module, attributes) -> None: ...
def __repr__(self): ... def __repr__(self) -> str: ...
def __getattr__(self, item): ...
mods: Any mods: list[str]
datetime: Any datetime: wrap_module
json: Any json: wrap_module
time: Any time: wrap_module
pytz: Any pytz: wrap_module

View File

@@ -1,22 +1,22 @@
from typing import Any from typing import Any
class SourceMapGenerator: class SourceMapGenerator:
_file: Any _file: None
_source_root: Any _source_root: str | None
_sources: Any _sources: dict[str, int]
_mappings: Any _mappings: list[dict[str, Any]]
_sources_contents: Any _sources_contents: dict[str, str]
_version: int _version: int
_cache: Any _cache: dict[tuple[int, int], str]
def __init__(self, source_root: Any | None = ...) -> None: ... def __init__(self, source_root: str | None = ...) -> None: ...
def _serialize_mappings(self): ... def _serialize_mappings(self) -> str: ...
def to_json(self): ... def to_json(self) -> dict: ...
def get_content(self): ... def get_content(self) -> bytes: ...
def add_source(self, source_name, source_content, last_index, start_offset: int = ...) -> None: ... def add_source(self, source_name: str, source_content: str, last_index: int, start_offset: int = ...) -> None: ...
B64CHARS: bytes B64CHARS: bytes
SHIFTSIZE: Any SHIFTSIZE: int
FLAG: Any FLAG: int
MASK: Any MASK: int
def base64vlq_encode(*values): ... def base64vlq_encode(*values) -> str: ...

View File

@@ -1,24 +1,29 @@
from typing import Any from reprlib import Repr
from typing import Any, Callable, Iterable, Sequence, TypeVar
shortener: Any _SpeedscopeT = TypeVar('_SpeedscopeT', bound=Speedscope)
shorten: Any
shortener: Repr
shorten: Callable[[Any], str]
class Speedscope: class Speedscope:
init_stack_trace: Any init_stack_trace: list[Sequence]
init_stack_trace_level: Any init_stack_trace_level: int
caller_frame: Any caller_frame: Sequence | None
init_caller_frame: Any init_caller_frame: Sequence | None
profiles_raw: Any profiles_raw: dict
name: Any name: str
frames_indexes: Any frames_indexes: dict[Any, int]
frame_count: int frame_count: int
profiles: Any profiles: list
def __init__(self, name: str = ..., init_stack_trace: Any | None = ...) -> None: ... def __init__(self, name: str = ..., init_stack_trace: list | None = ...) -> None: ...
def add(self, key, profile) -> None: ... def add(self, key, profile) -> None: ...
def convert_stack(self, stack) -> None: ... def convert_stack(self, stack: list[Sequence]) -> None: ...
def add_output(self, names, complete: bool = ..., display_name: Any | None = ..., use_context: bool = ..., **params): ... def add_output(self: _SpeedscopeT, names: Iterable[str], complete: bool = ..., display_name: str | None = ...,
def add_default(self): ... use_context: bool = ..., **params) -> _SpeedscopeT: ...
def make(self): ... def add_default(self: _SpeedscopeT) -> _SpeedscopeT: ...
def get_frame_id(self, frame): ... def make(self) -> dict: ...
def stack_to_ids(self, stack, context, stack_offset: int = ...): ... def get_frame_id(self, frame) -> int: ...
def process(self, entries, continuous: bool = ..., hide_gaps: bool = ..., use_context: bool = ...): ... 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]: ...

View File

@@ -1,31 +1,43 @@
from typing import Any from collections import defaultdict
from typing import Iterable, Literal
_schema: Any from ..models import BaseModel
_CONFDELTYPES: Any from ..sql_db import Cursor
def existing_tables(cr, tablenames): ... _CONFDELTYPES: dict[str, str]
def table_exists(cr, tablename): ...
def table_kind(cr, tablename): ... def existing_tables(cr: Cursor, tablenames: Iterable[str]) -> list[str]: ...
def create_model_table(cr, tablename, comment: Any | None = ..., columns=...) -> None: ... def table_exists(cr: Cursor, tablename: str) -> bool: ...
def table_columns(cr, tablename): ... def table_kind(cr: Cursor, tablename: str) -> str | None: ...
def column_exists(cr, tablename, columnname): ...
def create_column(cr, tablename, columnname, columntype, comment: Any | None = ...) -> None: ... SQL_ORDER_BY_TYPE: defaultdict
def rename_column(cr, tablename, columnname1, columnname2) -> None: ...
def convert_column(cr, tablename, columnname, columntype) -> None: ... def create_model_table(cr: Cursor, tablename: str, comment: str | None = ..., columns: Iterable = ...) -> None: ...
def set_not_null(cr, tablename, columnname) -> None: ... def table_columns(cr: Cursor, tablename: str) -> dict: ...
def drop_not_null(cr, tablename, columnname) -> None: ... def column_exists(cr: Cursor, tablename: str, columnname: str) -> int: ...
def constraint_definition(cr, tablename, constraintname): ... def create_column(cr: Cursor, tablename: str, columnname: str, columntype: str, comment: str | None = ...) -> None: ...
def add_constraint(cr, tablename, constraintname, definition) -> None: ... def rename_column(cr: Cursor, tablename: str, columnname1: str, columnname2: str) -> None: ...
def drop_constraint(cr, tablename, constraintname) -> None: ... def convert_column(cr: Cursor, tablename: str, columnname: str, columntype: str) -> None: ...
def add_foreign_key(cr, tablename1, columnname1, tablename2, columnname2, ondelete): ... def convert_column_translatable(cr: Cursor, tablename: str, columnname: str, columntype: str) -> None: ...
def get_foreign_keys(cr, tablename1, columnname1, tablename2, columnname2, ondelete): ... def _convert_column(cr: Cursor, tablename: str, columnname: str, columntype: str, using: str) -> None: ...
def fix_foreign_key(cr, tablename1, columnname1, tablename2, columnname2, ondelete): ... def drop_depending_views(cr: Cursor, table: str, column: str) -> None: ...
def index_exists(cr, indexname): ... def get_depending_views(cr: Cursor, table: str, column: str): ...
def create_index(cr, indexname, tablename, expressions) -> None: ... def set_not_null(cr: Cursor, tablename: str, columnname: str) -> None: ...
def create_unique_index(cr, indexname, tablename, expressions) -> None: ... def drop_not_null(cr: Cursor, tablename: str, columnname: str) -> None: ...
def drop_index(cr, indexname, tablename) -> None: ... def constraint_definition(cr: Cursor, tablename: str, constraintname: str) -> str | None: ...
def drop_view_if_exists(cr, viewname) -> None: ... def add_constraint(cr: Cursor, tablename: str, constraintname: str, definition: str) -> None: ...
def escape_psql(to_escape): ... def drop_constraint(cr: Cursor, tablename: str, constraintname: str) -> None: ...
def pg_varchar(size: int = ...): ... def add_foreign_key(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> Literal[True]: ...
def reverse_order(order): ... def get_foreign_keys(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> list[str]: ...
def increment_field_skiplock(record, field): ... 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], method: str = ..., where: 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: ...
def pg_varchar(size: int = ...) -> str: ...
def reverse_order(order: str) -> str: ...
def increment_fields_skiplock(records: BaseModel, *fields: str) -> bool: ...
def value_to_translated_trigram_pattern(value: str) -> str: ...
def pattern_to_translated_trigram_pattern(pattern: str) -> str: ...

View File

@@ -1,9 +1,13 @@
from typing import Any from re import Pattern
from typing import Any, Callable
_logger: Any from lxml.etree import _Element
def add_text_before(node, text) -> None: ... RSTRIP_REGEXP: Pattern
def add_text_inside(node, text) -> None: ...
def remove_element(node) -> None: ... def add_stripped_items_before(node: _Element, spec: _Element, extract: Callable[[_Element], _Element]) -> None: ...
def locate_node(arch, spec): ... def add_text_before(node: _Element, text: str | None) -> None: ...
def apply_inheritance_specs(source, specs_tree, inherit_branding: bool = ..., pre_locate=...): ... 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: ...

View File

@@ -1,8 +1,10 @@
from typing import Any, Literal
from . import config as config from . import config as config
from typing import Any from ..sql_db import Cursor
_logger: Any def try_report(cr: Cursor, uid: int, rname: str, ids, data: Any | None = ..., context: dict | None = ...,
_test_logger: Any 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 = ...,
def try_report(cr, uid, rname, ids, data: Any | None = ..., context: Any | None = ..., our_module: Any | None = ..., report_type: Any | None = ...): ... wiz_data: dict | None = ..., wiz_buttons: list[str] | None = ..., context: dict | None = ...,
def try_report_action(cr, uid, action_id, active_model: Any | None = ..., active_ids: Any | None = ..., wiz_data: Any | None = ..., wiz_buttons: Any | None = ..., context: Any | None = ..., our_module: Any | None = ...): ... our_module: str | None = ...) -> Literal[True]: ...

View File

@@ -1,133 +1,163 @@
import csv import csv
from typing import Any, NamedTuple 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 lxml.etree import HTMLParser, _Element
from polib import POFile
from .pycompat import _CsvWriter
from ..api import Environment
from ..fields import Field
from ..models import BaseModel
from ..sql_db import Connection, Cursor
_logger: Any
WEB_TRANSLATION_COMMENT: str WEB_TRANSLATION_COMMENT: str
SKIPPED_ELEMENTS: Any SKIPPED_ELEMENTS: tuple[str, ...]
_LOCALE2WIN32: Any _LOCALE2WIN32: dict[str, str]
ENGLISH_SMALL_WORDS: Any
class UNIX_LINE_TERMINATOR(csv.excel): class UNIX_LINE_TERMINATOR(csv.excel):
lineterminator: str lineterminator: str
def encode(s): ... def encode(s: str) -> str: ...
TRANSLATED_ELEMENTS: Any TRANSLATED_ELEMENTS: set[str]
TRANSLATED_ATTRS: Any TRANSLATED_ATTRS: dict[str, Any]
def translate_attrib_value(node): ... def translate_attrib_value(node: _Element) -> bool: ...
avoid_pattern: Any avoid_pattern: Pattern
node_pattern: Any
def translate_xml_node(node, callback, parse, serialize): ... def translate_xml_node(node: _Element, callback: Callable[[str], str | None], parse: Callable[[str], _Element],
def parse_xml(text): ... serialize: Callable[[_Element], str]) -> _Element: ...
def serialize_xml(node): ... def parse_xml(text: str) -> _Element: ...
def serialize_xml(node: _Element) -> str: ...
_HTML_PARSER: Any _HTML_PARSER: HTMLParser
def parse_html(text): ... def parse_html(text: str) -> _Element: ...
def serialize_html(node): ... def serialize_html(node: _Element) -> str: ...
def xml_translate(callback, value): ... def xml_translate(callback: Callable[[str], str | None], value: str) -> str: ...
def html_translate(callback, value): ... def xml_term_converter(value: str) -> str: ...
def translate(cr, name, source_type, lang, source: Any | None = ...): ... def html_translate(callback: Callable[[str], str | None], value: str) -> str: ...
def translate_sql_constraint(cr, key, lang): ... def html_term_converter(value: str) -> str: ...
def get_text_content(term: str) -> str: ...
def translate_sql_constraint(cr: Cursor, key: str, lang: str) -> str: ...
class GettextAlias: class GettextAlias:
def _get_db(self): ... def _get_db(self) -> Connection | None: ...
def _get_cr(self, frame, allow_create: bool = ...): ... def _get_cr(self, frame: FrameType, allow_create: bool = ...) -> tuple[Cursor, bool]: ...
def _get_uid(self, frame): ... def _get_uid(self, frame: FrameType) -> int: ...
def _get_lang(self, frame): ... def _get_lang(self, frame: FrameType) -> str: ...
def __call__(self, source, *args, **kwargs): ... def __call__(self, source: str, *args, **kwargs) -> str: ...
def _get_translation(self, source): ... def _get_translation(self, source: str, module: str | None = ...) -> str: ...
class _lt: class _lt:
__slots__: Any __slots__ = ['_source', '_args', '_module']
_source: Any _source: str
_args: Any _args: tuple
def __init__(self, source, *args, **kwargs) -> None: ... _module: str
def __str__(self): ... def __init__(self, source: str, *args, **kwargs) -> None: ...
def __eq__(self, other): ... def __str__(self) -> str: ...
def __lt__(self, other): ... def __eq__(self, other) -> NoReturn: ...
def __add__(self, other): ... def __lt__(self, other) -> NoReturn: ...
def __radd__(self, other): ... def __add__(self, other: str | _lt) -> str: ...
def __radd__(self, other: str) -> str: ...
_: Any _: GettextAlias
def quote(s): ... def quote(s: str) -> str: ...
re_escaped_char: Any re_escaped_char: Pattern
re_escaped_replacements: Any re_escaped_replacements: dict[str, str]
def _sub_replacement(match_obj): ... def _sub_replacement(match_obj: Match) -> str: ...
def unquote(str): ... def unquote(str: str) -> str: ...
def TranslationFileReader(source, fileformat: str = ...): ... def TranslationFileReader(source: IO, fileformat: str = ...) -> CSVFileReader | PoFileReader: ...
class CSVFileReader: class CSVFileReader:
source: Any source: csv.DictReader
prev_code_src: str prev_code_src: str
def __init__(self, source) -> None: ... def __init__(self, source: IO) -> None: ...
def __iter__(self): ... def __iter__(self) -> Iterator[csv.DictReader]: ...
class PoFileReader: class PoFileReader:
pofile: Any pofile: POFile
def __init__(self, source): ... def __init__(self, source: str | IO): ...
def __iter__(self): ... def __iter__(self) -> Iterator[dict[str, Any]]: ...
def TranslationFileWriter(target, fileformat: str = ..., lang: Any | None = ...): ... def TranslationFileWriter(target, fileformat: str = ..., lang: str | None = ...) -> CSVFileWriter | PoFileWriter | TarFileWriter: ...
class CSVFileWriter: class CSVFileWriter:
writer: Any writer: _CsvWriter
def __init__(self, target) -> None: ... def __init__(self, target: BinaryIO) -> None: ...
def write_rows(self, rows) -> None: ... def write_rows(self, rows: Iterable) -> None: ...
class PoFileWriter: class PoFileWriter:
buffer: Any buffer: IO
lang: Any lang: str
po: Any po: POFile
def __init__(self, target, lang) -> None: ... def __init__(self, target: IO, lang: str) -> None: ...
def write_rows(self, rows) -> None: ... def write_rows(self, rows: Iterable) -> None: ...
def add_entry(self, modules, tnrs, source, trad, comments: Any | None = ...) -> None: ... def add_entry(self, modules, tnrs, source, trad, comments: Iterable[str] | None = ...) -> None: ...
class TarFileWriter: class TarFileWriter:
tar: Any tar: TarFile
lang: Any lang: str
def __init__(self, target, lang) -> None: ... def __init__(self, target: IO, lang: str) -> None: ...
def write_rows(self, rows) -> None: ... def write_rows(self, rows: Iterable) -> None: ...
def trans_export(lang, modules, buffer, format, cr) -> None: ... def trans_export(lang: str, modules: list[str], buffer, format: str, cr: Cursor) -> None: ...
def trans_parse_rml(de): ... def _push(callback: Callable[[str, int], Any], term: str, source_line: int) -> None: ...
def _push(callback, term, source_line) -> None: ... def _extract_translatable_qweb_terms(element: _Element, callback: Callable[[str, int], Any]) -> None: ...
def in_modules(object_name, modules): ... def babel_extract_qweb(fileobj: IO, keywords, comment_tags, options) -> list[tuple]: ...
def _extract_translatable_qweb_terms(element, callback) -> None: ... def extract_formula_terms(formula: str) -> Iterator[str]: ...
def babel_extract_qweb(fileobj, keywords, comment_tags, options): ... def extract_spreadsheet_terms(fileobj, keywords, comment_tags, options) -> Iterator[tuple[int, str, str, list]]: ...
class ImdInfo(NamedTuple): ImdInfo = namedtuple('ExternalId', ['name', 'model', 'res_id', 'module'])
name: Any
model: Any
res_id: Any
module: Any
class TranslationModuleReader: class TranslationModuleReader:
_cr: Any _cr: Cursor
_modules: Any _modules: list[str]
_lang: Any _lang: str | None
env: Any env: Environment
_to_translate: Any _to_translate: list[tuple]
_path_list: Any _path_list: list[tuple[str, Any]]
_installed_modules: Any _installed_modules: list[str]
def __init__(self, cr, modules: Any | None = ..., lang: Any | None = ...) -> None: ... def __init__(self, cr: Cursor, modules: list[str] | None = ..., lang: str | None = ...) -> None: ...
def __iter__(self): ... def __iter__(self) -> Iterable[tuple]: ...
def _push_translation(self, module, ttype, name, res_id, source, comments: Any | None = ..., record_id: Any | None = ...) -> None: ... def _push_translation(self, module: str, ttype: str, name: str, res_id: str, source: str,
def _get_translatable_records(self, imd_records): ... comments: Iterable[str] | None = ..., record_id: int | None = ..., value: Any | None = ...) -> None: ...
def _get_translatable_records(self, imd_records: Iterable[ImdInfo]) -> BaseModel: ...
def _export_translatable_records(self) -> None: ... def _export_translatable_records(self) -> None: ...
def _get_module_from_path(self, path): ... def _get_module_from_path(self, path: str) -> str: ...
def _verified_module_filepaths(self, fname, path, root): ... 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, path, root, extract_method: str = ..., trans_type: str = ..., extra_comments: Any | None = ..., extract_keywords=...) -> 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 _export_translatable_resources(self) -> None: ...
def trans_load(cr, filename, lang, verbose: bool = ..., create_empty_translation: bool = ..., overwrite: bool = ...): ... def trans_load(cr: Cursor, filename: str, lang: str, verbose: bool = ..., overwrite: bool = ...) -> None: ...
def trans_load_data(cr, fileobj, fileformat, lang, verbose: bool = ..., create_empty_translation: bool = ..., overwrite: bool = ...) -> None: ... def trans_load_data(cr: Cursor, fileobj: IO, fileformat: str, lang: str, verbose: bool = ..., overwrite: bool = ...) -> None: ...
def get_locales(lang: Any | None = ...) -> None: ... def _trans_load_data(cr: Cursor, reader, lang: str, overwrite: bool = ..., force_overwrite: bool = ...,
def resetlocale(): ... xml_ids: Container[str] | None = ...) -> None: ...
def load_language(cr, lang) -> None: ... def get_locales(lang: str | None = ...) -> None: ...
def resetlocale() -> str: ...
def load_language(cr: Cursor, lang: str) -> None: ...
class CodeTranslations:
python_translations: dict[tuple[str, str], dict]
web_translations: dict[tuple[str, str], dict]
def __init__(self) -> None: ...
def _get_po_paths(self, mod: str, lang: str) -> list[str]: ...
def _trans_load_code_python(self, fileobj: IO, fileformat: str, lang: str) -> dict: ...
def _trans_load_code_webclient(self, fileobj: IO, fileformat: str, lang: str) -> dict: ...
def _load_python_translations(self, module_name: str, lang: str) -> None: ...
def _load_web_translations(self, module_name: str, lang: str) -> None: ...
def get_python_translations(self, module_name: str, lang: str) -> dict: ...
def get_web_translations(self, module_name: str, lang: str) -> dict: ...
code_translations: CodeTranslations
def _get_translation_upgrade_queries(cr: Cursor, field: Field) -> tuple[list, list]: ...

View File

@@ -1,16 +1,22 @@
from typing import Any from ast import expr as _expr
from collections import defaultdict
from re import Pattern
from typing import Callable, TypeVar
_logger: Any from lxml.etree import RelaxNG, _Element
_validators: Any
_relaxng_cache: Any
READONLY: Any
def _get_attrs_symbols(): ... _CallableT = TypeVar('_CallableT', bound=Callable)
def get_variable_names(expr): ...
def get_dict_asts(expr): ... _validators: defaultdict[str, list[Callable]]
def _check(condition, explanation) -> None: ... _relaxng_cache: dict[str, RelaxNG | None]
def get_domain_identifiers(expr): ... READONLY: Pattern
def valid_view(arch, **kwargs): ...
def validate(*view_types): ... def _get_attrs_symbols() -> set[str]: ...
def relaxng(view_type): ... def get_variable_names(expr: str | _expr) -> set[str]: ...
def schema_valid(arch, **kwargs): ... def get_dict_asts(expr: str | _expr) -> dict: ...
def _check(condition: bool, explanation: str) -> None: ...
def get_domain_identifiers(expr: str | _expr) -> tuple[set[str], set[str]]: ...
def valid_view(arch: _Element, **kwargs) -> bool: ...
def validate(*view_types: str) -> Callable[[_CallableT], _CallableT]: ...
def relaxng(view_type: str) -> RelaxNG: ...
def schema_valid(arch: _Element, **kwargs) -> bool: ...

View File

@@ -1,13 +1,12 @@
from os import R_OK as R_OK, W_OK as W_OK from os import R_OK as R_OK, W_OK as W_OK
from os.path import dirname as dirname from os.path import dirname as dirname
from typing import Any from typing import Iterator
__docformat__: str __docformat__: str
__all__: Any
ENOENT: int ENOENT: int
windows: Any windows: bool
seen: Any seen: set
defpathext: Any defpathext: list[str]
def which_files(file, mode=..., path: Any | None = ..., pathext: Any | None = ...) -> None: ... def which_files(file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...) -> Iterator[str]: ...
def which(file, mode=..., path: Any | None = ..., pathext: Any | None = ...): ... def which(file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...) -> str: ...

View File

@@ -1 +1 @@
def nl_langinfo(param): ... def nl_langinfo(param) -> str: ...

View File

@@ -1,11 +1,22 @@
from lxml import etree from lxml import etree
from typing import Any from lxml.etree import _Element
from typing import Callable, IO, Iterable, Literal
from ..api import Environment
class odoo_resolver(etree.Resolver): class odoo_resolver(etree.Resolver):
env: Any env: Environment
def __init__(self, env) -> None: ... prefix: str | None
def resolve(self, url, id, context): ... def __init__(self, env: Environment, prefix: str | None) -> None: ...
def resolve(self, url: str, id: str, context) -> str: ...
def _check_with_xsd(tree_or_str, stream, env: Any | None = ...) -> None: ... def _check_with_xsd(tree_or_str: str | _Element, stream: str | IO, env: Environment | None = ..., prefix: str | None = ...) -> None: ...
def create_xml_node_chain(first_parent_node, nodes_list, last_node_value: Any | 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, node_name, node_value: Any | None = ...): ... 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 load_xsd_files_from_url(env: Environment, url: str, file_name: str, force_reload: bool = ..., request_max_timeout: int = ...,
xsd_name_prefix: str = ..., xsd_names_filter: str | list[str] | None = ...,
modify_xsd_content: Callable[[bytes], bytes] | None = ...) -> 'odoo.model.ir_attachment | Literal[False]': ...
def validate_xml_from_attachment(env: Environment, xml_content, xsd_name: str, reload_files_function: Callable | None = ...,
prefix: str | None = ...) -> None: ...

View File

@@ -1,3 +0,0 @@
from typing import Any
__path__: Any