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

View File

@@ -1,11 +1,8 @@
from typing import Any
commands: dict[str, type[Command]]
commands: Any
class CommandType(type):
def __init__(cls, name, bases, attrs) -> None: ...
Command: Any
class Command:
name: str
def __init_subclass__(cls) -> None: ...
class Help(Command):
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 typing import Any
_logger: Any
from ..api import Environment
from ..models import BaseModel
class Populate(Command):
def run(self, cmdargs) -> None: ...
@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
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: Any
server_wide_modules: Any
addons_paths: list[str]
server_wide_modules: list[str]

View File

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

View File

@@ -1,274 +1,296 @@
import datetime
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
DATETIME_LENGTH: Any
from .api import Environment, Registry
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
IR_MODELS: Any
_logger: Any
_schema: Any
Default: Any
IR_MODELS: tuple[str, ...]
NoneType: type[None]
Default: object
def first(records): ...
def resolve_mro(model, name, predicate): ...
def first(records: _ModelT) -> _ModelT: ...
def resolve_mro(model: BaseModel, name: str, predicate: Callable[..., bool]): ...
class MetaField(type):
by_type: Any
def __init__(cls, name, bases, attrs) -> None: ...
by_type: dict
def __init__(cls: type[Field], name, bases, attrs) -> None: ...
_global_seq: Any
class Field:
type: Any
class Field(metaclass=MetaField):
type: str | None
relational: bool
translate: bool
column_type: Any
column_format: str
column_cast_from: Any
column_type: tuple[str, str] | None
write_sequence: int
args: Any
_module: Any
_modules: Any
args: dict[str, Any] | None
_module: str
_modules: tuple[str, ...]
_setup_done: bool
_sequence: Any
_base_fields: Any
_extra_keys: Any
_sequence: int | None
_base_fields: tuple[Field, ...]
_extra_keys: tuple[str, ...]
_direct: bool
_toplevel: bool
automatic: bool
inherited: bool
inherited_field: Any
name: Any
model_name: Any
comodel_name: Any
inherited_field: Field | None
name: str
model_name: str
comodel_name: str | None
store: bool
index: bool
manual: bool
copy: bool
_depends: Any
_depends_context: Any
_depends: Collection[str, ...] | None
_depends_context: Collection[str, ...] | None
recursive: bool
compute: Any
compute: str | Callable | None
compute_sudo: bool
inverse: Any
search: Any
related: Any
precompute: bool
inverse: str | Callable | None
search: str | Callable | None
related: str | None
company_dependent: bool
default: Any
string: Any
help: Any
string: str | None
help: str | None
invisible: bool
readonly: bool
required: bool
states: Any
groups: Any
states: dict[str, list[tuple]] | None
groups: str | None
change_default: bool
deprecated: Any
related_field: Any
group_operator: Any
group_expand: Any
related_field: Field | None
group_operator: str | None
group_expand: str | None
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 __str__(self): ...
def __repr__(self): ...
def __set_name__(self, owner, name) -> None: ...
def _get_attrs(self, model_class, name): ...
def _setup_attrs(self, model_class, name): ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def __set_name__(self, owner: type[BaseModel], name: str) -> None: ...
def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
def _setup_attrs(self, model_class: type[BaseModel], name: str): ...
def prepare_setup(self) -> None: ...
def setup(self, model) -> None: ...
def setup_nonrelated(self, model) -> None: ...
def get_depends(self, model): ...
def setup_related(self, model) -> None: ...
def traverse_related(self, record): ...
def _compute_related(self, records) -> None: ...
def setup(self, model: BaseModel) -> None: ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
def get_depends(self, model: BaseModel) -> tuple: ...
def setup_related(self, model: BaseModel) -> None: ...
def traverse_related(self, record: _ModelT) -> tuple[_ModelT, Field]: ...
def _compute_related(self, records: BaseModel) -> None: ...
def _process_related(self, value): ...
def _inverse_related(self, records) -> None: ...
def _search_related(self, records, operator, value): ...
_related_comodel_name: Any
_related_string: Any
_related_help: Any
_related_groups: Any
_related_group_operator: Any
def _inverse_related(self, records: BaseModel) -> None: ...
def _search_related(self, records: BaseModel, operator: str, value) -> list: ...
_related_comodel_name: str | None
_related_string: str | None
_related_help: str | None
_related_groups: str | None
_related_group_operator: str | None
@property
def base_field(self): ...
def base_field(self) -> Field: ...
@property
def groupable(self): ...
def _default_company_dependent(self, model): ...
def _compute_company_dependent(self, records) -> None: ...
def _inverse_company_dependent(self, records) -> None: ...
def _search_company_dependent(self, records, operator, value): ...
def resolve_depends(self, registry) -> None: ...
def get_description(self, env): ...
_description_store: Any
def groupable(self) -> bool: ...
def _default_company_dependent(self, model: BaseModel): ...
def _compute_company_dependent(self, records: BaseModel) -> None: ...
def _inverse_company_dependent(self, records: BaseModel) -> None: ...
def _search_company_dependent(self, records: BaseModel, operator: str, value): ...
def resolve_depends(self, registry: Registry) -> Iterator[tuple]: ...
def get_description(self, env: Environment, attributes: Container[str] | None = ...) -> dict[str, Any]: ...
_description_name: str
_description_type: str
_description_store: bool | None
_description_manual: Any
_description_related: Any
_description_company_dependent: Any
_description_readonly: Any
_description_required: Any
_description_states: Any
_description_groups: Any
_description_change_default: Any
_description_deprecated: Any
_description_group_operator: Any
def _description_depends(self, env): ...
_description_related: str | None
_description_company_dependent: bool
_description_readonly: bool
_description_required: bool
_description_states: dict[str, list[tuple]] | None
_description_groups: str | None
_description_change_default: bool
_description_group_operator: str | None
_description_default_export_compatible: bool
def _description_depends(self, env: Environment): ...
@property
def _description_searchable(self): ...
def _description_searchable(self) -> bool: ...
@property
def _description_sortable(self): ...
def _description_string(self, env): ...
def _description_help(self, env): ...
def is_editable(self): ...
def null(self, record): ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_record_multi(self, values, records): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ...
def convert_to_onchange(self, value, record, names): ...
def convert_to_export(self, value, record): ...
def convert_to_display_name(self, value, record): ...
def update_db(self, model, columns): ...
def update_db_column(self, model, column) -> None: ...
def update_db_notnull(self, model, column) -> None: ...
def update_db_related(self, model) -> None: ...
def read(self, records) -> None: ...
def create(self, record_values) -> None: ...
def write(self, records, value): ...
# def __get__(self, record, owner): ...
def mapped(self, records): ...
def __set__(self, records, value): ...
def recompute(self, records) -> None: ...
def compute_value(self, records) -> None: ...
def determine_inverse(self, records) -> None: ...
def determine_domain(self, records, operator, value): ...
def _description_sortable(self) -> bool: ...
def _description_string(self, env: Environment) -> str | None: ...
def _description_help(self, env: Environment) -> str | None: ...
def is_editable(self) -> bool: ...
def null(self, record: BaseModel) -> bool: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_record_multi(self, values, records: 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 convert_to_export(self, value, record: BaseModel): ...
def convert_to_display_name(self, value, record: BaseModel): ...
@property
def column_order(self) -> int: ...
def update_db(self, model: BaseModel, columns: dict[str, Any]): ...
def update_db_column(self, model: BaseModel, column: dict | None) -> None: ...
def _convert_db_column(self, model: BaseModel, column: dict | None) -> None: ...
def update_db_notnull(self, model: BaseModel, column: dict | None) -> None: ...
def update_db_related(self, model: BaseModel) -> None: ...
def read(self, records: BaseModel) -> None: ...
def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records: _ModelT, value) -> _ModelT: ...
def __get__(self, record: Union[BaseModel, None], owner): ...
def mapped(self, records: BaseModel): ...
def __set__(self, records: BaseModel, 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):
type: str
column_type: Any
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_export(self, value, record): ...
column_type: type[str, str]
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> bool: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> bool: ...
def convert_to_export(self, value, record: BaseModel): ...
class Integer(Field):
type: str
column_type: Any
column_type: type[str, str]
group_operator: str
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def _update(self, records, value) -> None: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> int: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> int | None: ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def _update(self, records: BaseModel, value) -> None: ...
def convert_to_export(self, value, record): ...
class Float(Field):
type: str
column_cast_from: Any
_digits: Any
_digits: tuple[int, int] | str | None
group_operator: str
def __init__(self, string=..., digits=..., **kwargs) -> None: ...
def __init__(self, string: str = ..., digits: tuple[int, int] | str | None =..., **kwargs) -> None: ...
@property
def column_type(self): ...
def get_digits(self, env): ...
def get_digits(self, env: Environment) -> tuple[int, int]: ...
_related__digits: Any
def _description_digits(self, env): ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_export(self, value, record): ...
round: Any
is_zero: Any
compare: Any
def _description_digits(self, env: Environment) -> type[int, int]: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> float: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> float: ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_export(self, value, record: BaseModel): ...
round = float_utils.float_round
is_zero = float_utils.float_is_zero
compare = float_utils.float_compare
class Monetary(Field):
type: str
write_sequence: int
column_type: Any
column_cast_from: Any
currency_field: Any
column_type: tuple[str, str]
currency_field: str | None
group_operator: str
def __init__(self, string=..., currency_field=..., **kwargs) -> None: ...
def _description_currency_field(self, env): ...
def get_currency_field(self, model): ...
def setup_nonrelated(self, model) -> None: ...
def setup_related(self, model) -> None: ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ...
def __init__(self, string: str = ..., currency_field : str =..., **kwargs) -> None: ...
def _description_currency_field(self, env: Environment) -> str: ...
def get_currency_field(self, model: BaseModel) -> str: ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
def setup_related(self, model: BaseModel) -> None: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> float: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> float: ...
def convert_to_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): ...
class _String(Field):
translate: bool
prefetch: Any
def __init__(self, string=..., **kwargs) -> None: ...
def _setup_attrs(self, model_class, name) -> None: ...
_related_translate: Any
def _description_translate(self, env): ...
def get_trans_terms(self, value): ...
def get_trans_func(self, records): ...
def write(self, records, value): ...
translate: Callable | bool
unaccent: bool
def __init__(self, string: str = ..., **kwargs) -> None: ...
_related_translate: bool
def _description_translate(self, env: Environment) -> bool: ...
def _convert_db_column(self, model: BaseModel, column: dict) -> None: ...
def get_trans_terms(self, value) -> list: ...
def get_text_content(self, term): ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
def _convert_from_cache_to_column(self, value): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_write(self, value, record: BaseModel): ...
def get_trans_func(self, records: BaseModel) -> Callable: ...
def get_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):
type: str
column_cast_from: Any
size: Any
size: int | None
trim: bool
def _setup_attrs(self, model_class, name) -> None: ...
def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
@property
def column_type(self): ...
def update_db_column(self, model, column) -> None: ...
_related_size: Any
_related_trim: Any
_description_size: Any
_description_trim: Any
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def column_type(self) -> tuple[str, str]: ...
def update_db_column(self, model: BaseModel, column: dict | None) -> None: ...
_related_size: int | None
_related_trim: bool
_description_size: int | None
_description_trim: bool
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> str | None: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> str | None: ...
class Text(_String):
type: str
column_type: Any
column_cast_from: Any
def convert_to_cache(self, value, record, validate: bool = ...): ...
@property
def column_type(self) -> tuple[str, str]: ...
def convert_to_cache(self, value, record, validate: bool = ...) -> str | None: ...
class Html(_String):
type: str
column_type: Any
column_cast_from: Any
sanitize: bool
sanitize_overridable: bool
sanitize_tags: bool
sanitize_attributes: bool
sanitize_style: bool
sanitize_form: bool
strip_style: bool
strip_classes: bool
def _get_attrs(self, model_class, name): ...
_related_sanitize: Any
_related_sanitize_tags: Any
_related_sanitize_attributes: Any
_related_sanitize_style: Any
_related_strip_style: Any
_related_strip_classes: Any
_description_sanitize: Any
_description_sanitize_tags: Any
_description_sanitize_attributes: Any
_description_sanitize_style: Any
_description_strip_style: Any
_description_strip_classes: Any
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def get_trans_terms(self, value): ...
def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
@property
def column_type(self) -> tuple[str, str]: ...
_related_sanitize: bool
_related_sanitize_tags: bool
_related_sanitize_attributes: bool
_related_sanitize_style: bool
_related_strip_style: bool
_related_strip_classes: bool
_description_sanitize: bool
_description_sanitize_tags: bool
_description_sanitize_attributes: bool
_description_sanitize_style: bool
_description_strip_style: bool
_description_strip_classes: bool
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> Markup | None: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> Markup | None: ...
def _convert(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):
type: str
column_type: Any
column_cast_from: Any
column_type: tuple[str, str]
start_of = date_utils.start_of
end_of = date_utils.end_of
add = date_utils.add
@@ -276,19 +298,18 @@ class Date(Field):
@staticmethod
def today(*args) -> datetime.date: ...
@staticmethod
def context_today(record, timestamp: Any | None = ...) -> datetime.date: ...
def context_today(record: BaseModel, timestamp: datetime.datetime | None = ...) -> datetime.date: ...
@staticmethod
def to_date(value) -> datetime.date: ...
def to_date(value) -> datetime.date | None: ...
from_string = to_date
@staticmethod
def to_string(value): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_export(self, value, record): ...
def to_string(value: datetime.datetime | datetime.date) -> str: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> datetime.date | None: ...
def convert_to_export(self, value, record: BaseModel): ...
class Datetime(Field):
type: str
column_type: Any
column_cast_from: Any
column_type: tuple[str, str]
start_of = date_utils.start_of
end_of = date_utils.end_of
add = date_utils.add
@@ -298,124 +319,189 @@ class Datetime(Field):
@staticmethod
def today(*args) -> datetime.datetime: ...
@staticmethod
def context_timestamp(record, timestamp) -> datetime.datetime: ...
def context_timestamp(record: BaseModel, timestamp: datetime.datetime) -> datetime.datetime: ...
@staticmethod
def to_datetime(value) -> datetime.datetime: ...
def to_datetime(value) -> datetime.datetime | None: ...
from_string = to_datetime
@staticmethod
def to_string(value): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_export(self, value, record): ...
def convert_to_display_name(self, value, record): ...
def to_string(value: datetime.datetime | datetime.date) -> str: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> datetime.datetime | None: ...
def convert_to_export(self, value, record: BaseModel): ...
def convert_to_display_name(self, value, record: BaseModel) -> str: ...
_BINARY = memoryview
class Binary(Field):
type: str
prefetch: bool
_depends_context: Any
_depends_context: tuple[str]
attachment: bool
@property
def column_type(self): ...
def _get_attrs(self, model_class, name): ...
_description_attachment: Any
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def compute_value(self, records) -> None: ...
def read(self, records) -> None: ...
def create(self, record_values) -> None: ...
def write(self, records, value): ...
def column_type(self) -> tuple[str, str] | None: ...
def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
_description_attachment: bool
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> psycopg2.Binary | None: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> bytes | None: ...
def convert_to_record(self, value, record: BaseModel) -> bytes: ...
def compute_value(self, records: BaseModel) -> None: ...
def read(self, records: BaseModel) -> None: ...
def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records: _ModelT, value) -> _ModelT: ...
class Image(Binary):
max_width: int
max_height: int
verify_resolution: bool
def create(self, record_values) -> None: ...
def write(self, records, value) -> None: ...
def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records: BaseModel, value) -> None: ...
def _image_process(self, value): ...
def _process_related(self, value): ...
class Selection(Field):
type: str
column_type: Any
selection: Any
column_type: tuple[str, str]
selection: _SelectionRaw
validate: bool
ondelete: Any
def __init__(self, selection=..., string=..., **kwargs) -> None: ...
def setup_nonrelated(self, model) -> None: ...
def setup_related(self, model): ...
def _get_attrs(self, model_class, name): ...
def _setup_attrs(self, model_class, name) -> None: ...
def _selection_modules(self, model): ...
def _description_selection(self, env): ...
def _default_group_expand(self, records, groups, domain, order): ...
def get_values(self, env): ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_export(self, value, record): ...
ondelete: dict[str, Any] | None
def __init__(self, selection: _SelectionRaw = ..., string: str = ..., **kwargs) -> None: ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
def setup_related(self, model: BaseModel): ...
def _get_attrs(self, model_class: type[BaseModel], name: str) -> dict[str, Any]: ...
def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
def _selection_modules(self, model: BaseModel) -> dict[str, set[str, str]]: ...
def _description_selection(self, env: Environment) -> _Selection: ...
def _default_group_expand(self, records: BaseModel, groups, domain, order) -> _Selection: ...
def get_values(self, env: Environment) -> _Selection: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_export(self, value, record: BaseModel): ...
class Reference(Selection):
type: str
@property
def column_type(self): ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def convert_to_export(self, value, record): ...
def convert_to_display_name(self, value, record): ...
def column_type(self) -> tuple[str, str]: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...) -> str | None: ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...) -> str | None: ...
def convert_to_record(self, value, record: BaseModel) -> Union[BaseModel, None]: ...
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...) -> str | bool: ...
def convert_to_export(self, value, record: BaseModel) -> str: ...
def convert_to_display_name(self, value, record: BaseModel) -> str: ...
class _Relational(Field):
relational: bool
domain: Any
context: Any
domain: _DomainRaw
context: dict
check_company: bool
# def __get__(self, records, owner): ...
def __get__(self, records: Union[BaseModel, None], owner) -> BaseModel: ...
comodel_name: str
def setup_nonrelated(self, model) -> None: ...
def get_domain_list(self, model): ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
def get_domain_list(self, model: BaseModel) -> _Domain: ...
@property
def _related_domain(self): ...
_related_context: Any
_description_relation: Any
_description_context: Any
def _description_domain(self, env): ...
def null(self, record): ...
def _related_domain(self) -> _DomainRaw: ...
_related_context: dict
_description_relation: str | None
_description_context: dict
def _description_domain(self, env: Environment) -> _Domain: ...
def null(self, record: BaseModel) -> BaseModel: ...
class Many2one(_Relational):
type: str
column_type: Any
ondelete: Any
column_type: tuple[str, str]
ondelete: str | None
auto_join: bool
delegate: bool
def __init__(self, comodel_name=..., string=..., **kwargs) -> None: ...
def _setup_attrs(self, model_class, name) -> None: ...
def setup_nonrelated(self, model) -> None: ...
def update_db(self, model, columns): ...
def update_db_column(self, model, column) -> None: ...
def update_db_foreign_key(self, model, column) -> None: ...
def _update(self, records, value) -> None: ...
def convert_to_column(self, value, record, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_record_multi(self, values, records): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ...
def convert_to_export(self, value, record): ...
def convert_to_display_name(self, value, record): ...
def convert_to_onchange(self, value, record, names): ...
def write(self, records, value): ...
def _remove_inverses(self, records, value): ...
def _update_inverses(self, records, value) -> None: ...
def __init__(self, comodel_name: str = ..., string: str = ..., **kwargs) -> None: ...
def _setup_attrs(self, model_class: type[BaseModel], name: str) -> None: ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
def update_db(self, model: BaseModel, columns): ...
def update_db_column(self, model: BaseModel, column) -> None: ...
def update_db_foreign_key(self, model: BaseModel, column) -> None: ...
def _update(self, records: BaseModel, value) -> None: ...
def convert_to_column(self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_record_multi(self, values, records: BaseModel): ...
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record: BaseModel): ...
def convert_to_export(self, value, record: BaseModel) -> str: ...
def convert_to_display_name(self, value, record: BaseModel) -> str: ...
def convert_to_onchange(self, value, record: BaseModel, names): ...
def write(self, records: _ModelT, value) -> _ModelT: ...
def _remove_inverses(self, records: BaseModel, value): ...
def _update_inverses(self, records: BaseModel, value) -> None: ...
class Many2oneReference(Integer):
type: str
model_field: Any
_related_model_field: Any
def convert_to_cache(self, value, record, validate: bool = ...): ...
def _remove_inverses(self, records, value) -> None: ...
def _update_inverses(self, records, value) -> None: ...
def _record_ids_per_res_model(self, records): ...
model_field: str | None
_related_model_field: str | None
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def _remove_inverses(self, records: BaseModel, value) -> None: ...
def _update_inverses(self, records: BaseModel, value) -> None: ...
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):
CREATE: int
@@ -426,81 +512,93 @@ class Command(enum.IntEnum):
CLEAR: int
SET: int
@classmethod
def create(cls, values: dict): ...
def create(cls, values: dict) -> tuple[int, int, dict]: ...
@classmethod
def update(cls, id: int, values: dict): ...
def update(cls, id: int, values: dict) -> tuple[int, int, dict]: ...
@classmethod
def delete(cls, id: int): ...
def delete(cls, id: int) -> tuple[int, int, int]: ...
@classmethod
def unlink(cls, id: int): ...
def unlink(cls, id: int) -> tuple[int, int, int]: ...
@classmethod
def link(cls, id: int): ...
def link(cls, id: int) -> tuple[int, int, int]: ...
@classmethod
def clear(cls): ...
def clear(cls) -> tuple[int, int, int]: ...
@classmethod
def set(cls, ids: list): ...
def set(cls, ids: _SeqIntT) -> tuple[int, int, _SeqIntT]: ...
class _RelationalMulti(_Relational):
write_sequence: int
def _update(self, records, value): ...
def convert_to_cache(self, value, record, validate: bool = ...): ...
def convert_to_record(self, value, record): ...
def convert_to_record_multi(self, values, records): ...
def convert_to_read(self, value, record, use_name_get: bool = ...): ...
def convert_to_write(self, value, record): ...
def convert_to_export(self, value, record): ...
def convert_to_display_name(self, value, record) -> None: ...
def get_depends(self, model): ...
def create(self, record_values) -> None: ...
def write(self, records, value): ...
def write_batch(self, records_commands_list, create: bool = ...): ...
def _update(self, records: BaseModel, value): ...
def convert_to_cache(self, value, record: BaseModel, validate: bool = ...): ...
def convert_to_record(self, value, record: BaseModel): ...
def convert_to_record_multi(self, values, records: BaseModel): ...
def convert_to_read(self, value, record: BaseModel, use_name_get: bool = ...): ...
def convert_to_write(self, value, record: BaseModel): ...
def convert_to_export(self, value, record: BaseModel) -> str: ...
def convert_to_display_name(self, value, record: BaseModel) -> None: ...
def get_depends(self, model: BaseModel): ...
def create(self, record_values: list[tuple[BaseModel, Any]]) -> None: ...
def write(self, records: BaseModel, value): ...
def write_batch(self, records_commands_list: _CommandList, create: bool = ...): ...
class One2many(_RelationalMulti):
type: str
inverse_name: Any
inverse_name: str | None
auto_join: bool
limit: Any
copy: bool
def __init__(self, comodel_name=..., inverse_name=..., string=..., **kwargs) -> None: ...
def setup_nonrelated(self, model) -> None: ...
_description_relation_field: Any
def update_db(self, model, columns) -> None: ...
def get_domain_list(self, records): ...
# def __get__(self, records, owner): ...
def read(self, records): ...
def write_real(self, records_commands_list, create: bool = ...): ...
def write_new(self, records_commands_list): ...
def __init__(self, comodel_name: str = ..., inverse_name: str = ..., string: str = ..., **kwargs) -> None: ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
_description_relation_field: str | None
def update_db(self, model: BaseModel, columns) -> None: ...
def get_domain_list(self, records: BaseModel): ...
def __get__(self, records: BaseModel, owner) -> BaseModel: ...
def read(self, records: BaseModel): ...
def write_real(self, records_commands_list: _CommandList, create: bool = ...): ...
def write_new(self, records_commands_list: _CommandList): ...
class Many2many(_RelationalMulti):
type: str
_explicit: bool
relation: Any
column1: Any
column2: Any
relation: str | None
column1: str | None
column2: str | None
auto_join: bool
limit: Any
ondelete: Any
def __init__(self, comodel_name=..., relation=..., column1=..., column2=..., string=..., **kwargs) -> None: ...
def setup_nonrelated(self, model) -> None: ...
def update_db(self, model, columns) -> None: ...
def update_db_foreign_keys(self, model) -> None: ...
ondelete: str
def __init__(self, comodel_name: str =..., relation: str = ..., column1: str = ..., column2: str = ..., string: str = ..., **kwargs) -> None: ...
def setup_nonrelated(self, model: BaseModel) -> None: ...
def update_db(self, model: BaseModel, columns) -> None: ...
def update_db_foreign_keys(self, model: BaseModel) -> None: ...
@property
def groupable(self): ...
def read(self, records) -> None: ...
def write_real(self, records_commands_list, create: bool = ...): ...
def write_new(self, records_commands_list): ...
def groupable(self) -> bool: ...
def read(self, records: BaseModel) -> None: ...
def write_real(self, records_commands_list: _CommandList, create: bool = ...): ...
def write_new(self, records_commands_list: _CommandList): ...
class Id(Field):
type: str
column_type: Any
column_type: tuple[str, str]
string: str
store: bool
readonly: bool
prefetch: bool
def update_db(self, model, columns) -> None: ...
def __get__(self, record, owner): ...
def __set__(self, record, value) -> None: ...
def update_db(self, model: BaseModel, columns) -> None: ...
def __get__(self, record: BaseModel, owner): ...
def __set__(self, record: BaseModel, value) -> None: ...
def prefetch_many2one_ids(record, field): ...
def prefetch_x2many_ids(record, field): ...
def apply_required(model, field_name) -> None: ...
class PrefetchMany2one:
__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]: ...
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 .models import BaseModel
from .modules.registry import Registry
from .sql_db import Cursor
from .tools._vendor import sessions
from .tools.geoipresolver import GeoIPResolver
from .tools.profiler import Profiler
_logger: Any
rpc_request: Any
rpc_response: Any
STATIC_CACHE: Any
STATIC_CACHE_LONG: Any
ALLOWED_DEBUG_MODES: Any
_request_stack: Any
request: Union[HttpRequest, JsonRequest]
_T = TypeVar('_T')
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:
httprequest: werkzeug.wrappers.Request
httpresponse: Response
disable_db: bool
endpoint: Any
endpoint_arguments: Any
auth_method: Any
website = Environment['website']
lang = Environment['res.lang']
_cr: Cursor
_uid: int
_context: dict
_env: Environment
_failed: Any
def __init__(self, httprequest) -> None: ...
class SessionExpiredException(Exception): ...
def content_disposition(filename: str) -> str: ...
def db_list(force: bool = ..., host: str | None = ...) -> list[str]: ...
def db_filter(dbs: Iterable[str], host: str | None = ...) -> list[str]: ...
def is_cors_preflight(request: Request, endpoint) -> bool: ...
def serialize_exception(exception: Exception): ...
def send_file(filepath_or_fp, mimetype: str | None = ..., as_attachment: bool = ..., filename: str | None = ...,
mtime: str | None = ..., add_etags: bool = ..., cache_timeout: int = ..., conditional: bool = ...) -> werkzeug.Response: ...
class Stream:
type: str
data: bytes | None
path: str | 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
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
def uid(self) -> int: ...
@uid.setter
def uid(self, val) -> None: ...
def uid(self, value) -> None: ...
@property
def context(self): ...
@context.setter
def context(self, val) -> None: ...
def cr(self) -> Cursor: ...
@cr.setter
def cr(self, value) -> None: ...
_cr: Cursor
@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
def session(self) -> OpenERPSession: ...
def __enter__(self): ...
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: ...
def statics(self) -> dict[str, str]: ...
def get_static_file(self, url: str, host: str = ...) -> str | None: ...
@property
def registry(self) -> Registry: ...
def nodb_routing_map(self) -> Map: ...
@property
def db(self): ...
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: ...
def session_store(self) -> FilesystemSessionStore: ...
@property
def first_arg_is_req(self): ...
def __call__(self, *args, **kw): ...
def geoip_resolver(self) -> GeoIPResolver | None: ...
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 = ...): ...
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
root: Application

View File

@@ -1,4 +1,4 @@
from typing import Any
from typing import Generator
LOG_NOTSET: str
LOG_DEBUG: str
@@ -7,9 +7,9 @@ LOG_WARNING: str
LOG_ERROR: 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 exception_to_unicode(e): ...
def ustr(value, hint_encoding: str = ..., errors: str = ...) -> str: ...
def exception_to_unicode(e: BaseException) -> str: ...

View File

@@ -1,329 +1,337 @@
from collections.abc import MutableMapping
from typing import Any, Generator, List, TypeVar
from collections import defaultdict
from re import Pattern
from typing import Any, Callable, Collection, Container, Iterable, Iterator, MutableMapping, Sequence, TypeVar, Union
import psycopg2
from . import api, fields
from .api import Environment
from .fields import Field
from .modules.registry import Registry
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
_schema: Any
_unlink: Any
regex_order: Any
regex_object_name: Any
regex_pg_name: Any
regex_field_agg: Any
regex_order: Pattern[str]
regex_object_name: Pattern[str]
regex_pg_name: Pattern[str]
regex_field_agg: Pattern[str]
AUTOINIT_RECALCULATE_STORED_FIELDS: int
INSERT_BATCH_SIZE: int
SQL_DEFAULT: psycopg2.extensions.AsIs
def check_object_name(name): ...
def raise_on_invalid_object_name(name) -> None: ...
def check_pg_name(name) -> None: ...
def check_object_name(name: str) -> bool: ...
def raise_on_invalid_object_name(name: str) -> None: ...
def check_pg_name(name: str) -> None: ...
regex_private: Any
regex_private: Pattern[str]
def check_method_name(name) -> None: ...
def same_name(f, g): ...
def fix_import_export_id_paths(fieldname): ...
def trigger_tree_merge(node1, node2) -> None: ...
def check_method_name(name: str) -> None: ...
def fix_import_export_id_paths(fieldname: str) -> list[str]: ...
def merge_trigger_trees(trees: list, select: Callable[[Any], bool] = ...) -> dict: ...
class MetaModel(api.Meta):
module_to_models: Any
def __new__(meta, name, bases, attrs): ...
def __init__(self, name, bases, attrs) -> None: ...
module_to_models: defaultdict[str, list[type[BaseModel]]]
def __new__(meta, name: str, bases: tuple, attrs: dict): ...
def __init__(self: type[BaseModel], name: str, bases: tuple, attrs: dict) -> None: ...
class NewId:
__slots__: Any
origin: Any
__slots__: list[str]
origin: int | None
ref: Any
def __init__(self, origin: Any | None = ..., ref: Any | None = ...) -> None: ...
def __bool__(self): ...
def __eq__(self, other): ...
def __hash__(self): ...
def __repr__(self): ...
def __str__(self): ...
def __init__(self, origin: int | None = ..., ref: Any | None = ...) -> None: ...
def __bool__(self) -> bool: ...
def __eq__(self, other) -> bool: ...
def __hash__(self) -> int: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def origin_ids(ids): ...
def expand_ids(id0, ids) -> None: ...
def origin_ids(ids: Iterable) -> Iterator[int]: ...
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
LOG_ACCESS_COLUMNS: Any
MAGIC_COLUMNS: Any
VALID_AGGREGATE_FUNCTIONS: Any
LOG_ACCESS_COLUMNS: list[str]
MAGIC_COLUMNS: list[str]
VALID_AGGREGATE_FUNCTIONS: set[str]
def is_definition_class(cls): ...
def is_registry_class(cls): ...
def is_definition_class(cls) -> bool: ...
def is_registry_class(cls) -> bool: ...
class BaseModel(metaclass=MetaModel):
__slots__: Any
__slots__: list[str]
_auto: bool
_register: bool
_abstract: bool
_transient: bool
_name: str
_description: str
_module: Any
_module: str
_custom: bool
_inherit: Any
_inherits: Any
_inherit: tuple[str]
_inherits: dict[str, str]
_table: str
_table_query: Any
_sequence: Any
_sql_constraints: Any
_rec_name: str
_table_query: str | None
_sql_constraints: list[tuple[str, str, str]]
_rec_name: str | None
_rec_names_search: Sequence[str] | None
_order: str
_parent_name: str
_parent_store: bool
_active_name: Any
_date_name: str
_active_name: str | None
_fold_name: str
_needaction: bool
_translate: bool
_check_company_auto: bool
_depends: Any
_transient_max_count: Any
_transient_max_hours: Any
_fields: dict[str, fields.Field]
_ids: List[int]
_prefetch_ids: List[int]
_depends: dict[str, Iterable[str]]
_transient_max_count: int
_transient_max_hours: float
_original_module: str
_inherit_module: dict[str, str]
_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 = ...
pool: Registry
id = fields.Id()
display_name = fields.Char()
create_uid = fields.Many2one('res.users')
create_date = fields.Datetime()
write_uid = fields.Many2one('res.users')
write_date = fields.Datetime()
display_name = fields.Char(string='Display Name')
create_uid = fields.Many2one('res.users', string='Created by')
create_date = fields.Datetime(string='Created on')
write_uid = fields.Many2one('res.users', string='Last Updated by')
write_date = fields.Datetime(string='Last Updated on')
CONCURRENCY_CHECK_FIELD: str
def view_init(self, fields_list) -> None: ...
def _valid_field_parameter(self, field, name): ...
def _add_field(self, name, field) -> None: ...
def _pop_field(self, name): ...
def _valid_field_parameter(self, field: Field, name: str) -> bool: ...
def _add_field(self, name: str, field: Field) -> None: ...
def _pop_field(self, name: str) -> Field: ...
def _compute_concurrency_field(self) -> None: ...
@classmethod
def _build_model(cls, pool, cr): ...
def _build_model(cls, pool: Registry, cr: Cursor) -> BaseModel: ...
@classmethod
def _build_model_check_base(model_class, cls) -> None: ...
def _build_model_check_base(model_class, cls: type[BaseModel]) -> None: ...
@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
def _build_model_attributes(cls, pool) -> None: ...
def _build_model_attributes(cls, pool: Registry) -> None: ...
@classmethod
def _init_constraints_onchanges(cls) -> None: ...
@property
def _constraint_methods(self): ...
def _constraint_methods(self) -> list: ...
@property
def _ondelete_methods(self): ...
def _ondelete_methods(self) -> list: ...
@property
def _onchange_methods(self): ...
def __new__(cls) -> None: ...
def __init__(self, pool, cr) -> None: ...
def _is_an_ordinary_table(self): ...
def __ensure_xml_id(self, skip: bool = ...): ...
def _export_rows(self, fields, *, _is_toplevel_call: bool = ...): ...
__export_rows: Any
def export_data(self, fields_to_export): ...
def load(self, fields, data): ...
def _add_fake_fields(self, fields): ...
def _extract_records(self, fields_, data, log=..., limit=...): ...
def _convert_records(self, records, log=...) -> None: ...
def _validate_fields(self, field_names, excluded_names=...) -> None: ...
def default_get(self, fields_list): ...
def fields_get_keys(self): ...
def _rec_name_fallback(self): ...
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 _onchange_methods(self) -> dict[str, list]: ...
def _is_an_ordinary_table(self) -> bool: ...
def __ensure_xml_id(self: _ModelT, skip: bool = ...) -> Iterator[tuple[_ModelT, str | None]]: ...
def _export_rows(self, fields: list[list[str]], *, _is_toplevel_call: bool = ...) -> list[list]: ...
def export_data(self, fields_to_export: list[str]) -> dict[str, list[list]]: ...
def load(self, fields: list[str], data: list[list[str]]) -> dict[str, Any]: ...
def _add_fake_fields(self, fields: dict[str | None, Field]) -> dict[str | None, Field]: ...
def _extract_records(self, fields_: Iterable[Sequence[str]], data, log: Callable = ..., limit: float = ...) -> Iterator[tuple[BaseModel, dict[str, dict[str, int]]]]: ...
def _convert_records(self, records, log: Callable = ...) -> Iterator[tuple[Any, Any, Any, dict]]: ...
def _validate_fields(self, field_names: Iterable[str], excluded_names: Iterable[str] = ...) -> None: ...
def default_get(self, fields_list: list[str]) -> dict[str, Any]: ...
def fields_get_keys(self) -> list[str]: ...
def _rec_name_fallback(self) -> str: ...
def user_has_groups(self, groups: str) -> bool: ...
def search_count(self, domain: _Domain, limit: int | None = ...) -> int: ...
def search(self: _ModelT, domain: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: bool = ...) -> _ModelT | int: ...
def _compute_display_name(self) -> None: ...
def name_get(self): ...
def name_create(self, name): ...
def name_search(self, name: str = ..., args: Any | None = ..., operator: str = ..., limit: int = ...): ...
def _name_search(self, name: str = ..., args: Any | None = ..., operator: str = ..., limit: int = ..., name_get_uid: Any | None = ...): ...
def _add_missing_default_values(self, values): ...
def name_get(self) -> list[tuple[int, str]]: ...
def name_create(self, name: str) -> tuple[int, str]: ...
def name_search(self, name: str = ..., args: _Domain | None = ..., operator: str = ..., limit: int = ...) -> list[tuple[int, str]]: ...
def _name_search(self, name: str = ..., args: _Domain | None = ..., operator: str = ..., limit: int = ..., name_get_uid: int | None = ...) -> list[int]: ...
def _add_missing_default_values(self, values: dict[str, Any]) -> dict[str, Any]: ...
@classmethod
def clear_caches(cls) -> None: ...
def _read_group_expand_full(self, groups, domain, order): ...
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_temporal(self, data, groupby, aggregated_fields, annotated_groupbys, fill_from: bool = ..., fill_to: bool = ..., min_groups: bool = ...): ...
def _read_group_prepare(self, orderby, aggregated_fields, annotated_groupbys, query): ...
def _read_group_process_groupby(self, gb, query): ...
def _read_group_prepare_data(self, key, value, groupby_dict): ...
def _read_group_format_result(self, data, annotated_groupbys, groupby, domain): ...
def read_group(self, domain, fields, groupby, offset: int = ..., limit: Any | None = ..., orderby: bool = ..., lazy: bool = ...): ...
def _read_group_raw(self, domain, fields, groupby, offset: int = ..., limit: Any | None = ..., orderby: bool = ..., lazy: bool = ...): ...
def _read_group_resolve_many2x_fields(self, data, fields) -> None: ...
def _inherits_join_add(self, current_model, parent_model_name, query): ...
def _inherits_join_calc(self, alias, fname, query): ...
def _read_group_expand_full(self, groups: _ModelT, domain: _Domain | None, order: str | None) -> _ModelT: ...
def _read_group_fill_results(self, domain: _Domain, groupby: str, remaining_groupbys: list[str], aggregated_fields: list[str], count_field: str, read_group_result, read_group_order: str | None = ...) -> list: ...
def _read_group_fill_temporal(self, data: list, groupby: list[str], aggregated_fields: list[str], annotated_groupbys: list[dict], fill_from: str | None = ..., fill_to: str | None = ..., min_groups: int | None = ...) -> list: ...
def _read_group_prepare(self, orderby: str, aggregated_fields: list[str], annotated_groupbys: list[dict], query: Query) -> tuple[list, list]: ...
def _read_group_process_groupby(self, gb: str, query: Query) -> dict[str, Any]: ...
def _read_group_prepare_data(self, key, value, groupby_dict: dict[str, dict[str, Any]]) -> Any: ...
def _read_group_format_result(self, data: dict, annotated_groupbys: list[dict], groupby: list, domain: _Domain) -> dict: ...
def _read_group(self, domain: _Domain, fields: list[str], groupby: str | list[str], offset: int = ..., limit: int | None = ..., orderby: str | None = ..., lazy: bool = ...) -> list[dict[str, Any]]: ...
def read_group(self, domain: _Domain, fields: list[str], groupby: str | list[str], offset: int = ..., limit: int | None = ..., orderby: str | None = ..., lazy: bool = ...) -> list[dict[str, Any]]: ...
def _read_group_raw(self, domain: _Domain, fields: list[str], groupby: str | list[str], offset: int = ..., limit: int | None = ..., orderby: str | None = ..., lazy: bool = ...) -> list[dict[str, Any]]: ...
def _read_group_resolve_many2x_fields(self, data: list[dict[str, Any]], fields: list[dict[str, Any]]) -> None: ...
def _inherits_join_add(self, current_model: BaseModel, parent_model_name: str, query: Query) -> str: ...
def _inherits_join_calc(self, alias: str, fname: str, query: Query) -> str: ...
def _parent_store_compute(self): ...
def _check_removed_columns(self, log: bool = ...) -> None: ...
def _init_column(self, column_name) -> None: ...
def _table_has_rows(self): ...
def _init_column(self, column_name: str) -> None: ...
def _table_has_rows(self) -> int: ...
def _auto_init(self): ...
def init(self) -> None: ...
def _create_parent_columns(self) -> None: ...
def _check_parent_path(self) -> None: ...
def _add_sql_constraints(self) -> None: ...
def _execute_sql(self) -> None: ...
def _add_inherited_fields(self) -> None: ...
def _inherits_check(self) -> None: ...
def _prepare_setup(self) -> None: ...
def _setup_base(self) -> None: ...
def _setup_fields(self) -> None: ...
def _setup_complete(self) -> None: ...
def fields_get(self, allfields: Any | None = ..., attributes: Any | None = ...): ...
def get_empty_list_help(self, help): ...
def check_field_access_rights(self, operation, fields): ...
def read(self, fields: list[str] | None = ..., load: str = ...) -> list[dict[str, Any]]: ...
def _read_format(self, fnames, load: str = ...): ...
def _fetch_field(self, field) -> None: ...
def _read(self, fields: list[str]): ...
def get_metadata(self): ...
def get_base_url(self): ...
def _check_concurrency(self) -> None: ...
def _check_company(self, fnames: Any | None = ...) -> None: ...
def check_access_rights(self, operation, raise_exception: bool = ...): ...
def check_access_rule(self, operation) -> None: ...
def _filter_access_rules(self, operation): ...
def _filter_access_rules_python(self, operation): ...
def fields_get(self, allfields: list[str] | None = ..., attributes: list[str] | None = ...) -> dict[str, dict[str, Any]]: ...
def check_field_access_rights(self, operation: str, fields: Collection[str]): ...
def read(self, fields: Collection[str] | None = ..., load: str = ...) -> list[dict[str, Any]]: ...
def update_field_translations(self, field_name: str, translations: dict[str, Any]) -> bool: ...
def _update_field_translations(self, field_name: str, translations: dict[str, Any], digest: Callable | None = ...) ->bool: ...
def get_field_translations(self, field_name: str, langs: list[str] | None = ...) -> tuple[list[dict[str, Any]], dict[str, Any]]: ...
def _read_format(self, fnames: Collection[str], load: str = ...) -> list[dict[str, Any]]: ...
def _fetch_field(self, field: Field) -> None: ...
def _read(self, field_names: Collection[str]): ...
def get_metadata(self) -> list[dict[str, Any]]: ...
def get_base_url(self) -> str: ...
def _check_company(self, fnames: Collection[str] | None = ...) -> None: ...
def check_access_rights(self, operation: str, raise_exception: bool = ...) -> bool: ...
def check_access_rule(self, operation: str) -> None: ...
def _filter_access_rules(self: _ModelT, operation: str) -> _ModelT: ...
def _filter_access_rules_python(self, operation: str) -> _ModelT: ...
def unlink(self): ...
def write(self, vals: dict[str, Any]): ...
def _write(self, vals: dict[str, Any]): ...
def create(self: _M, vals_list: list[dict[str, Any]] | dict[str, Any]) -> _M: ...
def _create(self: _M, data_list: list[dict[str, Any]]) -> _M: ...
def _compute_field_value(self, field) -> None: ...
def _write(self, vals: dict[str, Any]) -> None: ...
def create(self: _ModelT, vals_list: list[dict[str, Any]] | dict[str, Any]) -> _ModelT: ...
def _prepare_create_values(self, vals_list: list[dict[str, Any]]) -> list[dict[str, Any]]: ...
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_update_prepare(self, vals): ...
def _parent_store_update_prepare(self: _ModelT, vals: dict) -> _ModelT: ...
def _parent_store_update(self) -> None: ...
def _load_records_write(self, values) -> None: ...
def _load_records_create(self, values): ...
def _load_records(self, data_list, update: bool = ...): ...
def _where_calc(self, domain, active_test: bool = ...): ...
def _check_qorder(self, word): ...
def _apply_ir_rules(self, query, mode: str = ...) -> None: ...
def _generate_translated_field(self, table_alias, field, query): ...
def _generate_m2o_order_by(self, alias, order_field, query, reverse_direction, seen): ...
def _generate_order_by_inner(self, alias, order_spec, query, reverse_direction: bool = ..., seen: Any | None = ...): ...
def _generate_order_by(self, order_spec, query): ...
def _flush_search(self, domain, fields: Any | None = ..., order: Any | None = ..., seen: Any | None = ...) -> None: ...
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: Any | None = ...): ...
def copy_translations(old, new, excluded=...): ...
def copy(self: _M, default: Any | None = ...) -> _M: ...
def exists(self: _M) -> _M: ...
def _check_recursion(self, parent: Any | None = ...): ...
def _check_m2m_recursion(self, field_name): ...
def _get_external_ids(self): ...
def get_external_id(self): ...
get_xml_id: Any
_get_xml_ids: Any
def _load_records_write(self, values: dict[str, Any]) -> None: ...
def _load_records_create(self, values: list[dict[str, Any]]): ...
def _load_records(self, data_list: list[dict], update: bool = ...) -> BaseModel: ...
def _where_calc(self, domain: _Domain, active_test: bool = ...) -> Query: ...
def _check_qorder(self, word: str) -> bool: ...
def _apply_ir_rules(self, query: Query, mode: str = ...) -> None: ...
def _generate_m2o_order_by(self, alias: str, order_field: str, query: Query, reverse_direction: bool, seen: set | None) -> list[str]: ...
def _generate_order_by_inner(self, alias: str, order_spec: str, query: Query, reverse_direction: bool = ..., seen: set | None = ...) -> list[str]: ...
def _generate_order_by(self, order_spec: str | None, query: Query) -> str: ...
def _flush_search(self, domain: _Domain, fields: Sequence[str] | None = ..., order: str | None = ..., seen: set | None = ...) -> None: ...
def _search(self: _ModelT, domain: _Domain, offset: int = ..., limit: int | None = ..., order: str | None = ..., count: bool = ..., access_rights_uid: int | None = ...) -> Query | int: ...
def copy_data(self, default: dict[str, Any] | None = ...) -> list[dict[str, Any]]: ...
def copy_translations(self: _ModelT, new: _ModelT, excluded: Container[str] = ...) -> None: ...
def copy(self: _ModelT, default: dict[str, Any] | None = ...) -> _ModelT: ...
def exists(self: _ModelT) -> _ModelT: ...
def _check_recursion(self, parent: str | None = ...) -> bool: ...
def _check_m2m_recursion(self, field_name: str) -> bool: ...
def _get_external_ids(self) -> dict[int, list[str]]: ...
def get_external_id(self) -> dict[int, str]: ...
def get_xml_id(self) -> dict[int, str]: ...
@classmethod
def is_transient(cls): ...
def search_read(self, domain: Any | None = ..., fields: Any | None = ..., offset: int = ..., limit: Any | None = ..., order: Any | None = ..., **read_kwargs): ...
def is_transient(cls) -> bool: ...
def search_read(self, domain: _Domain | None = ..., fields: list[str] | None = ..., offset: int = ..., limit: int | None = ..., order: str | None = ..., **read_kwargs: str) -> list[dict[str, Any]]: ...
def toggle_active(self) -> None: ...
def action_archive(self): ...
def action_unarchive(self): ...
def _register_hook(self) -> None: ...
def _unregister_hook(self) -> None: ...
@classmethod
def _patch_method(cls, name, method) -> None: ...
def _patch_method(cls, name: str, method) -> None: ...
@classmethod
def _revert_method(cls, name) -> None: ...
@classmethod
def _browse(cls, env, ids, prefetch_ids): ...
def browse(self: _M, ids: Any | None = ...) -> _M: ...
def _revert_method(cls, name: str) -> None: ...
def __init__(self, env: Environment, ids: tuple, prefetch_ids: Iterable[int]) -> None: ...
def browse(self: _ModelT, ids: int | NewId | Iterable[int | NewId] | None = ...) -> _ModelT: ...
@property
def ids(self) -> list[int]: ...
_cr: Cursor
_uid: int
_context: dict
def ensure_one(self: _M) -> _M: ...
def with_env(self: _M, env) -> _M: ...
def sudo(self: _M, flag: bool = ...) -> _M: ...
def with_user(self: _M, user) -> _M: ...
def with_company(self: _M, company) -> _M: ...
def with_context(self: _M, *args, **kwargs) -> _M: ...
def with_prefetch(self: _M, prefetch_ids: Any | None = ...) -> _M: ...
def _update_cache(self, values, validate: bool = ...): ...
def _convert_to_record(self, values): ...
def ensure_one(self: _ModelT) -> _ModelT: ...
def with_env(self: _ModelT, env: Environment) -> _ModelT: ...
def sudo(self: _ModelT, flag: bool = ...) -> _ModelT: ...
def with_user(self: _ModelT, user: Union['odoo.model.res_partner', int]) -> _ModelT: ...
def with_company(self: _ModelT, company: Union['odoo.model.res_company', int]) -> _ModelT: ...
def with_context(self: _ModelT, *args, **kwargs) -> _ModelT: ...
def with_prefetch(self: _ModelT, prefetch_ids: Iterable[int] | None = ...) -> _ModelT: ...
def _update_cache(self, values: dict[str, Any], validate: bool = ...): ...
def _convert_to_record(self, values: dict[str, Any]): ...
def _convert_to_write(self, values: dict[str, Any]) -> dict[str, Any]: ...
def _mapped_func(self, func): ...
def mapped(self, func): ...
def _mapped_cache(self, name_seq): ...
def filtered(self: _M, func) -> _M: ...
def filtered_domain(self: _M, domain) -> _M: ...
def sorted(self: _M, key: Any | None = ..., reverse: bool = ...) -> _M: ...
def update(self, values) -> None: ...
def flush(self, fnames: Any | None = ..., records: Any | None = ...) -> None: ...
def new(self: _M, values=..., origin: Any | None = ..., ref: Any | None = ...) -> _M: ...
def _mapped_func(self, func: Callable): ...
def mapped(self, func: Callable | str): ...
def filtered(self: _ModelT, func: Callable | str) -> _ModelT: ...
def filtered_domain(self: _ModelT, domain: _Domain) -> _ModelT: ...
def sorted(self: _ModelT, key: Callable | str | None = ..., reverse: bool = ...) -> _ModelT: ...
def update(self, values: dict[str, Any]) -> None: ...
def flush(self, fnames: Collection[str] | None = ..., records: BaseModel | None = ...) -> None: ...
def flush_model(self, fnames: Iterable[str] | None = ...) -> None: ...
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
def _origin(self: _M) -> _M: ...
def _origin(self: _ModelT) -> _ModelT: ...
def __bool__(self) -> bool: ...
__nonzero__: Any
def __len__(self) -> int: ...
def __iter__(self: _M) -> Generator[_M]: ...
def __contains__(self, item) -> bool: ...
def __add__(self: _M, other) -> _M: ...
def concat(self: _M, *args) -> _M: ...
def __sub__(self: _M, other) -> _M: ...
def __and__(self: _M, other) -> _M: ...
def __or__(self: _M, other) -> _M: ...
def union(self: _M, *args) -> _M: ...
def __eq__(self, other) -> bool: ...
def __lt__(self, other) -> bool: ...
def __le__(self, other) -> bool: ...
def __gt__(self, other) -> bool: ...
def __ge__(self, other) -> bool: ...
def __iter__(self: _ModelT) -> Iterator[_ModelT]: ...
def __reversed__(self) -> Iterator[_ModelT]: ...
def __contains__(self: _ModelT, item: _ModelT | str) -> bool: ...
def __add__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def concat(self: _ModelT, *args: _ModelT) -> _ModelT: ...
def __sub__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def __and__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def __or__(self: _ModelT, other: _ModelT) -> _ModelT: ...
def union(self: _ModelT, *args: _ModelT) -> _ModelT: ...
def __eq__(self: _ModelT, other: _ModelT) -> bool: ...
def __lt__(self: _ModelT, other: _ModelT) -> bool: ...
def __le__(self: _ModelT, other: _ModelT) -> bool: ...
def __gt__(self: _ModelT, other: _ModelT) -> bool: ...
def __ge__(self: _ModelT, other: _ModelT) -> bool: ...
def __int__(self): ...
def __repr__(self): ...
def __repr__(self) -> str: ...
def __hash__(self) -> int: ...
def __getitem__(self, key): ...
def __setitem__(self, key, value): ...
def __getitem__(self, key: str | int | slice): ...
def __setitem__(self, key: str, value): ...
@property
def _cache(self): ...
def _in_cache_without(self, field, limit=...): ...
def _cache(self) -> RecordCache: ...
def _in_cache_without(self: _ModelT, field: Field, limit: int = ...) -> _ModelT: ...
def refresh(self) -> None: ...
def invalidate_cache(self, fnames: Any | None = ..., ids: Any | None = ...): ...
def modified(self, fnames, create: bool = ..., before: bool = ...) -> None: ...
def _modified_triggers(self, tree, create: bool = ...): ...
def recompute(self, fnames: Any | None = ..., records: Any | None = ...) -> None: ...
def _dependent_fields(self, field): ...
def _has_onchange(self, field, other_fields): ...
def _onchange_spec(self, view_info: Any | None = ...): ...
def _onchange_eval(self, field_name, onchange, result) -> None: ...
def onchange(self, values, field_name, field_onchange): ...
def _get_placeholder_filename(self, field): ...
def _populate_factories(self): ...
def invalidate_cache(self, fnames: Collection[str] | None = ..., ids: Iterable[int] | None = ...) -> None: ...
def invalidate_model(self, fnames: Iterable[str] | None = ..., flush: bool = ...) -> None: ...
def invalidate_recordset(self, fnames: Iterable[str] | None = ..., flush: bool = ...) -> None: ...
def _invalidate_cache(self, fnames: Iterable[str] | None = ..., ids: Iterable[int] | None = ...) -> None: ...
def modified(self, fnames: Collection[str], create: bool = ..., before: bool = ...) -> None: ...
def _modified_triggers(self: _ModelT, tree: dict[Field | None, Any], create: bool = ...) -> Iterator[tuple[Field, _ModelT, bool]]: ...
def recompute(self, fnames: Collection[str] | None = ..., records: Union[BaseModel, None] = ...) -> None: ...
def _recompute_model(self, fnames: Iterable[str] | None = ...) -> None: ...
def _recompute_recordset(self, fnames: Iterable[str] | None = ...) -> None: ...
def _recompute_field(self, field: Field, ids: Iterable[int] | None = ...) -> None: ...
@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
def _populate_sizes(self): ...
def _populate_sizes(self) -> dict[str, int]: ...
@property
def _populate_dependencies(self): ...
def _populate(self, size): ...
def _populate_dependencies(self) -> list[str]: ...
def _populate(self: _ModelT, size: str) -> _ModelT: ...
class RecordCache(MutableMapping):
__slots__: Any
_record: Any
def __init__(self, record) -> None: ...
def __contains__(self, name): ...
def __getitem__(self, name): ...
def __setitem__(self, name, value) -> None: ...
def __delitem__(self, name) -> None: ...
def __iter__(self): ...
def __len__(self): ...
_record: BaseModel
def __init__(self, record: BaseModel) -> None: ...
def __contains__(self, name: str) -> bool: ...
def __getitem__(self, name: str) -> Any: ...
def __setitem__(self, name: str, value: Any) -> None: ...
def __delitem__(self, name: str) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __len__(self) -> int: ...
AbstractModel = BaseModel
class Model(AbstractModel):
@@ -338,14 +346,14 @@ class TransientModel(Model):
_abstract: bool
_transient: bool
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 itemgetter_tuple(items): ...
def convert_pgerror_not_null(model, fields, info, e): ...
def convert_pgerror_unique(model, fields, info, e): ...
def convert_pgerror_constraint(model, fields, info, e): ...
def itemgetter_tuple(items) -> Callable[..., tuple]: ...
def convert_pgerror_not_null(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
def convert_pgerror_unique(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
def convert_pgerror_constraint(model: BaseModel, fields: dict[str, dict[str, Any]], info, e: psycopg2.Error) -> dict[str, str]: ...
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 odoo.modules.loading import load_modules as load_modules, reset_modules_state as reset_modules_state
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
from . import (
db as db,
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 initialize(cr) -> None: ...
def create_categories(cr, categories): ...
def has_unaccent(cr): ...
def has_trigram(cr): ...
def is_initialized(cr: Cursor) -> bool: ...
def initialize(cr: Cursor) -> None: ...
def create_categories(cr: Cursor, categories: list[str]) -> int | None: ...
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):
def add_node(self, name, info): ...
def update_from_db(self, cr) -> None: ...
def add_module(self, cr, module, force: Any | None = ...) -> None: ...
def add_modules(self, cr, module_list, force: Any | None = ...): ...
def __iter__(self): ...
def __str__(self): ...
class Graph(dict[str, Node]):
def add_node(self, name: str, info: dict[str, Any]) -> Node: ...
def update_from_db(self, cr: Cursor) -> None: ...
def add_module(self, cr: Cursor, module: str, force: list | None = ...) -> None: ...
def add_modules(self, cr: Cursor, module_list: list[str], force: list | None = ...): ...
def __iter__(self) -> Iterator[Node]: ...
def __str__(self) -> str: ...
class Node:
def __new__(cls, name, graph, info): ...
name: Any
graph: Any
info: Any
children: Any
def __new__(cls, name: str, graph: Graph, info: dict[str, Any]) -> Node: ...
id: int
name: str
graph: Graph
info: dict[str, Any]
children: list[Node]
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
def data(self): ...
def add_child(self, name, info): ...
def __setattr__(self, name, value) -> None: ...
def __iter__(self): ...
def __str__(self): ...
def _pprint(self, depth: int = ...): ...
def should_have_demo(self): ...
def data(self) -> dict[str, Any]: ...
def add_child(self, name: str, info: dict[str, Any]): ...
def __setattr__(self, name: str, value) -> None: ...
def __iter__(self) -> Iterator[Node]: ...
def __str__(self) -> str: ...
def _pprint(self, depth: int = ...) -> str: ...
def should_have_demo(self) -> bool: ...
@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
_test_logger: Any
from .graph import Graph, Node
from .registry import Registry
from ..sql_db import Cursor
from ..tests.runner import OdooTestResult
def load_data(cr, idref, mode, kind, package): ...
def load_demo(cr, package, idref, mode): ...
def force_demo(cr) -> 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 _check_module_names(cr, module_names) -> None: ...
def load_marked_modules(cr, graph, states, force, progressdict, report, loaded_modules, perform_checks, models_to_check: Any | None = ...): ...
def load_modules(registry, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...): ...
def reset_modules_state(db_name) -> None: ...
def load_data(cr: Cursor, idref: dict, mode: str, kind: str, package: Node) -> bool: ...
def load_demo(cr: Cursor, package: Node, idref: dict, mode: str) -> bool: ...
def force_demo(cr: Cursor) -> None: ...
def load_module_graph(cr: Cursor, graph: Graph, status: Any | None = ..., perform_checks: Any = ..., skip_modules: list[str] | None = ...,
report: OdooTestResult | None = ..., models_to_check: set[str] | None = ...) -> tuple[list[str], list[str]]: ...
def _check_module_names(cr: Cursor, module_names: Iterable[str]) -> None: ...
def load_marked_modules(cr: Cursor, graph: Graph, states: list[str], force: list[str], progressdict, report: OdooTestResult,
loaded_modules: list[str], perform_checks: Any, models_to_check: set[str] | None = ...) -> list[str]: ...
def load_modules(registry: Registry, force_demo: bool = ..., status: Any | None = ..., update_module: Any = ...) -> Registry | None: ...
def 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:
cr: Any
graph: Any
migrations: Any
def __init__(self, cr, graph) -> None: ...
def _get_files(self): ...
def migrate_module(self, pkg, stage): ...
cr: Cursor
graph: Graph
migrations: dict
def __init__(self, cr: Cursor, graph: Graph) -> None: ...
def _get_files(self) -> None: ...
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
README: Any
_logger: Any
from ..tools import pycompat as pycompat
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:
def find_module(self, name, path: Any | None = ...): ...
def load_module(self, name): ...
def find_module(self, name: str, path: Any | None = ...) -> AddonsHook | None: ...
def load_module(self, name: str) -> ModuleType | None: ...
class OdooHook:
def find_module(self, name, path: Any | None = ...): ...
def load_module(self, name): ...
def find_module(self, name: str, path: Any | None = ...) -> OdooHook | None: ...
def load_module(self, name: str) -> ModuleType | None: ...
class UpgradeHook:
def find_module(self, name, path: Any | None = ...): ...
def load_module(self, name): ...
def find_module(self, name: str, path: Any | None = ...) -> UpgradeHook | None: ...
def load_module(self, name: str) -> ModuleType | None: ...
def initialize_sys_path() -> None: ...
def get_module_path(module, downloaded: bool = ..., display_warning: bool = ...): ...
def get_module_filetree(module, dir: str = ...): ...
def get_resource_path(module, *args): ...
def check_resource_path(mod_path, *args): ...
def get_module_path(module: str, downloaded: bool = ..., display_warning: bool = ...) -> str | Literal[False]: ...
def get_module_filetree(module: str, dir: str = ...) -> dict: ...
def get_resource_path(module: str, *args) -> str | Literal[False]: ...
def check_resource_path(mod_path: str, *args) -> str | Literal[False]: ...
get_module_resource = get_resource_path
def get_resource_from_path(path): ...
def get_module_icon(module): ...
def module_manifest(path): ...
def read_manifest(addons_path, module): ...
def get_module_root(path): ...
def load_information_from_description_file(module, mod_path: Any | None = ...): ...
def load_openerp_module(module_name) -> None: ...
def get_modules(): ...
def get_modules_with_version(): ...
def adapt_version(version): ...
def get_resource_from_path(path: str) -> tuple[str, str, str] | None: ...
def get_module_icon(module: str) -> str: ...
def module_manifest(path: str) -> str | None: ...
def get_module_root(path: str) -> str | None: ...
def load_manifest(module: str, mod_path: str | None = ...) -> dict[str, Any]: ...
def get_manifest(module: str, mod_path: str | None = ...) -> dict[str, Any]: ...
def load_information_from_description_file(module: str, mod_path: str | None = ...) -> dict: ...
def load_openerp_module(module_name: str) -> None: ...
def get_modules() -> list[str]: ...
def get_modules_with_version() -> dict[str, Any]: ...
def adapt_version(version: str) -> str: ...
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 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
_schema: Any
class Registry(Mapping):
_lock: Any
_saved_lock: Any
def registries(cls): ...
def __new__(cls, db_name): ...
class Registry(Mapping[str, type[BaseModel]]):
_lock: RLock
_saved_lock: RLock | None
registries: ClassVar[LRU]
def __new__(cls, db_name: str) -> Registry: ...
@classmethod
def new(cls, db_name, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...): ...
models: Any
_sql_constraints: Any
def new(cls, db_name: str, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...) -> Registry: ...
models: dict[str, type[BaseModel]]
_sql_constraints: set
_init: bool
_assertion_report: Any
_assertion_report: OdooTestResult
_fields_by_model: Any
_ordinary_tables: Any
_constraint_queue: Any
__cache: Any
_init_modules: Any
updated_modules: Any
loaded_xmlids: Any
db_name: Any
_db: Any
test_cr: Any
test_lock: Any
_ordinary_tables: set[str] | None
_constraint_queue: deque
__cache: LRU
_init_modules: set[str]
updated_modules: list[str]
loaded_xmlids: set
db_name: str
_db: Connection
test_cr: Cursor | None
test_lock: RLock | None
loaded: bool
ready: bool
field_depends: Any
field_depends_context: Any
field_inverses: Any
registry_sequence: Any
cache_sequence: Any
_invalidation_flags: Any
has_unaccent: Any
has_trigram: Any
def init(self, db_name) -> None: ...
field_depends: Collector
field_depends_context: Collector
field_inverses: Collector
registry_sequence: int | None
cache_sequence: int | None
_invalidation_flags: threading.local
has_unaccent: bool
has_trigram: bool
def init(self, db_name: str) -> None: ...
@classmethod
def delete(cls, db_name) -> None: ...
def delete(cls, db_name: str) -> None: ...
@classmethod
def delete_all(cls) -> None: ...
def __len__(self): ...
def __iter__(self): ...
def __getitem__(self, model_name): ...
def __call__(self, model_name): ...
def __setitem__(self, model_name, model) -> None: ...
def __delitem__(self, model_name) -> None: ...
def descendants(self, model_names, *kinds): ...
def load(self, cr, module): ...
_m2m: Any
def setup_models(self, cr) -> None: ...
def field_computed(self): ...
def field_triggers(self): ...
def post_init(self, func, *args, **kwargs) -> None: ...
def post_constraint(self, func, *args, **kwargs) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[str]: ...
def __getitem__(self, model_name: str) -> type[BaseModel]: ...
def __call__(self, model_name: str) -> type[BaseModel]: ...
def __setitem__(self, model_name: str, model: type[BaseModel]) -> None: ...
def __delitem__(self, model_name: str) -> None: ...
def descendants(self, model_names: Iterable[str], *kinds) -> set[str]: ...
def load(self, cr: Cursor, module: Node) -> set[str]: ...
_m2m: defaultdict[Any, list]
def setup_models(self, cr: Cursor) -> None: ...
@property
def field_computed(self) -> dict[Field, list[Field]]: ...
@property
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: ...
_post_init_queue: Any
_post_init_queue: deque
_foreign_keys: Any
_is_install: Any
def init_models(self, cr, model_names, context, install: bool = ...) -> None: ...
def check_indexes(self, cr, model_names) -> None: ...
_is_install: bool
def init_models(self, cr: Cursor, model_names: Iterable[str], context: dict, install: bool = ...) -> None: ...
def check_indexes(self, cr: Cursor, model_names: Iterable[str]) -> None: ...
def add_foreign_key(self, table1, column1, table2, column2, ondelete, model, module, force: bool = ...) -> None: ...
def check_foreign_keys(self, cr) -> None: ...
def check_tables_exist(self, cr) -> None: ...
def check_foreign_keys(self, cr: Cursor) -> None: ...
def check_tables_exist(self, cr: Cursor) -> None: ...
def _clear_cache(self) -> None: ...
def clear_caches(self) -> None: ...
def is_an_ordinary_table(self, model): ...
def is_an_ordinary_table(self, model: BaseModel) -> bool: ...
@property
def registry_invalidated(self): ...
def registry_invalidated(self) -> bool: ...
@registry_invalidated.setter
def registry_invalidated(self, value) -> None: ...
def registry_invalidated(self, value: bool) -> None: ...
@property
def cache_invalidated(self): ...
def cache_invalidated(self) -> bool: ...
@cache_invalidated.setter
def cache_invalidated(self, value) -> None: ...
def cache_invalidated(self, value: bool) -> None: ...
def setup_signaling(self) -> None: ...
def check_signaling(self): ...
def check_signaling(self) -> Registry: ...
def signal_changes(self) -> None: ...
def reset_changes(self) -> None: ...
def manage_changes(self) -> None: ...
def in_test_mode(self): ...
def enter_test_mode(self, cr) -> None: ...
def in_test_mode(self) -> bool: ...
def enter_test_mode(self, cr: Cursor) -> None: ...
def leave_test_mode(self) -> None: ...
def cursor(self) -> Cursor: ...

View File

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

View File

@@ -1,44 +1,51 @@
from ..models import MAGIC_COLUMNS as MAGIC_COLUMNS
from functools import partial as partial
from odoo.tools.misc import get_lang as get_lang
from typing import Any
from typing import Any, Callable
from ..fields import Field
from ..models import BaseModel, MAGIC_COLUMNS as MAGIC_COLUMNS
from ..sql_db import Cursor
from ..tools.query import Query
_Domain = list
NOT_OPERATOR: str
OR_OPERATOR: str
AND_OPERATOR: str
DOMAIN_OPERATORS: Any
TERM_OPERATORS: Any
NEGATIVE_TERM_OPERATORS: Any
DOMAIN_OPERATORS_NEGATION: Any
TERM_OPERATORS_NEGATION: Any
TRUE_LEAF: Any
FALSE_LEAF: Any
TRUE_DOMAIN: Any
FALSE_DOMAIN: Any
_logger: Any
DOMAIN_OPERATORS: tuple[str, ...]
TERM_OPERATORS: tuple[str, ...]
NEGATIVE_TERM_OPERATORS: tuple[str, ...]
DOMAIN_OPERATORS_NEGATION: dict[str, str]
TERM_OPERATORS_NEGATION: dict[str, str]
TRUE_LEAF: tuple
FALSE_LEAF: tuple
TRUE_DOMAIN: list[tuple]
FALSE_DOMAIN: list[tuple]
def normalize_domain(domain): ...
def is_false(model, domain): ...
def combine(operator, unit, zero, domains): ...
def AND(domains): ...
def OR(domains): ...
def distribute_not(domain): ...
def _quote(to_quote): ...
def normalize_domain(domain: _Domain) -> _Domain: ...
def is_false(model, domain: _Domain) -> bool: ...
def combine(operator: str, unit, zero, domains: list[_Domain]) -> _Domain: ...
def AND(domains: list[_Domain]) -> _Domain: ...
def OR(domains: list[_Domain]) -> _Domain: ...
def distribute_not(domain: _Domain) -> _Domain: ...
def _quote(to_quote: str) -> str: ...
def normalize_leaf(element): ...
def is_operator(element): ...
def is_leaf(element, internal: bool = ...): ...
def is_boolean(element): ...
def is_operator(element) -> bool: ...
def is_leaf(element, internal: bool = ...) -> bool: ...
def is_boolean(element) -> bool: ...
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:
_unaccent: Any
root_model: Any
root_alias: Any
expression: Any
query: Any
def __init__(self, domain, model, alias: Any | None = ..., query: Any | None = ...) -> None: ...
def get_tables(self): ...
_unaccent_wrapper: Callable[[Any], str]
_has_trigram: bool
root_model: BaseModel
root_alias: str | None
expression: _Domain
query: Query | None
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 __leaf_to_sql(self, leaf, model, alias): ...
def to_sql(self): ...
def __leaf_to_sql(self, leaf, model: BaseModel, alias: str) -> tuple[str, list]: ...
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: Any
ALPHA: Any
BETA: Any
RELEASE_CANDIDATE: Any
FINAL: Any
RELEASE_LEVELS_DISPLAY: Any
version_info: Any
version: Any
series: Any
serie: Any
major_version: Any
RELEASE_LEVELS: list[str]
ALPHA: str
BETA: str
RELEASE_CANDIDATE: str
FINAL: str
RELEASE_LEVELS_DISPLAY: dict[str, str]
version_info: tuple
version: str
series: str
serie: str
major_version: str
product_name: str
description: str
long_desc: str
@@ -19,4 +17,4 @@ url: str
author: str
author_email: 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: Any
RPC_VERSION_1: dict[str, Any]
def exp_login(db, login, password): ...
def exp_authenticate(db, login, password, user_agent_env): ...
def exp_version(): ...
def exp_about(extended: bool = ...): ...
def exp_set_loglevel(loglevel, logger: Any | None = ...): ...
def dispatch(method, params): ...
def exp_login(db: str, login: str, password: str) -> int: ...
def exp_authenticate(db: str, login: str, password: str, user_agent_env: dict | None) -> int: ...
def exp_version() -> dict[str, Any]: ...
def exp_about(extended: bool = ...) -> str | tuple[str, str]: ...
def exp_set_loglevel(loglevel, logger: Logger | None = ...) -> Literal[True]: ...
def dispatch(method: str, params): ...

View File

@@ -1,31 +1,35 @@
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): ...
def check_db_management_enabled(method): ...
def check_super(passwd): ...
def _initialize_db(id, db_name, demo, lang, user_password, login: str = ..., country_code: Any | None = ..., phone: Any | None = ...) -> None: ...
def _create_empty_database(name) -> None: ...
def exp_create_database(db_name, demo, lang, user_password: str = ..., login: str = ..., country_code: Any | None = ..., phone: Any | None = ...): ...
def exp_duplicate_database(db_original_name, db_name): ...
def _drop_conn(cr, db_name) -> None: ...
def exp_drop(db_name): ...
def exp_dump(db_name, format): ...
def dump_db_manifest(cr): ...
def dump_db(db_name, stream, backup_format: str = ...): ...
def exp_restore(db_name, data, copy: bool = ...): ...
def restore_db(db, dump_file, copy: bool = ...) -> None: ...
def exp_rename(old_name, new_name): ...
def exp_change_admin_password(new_password): ...
def exp_migrate_databases(databases): ...
def exp_db_exist(db_name): ...
def list_dbs(force: bool = ...): ...
def list_db_incompatible(databases): ...
def exp_list(document: bool = ...): ...
def exp_list_lang(): ...
def exp_list_countries(): ...
def exp_server_version(): ...
def dispatch(method, params): ...
def check_db_management_enabled(method: _CallableT) -> _CallableT: ...
def check_super(passwd: str) -> Literal[True]: ...
def _initialize_db(id, db_name: str, demo: bool, lang: str, user_password: str, login: str = ...,
country_code: str | None = ..., phone: str | None = ...) -> None: ...
def _create_empty_database(name: str) -> None: ...
def exp_create_database(db_name: str, demo: bool, lang: str, user_password: str = ..., login: str = ...,
country_code: str | None = ..., phone: str | None = ...) -> Literal[True]: ...
def exp_duplicate_database(db_original_name: str, db_name: str) -> Literal[True]: ...
def _drop_conn(cr: Cursor, db_name: str) -> None: ...
def exp_drop(db_name: str) -> bool: ...
def exp_dump(db_name: str, format: str) -> str: ...
def dump_db_manifest(cr: Cursor) -> dict[str, Any]: ...
def dump_db(db_name: str, stream, backup_format: str = ...) -> IO | None: ...
def exp_restore(db_name: str, data, copy: bool = ...) -> Literal[True]: ...
def restore_db(db: str, dump_file: str, copy: bool = ...) -> None: ...
def exp_rename(old_name: str, new_name: str) -> Literal[True]: ...
def exp_change_admin_password(new_password: str) -> Literal[True]: ...
def exp_migrate_databases(databases: Iterable[str]) -> Literal[True]: ...
def exp_db_exist(db_name: str) -> bool: ...
def list_dbs(force: bool = ...) -> list[str]: ...
def list_db_incompatible(databases: Iterable[str]) -> list[str]: ...
def exp_list(document: bool = ...) -> list[str]: ...
def exp_list_lang() -> list[tuple[str, str]]: ...
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
PG_CONCURRENCY_ERRORS_TO_RETRY: Any
from psycopg2 import IntegrityError
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
def dispatch(method, params): ...
def check(f): ...
def execute_cr(cr, uid, obj, method, *args, **kw): ...
def execute_kw(db, uid, obj, method, args, kw: Any | None = ...): ...
def execute(db, uid, obj, method, *args, **kw): ...
_CallableT = TypeVar('_CallableT', bound=Callable)
def dispatch(method: str, params): ...
def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...
def execute_kw(db: str, uid: int, obj: str, method: str, args, kw: dict | None = ...): ...
def execute(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): ...
def compute_session_token(session, env): ...
def check_session(session, env): ...
from typing import Literal
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 ..tests import runner as runner
from socket import socket as socket_
from threading import Semaphore, Thread
from gevent.pywsgi import WSGIServer
from itertools import chain as chain
from typing import Any
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
_logger: Any
SLEEP_INTERVAL: int
def memory_info(process): ...
def memory_info(process: Process): ...
def set_limit_memory_hard() -> None: ...
def empty_pipe(fd) -> None: ...
def empty_pipe(fd: int) -> None: ...
class LoggingBaseWSGIServerMixIn:
def handle_error(self, request, client_address) -> None: ...
@@ -19,16 +31,17 @@ class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGI
def server_activate(self) -> None: ...
class RequestHandler(werkzeug.serving.WSGIRequestHandler):
timeout: int
def setup(self) -> None: ...
protocol_version: str
def make_environ(self) -> dict[str, Any]: ...
class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer):
max_http_threads: Any
http_threads_sem: Any
http_threads_sem: Semaphore
daemon_threads: bool
def __init__(self, host, port, app) -> None: ...
def __init__(self, host: str, port: int, app) -> None: ...
reload_socket: bool
socket: Any
socket: socket_
def server_bind(self) -> None: ...
def server_activate(self) -> None: ...
def process_request(self, request, client_address) -> None: ...
@@ -36,10 +49,10 @@ class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.
def shutdown_request(self, request) -> None: ...
class FSWatcherBase:
def handle_file(self, path): ...
def handle_file(self, path: str) -> Literal[True]: ...
class FSWatcherWatchdog(FSWatcherBase):
observer: Any
observer: Observer
def __init__(self) -> None: ...
def dispatch(self, event) -> None: ...
def start(self) -> None: ...
@@ -47,36 +60,37 @@ class FSWatcherWatchdog(FSWatcherBase):
class FSWatcherInotify(FSWatcherBase):
started: bool
watcher: Any
watcher: InotifyTrees
def __init__(self) -> None: ...
def run(self) -> None: ...
thread: Any
thread: Thread
def start(self) -> None: ...
def stop(self) -> None: ...
class CommonServer:
app: Any
_on_stop_funcs: Any
interface: Any
port: Any
pid: Any
_on_stop_funcs: list[Callable]
interface: str
port: int
pid: int
def __init__(self, app) -> None: ...
def close_socket(self, sock) -> None: ...
def on_stop(self, func) -> None: ...
def close_socket(self, sock: socket_) -> None: ...
@classmethod
def on_stop(cls, func: Callable) -> None: ...
def stop(self) -> None: ...
class ThreadedServer(CommonServer):
main_thread_id: Any
main_thread_id: int | None
quit_signals_received: int
httpd: Any
limits_reached_threads: Any
limit_reached_time: Any
httpd: ThreadedWSGIServerReloadable | None
limits_reached_threads: set[Thread]
limit_reached_time: float | None
def __init__(self, app) -> None: ...
def signal_handler(self, sig, frame) -> None: ...
def process_limit(self) -> None: ...
def cron_thread(self, number) -> None: ...
def cron_spawn(self) -> None: ...
def http_thread(self): ...
def http_thread(self) -> None: ...
def http_spawn(self) -> None: ...
def start(self, stop: bool = ...): ...
def stop(self) -> None: ...
@@ -84,63 +98,64 @@ class ThreadedServer(CommonServer):
def reload(self) -> None: ...
class GeventServer(CommonServer):
port: Any
httpd: Any
port: int
httpd: WSGIServer | None
def __init__(self, app) -> None: ...
def process_limits(self) -> None: ...
ppid: Any
ppid: int
def watchdog(self, beat: int = ...) -> None: ...
client_address: Any
response_use_chunked: bool
def start(self): ...
def stop(self) -> None: ...
def run(self, preload, stop) -> None: ...
def run(self, preload, stop: bool) -> None: ...
class PreforkServer(CommonServer):
population: Any
timeout: Any
limit_request: Any
cron_timeout: Any
population: int
timeout: int
limit_request: int
cron_timeout: int
beat: int
socket: Any
workers_http: Any
workers_cron: Any
workers: Any
socket: socket_ | None
workers_http: dict[int, WorkerHTTP]
workers_cron: dict[int, WorkerCron]
workers: dict[int, Worker]
generation: int
queue: Any
long_polling_pid: Any
queue: list
long_polling_pid: int | None
def __init__(self, app) -> None: ...
def pipe_new(self): ...
def pipe_ping(self, pipe) -> None: ...
def signal_handler(self, sig, frame) -> None: ...
def worker_spawn(self, klass, workers_registry): ...
def pipe_new(self) -> tuple[int, int]: ...
def pipe_ping(self, pipe: tuple[int, int]) -> None: ...
def signal_handler(self, sig: int, frame) -> None: ...
def worker_spawn(self, klass: Callable[..., _WorkerT], workers_registry: dict[int, _WorkerT]) -> _WorkerT | None: ...
def long_polling_spawn(self) -> None: ...
def worker_pop(self, pid) -> None: ...
def worker_kill(self, pid, sig) -> None: ...
def worker_pop(self, pid: int) -> None: ...
def worker_kill(self, pid: int, sig: int) -> None: ...
def process_signals(self) -> None: ...
def process_zombie(self) -> None: ...
def process_timeout(self) -> None: ...
def process_spawn(self) -> None: ...
def sleep(self) -> None: ...
pipe: Any
pipe: tuple[int, int]
def start(self) -> None: ...
def stop(self, graceful: bool = ...) -> None: ...
def run(self, preload, stop): ...
def run(self, preload, stop: bool): ...
class Worker:
multi: Any
watchdog_time: Any
watchdog_pipe: Any
eintr_pipe: Any
multi: PreforkServer
watchdog_time: float
watchdog_pipe: tuple[int, int]
eintr_pipe: tuple[int, int]
watchdog_timeout: Any
ppid: Any
pid: Any
ppid: int
pid: int | None
alive: bool
request_max: Any
request_count: int
def __init__(self, multi) -> None: ...
def __init__(self, multi: PreforkServer) -> None: ...
def setproctitle(self, title: str = ...) -> 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 sleep(self) -> None: ...
def check_limits(self) -> None: ...
@@ -151,29 +166,29 @@ class Worker:
def _runloop(self) -> None: ...
class WorkerHTTP(Worker):
sock_timeout: Any
def __init__(self, multi) -> None: ...
def process_request(self, client, addr) -> None: ...
sock_timeout: float
def __init__(self, multi: PreforkServer) -> None: ...
def process_request(self, client: socket_, addr) -> None: ...
def process_work(self) -> None: ...
server: Any
server: BaseWSGIServerNoBind
def start(self) -> None: ...
class WorkerCron(Worker):
db_index: int
watchdog_timeout: Any
def __init__(self, multi) -> None: ...
watchdog_timeout: int
def __init__(self, multi: PreforkServer) -> None: ...
def sleep(self) -> None: ...
def _db_list(self): ...
def process_work(self) -> None: ...
dbcursor: Any
dbcursor: Cursor
def start(self) -> None: ...
def stop(self) -> None: ...
server: Any
server: CommonServer | None
def load_server_wide_modules() -> None: ...
def _reexec(updated_modules: Any | None = ...) -> None: ...
def load_test_file_py(registry, test_file) -> None: ...
def preload_registries(dbnames): ...
def start(preload: Any | None = ..., stop: bool = ...): ...
def _reexec(updated_modules: Iterable[str] | None = ...) -> None: ...
def load_test_file_py(registry: Registry, test_file: str) -> None: ...
def preload_registries(dbnames: list[str] | None): ...
def start(preload: list[str] | None = ..., stop: bool = ...): ...
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
from psycopg2.sql import Identifier
from .api import Transaction
from .tools import Callbacks
_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): ...
def undecimalize(symb, cr): ...
def adapt_string(adapted): ...
def flush_env(cr, *, clear: bool = ...) -> None: ...
def clear_env(cr) -> None: ...
re_from: Any
re_into: Any
re_from: Pattern
re_into: Pattern
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:
precommit: Callbacks
postcommit: Callbacks
prerollback: Callbacks
postrollback: Callbacks
transaction: Transaction
transaction: Transaction | 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 clear(self) -> None: ...
def reset(self) -> None: ...
def savepoint(self, flush: bool = ...) -> None: ...
def __enter__(self: _T) -> _T: ...
def savepoint(self, flush: bool = ...) -> Savepoint: ...
def __enter__(self: _CursorT) -> _CursorT: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
class Cursor(BaseCursor):
IN_MAX: int
sql_from_log: Any
sql_into_log: Any
sql_log: Any
sql_from_log: dict
sql_into_log: dict
sql_log_count: int
_closed: bool
__pool: Any
dbname: Any
_serialized: Any
_cnx: Any
_obj: Any
__caller: Any
_default_log_exceptions: bool
cache: Any
_now: Any
def __init__(self, pool, dbname, dsn, serialized: bool = ...) -> None: ...
def __build_dict(self, row): ...
def dictfetchone(self): ...
def dictfetchmany(self, size): ...
def dictfetchall(self): ...
__pool: ConnectionPool
dbname: str
_cnx: PsycoConnection
_obj: psycopg2.extensions.cursor
__caller: tuple[str, int | str] | Literal[False]
cache: dict
_now: datetime | None
def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict, **kwargs) -> None: ...
def __build_dict(self, row: Sequence) -> dict[str, Any]: ...
def dictfetchone(self) -> dict[str, Any] | None: ...
def dictfetchmany(self, size) -> list[dict[str, Any]]: ...
def dictfetchall(self) -> list[dict[str, Any]]: ...
def __del__(self) -> None: ...
def _format(self, query, params: Any | None = ...): ...
def execute(self, query, params: Any | None = ..., log_exceptions: Any | None = ...): ...
def split_for_in_conditions(self, ids, size: Any | None = ...): ...
def execute(self, query, params: Any | None = ..., log_exceptions: bool = ...): ...
def split_for_in_conditions(self, ids: Iterable, size: int | None = ...) -> Iterator[tuple]: ...
def print_log(self): ...
def _enable_logging(self) -> Generator[None, None, None]: ...
def close(self): ...
def _close(self, leak: bool = ...) -> None: ...
def autocommit(self, on) -> None: ...
def after(self, event, func) -> None: ...
def autocommit(self, on: bool) -> None: ...
def commit(self): ...
def rollback(self): ...
def __getattr__(self, name): ...
def __getattr__(self, name: str): ...
@property
def closed(self): ...
def now(self): ...
def closed(self) -> bool: ...
def now(self) -> datetime: ...
class TestCursor(BaseCursor):
_savepoint_seq: Any
_cursors_stack: list[TestCursor]
_now: datetime | None
_closed: bool
_cursor: Any
_lock: Any
_savepoint: Any
def __init__(self, cursor, lock) -> None: ...
_cursor: Cursor
_lock: RLock
_savepoint: Savepoint | None
def __init__(self, cursor: Cursor, lock: RLock) -> None: ...
def execute(self, *args, **kwargs): ...
def close(self) -> None: ...
def autocommit(self, on) -> None: ...
def autocommit(self, on: bool) -> None: ...
def commit(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 ConnectionPool:
def locked(fun): ...
_connections: Any
_maxconn: Any
_lock: Any
_connections: list[tuple[psycopg2.extensions.connection, bool]]
_maxconn: int
_lock: Lock
def __init__(self, maxconn: int = ...) -> None: ...
def __repr__(self): ...
def __repr__(self) -> str: ...
def _debug(self, msg, *args) -> None: ...
def borrow(self, connection_info): ...
def give_back(self, connection, keep_in_pool: bool = ...) -> None: ...
def close_all(self, dsn: Any | None = ...) -> None: ...
def borrow(self, connection_info: dict) -> PsycoConnection: ...
def give_back(self, connection: PsycoConnection, keep_in_pool: bool = ...) -> None: ...
def close_all(self, dsn: dict | None = ...) -> None: ...
class Connection:
dbname: Any
dsn: Any
__pool: Any
def __init__(self, pool, dbname, dsn) -> None: ...
def cursor(self, serialized: bool = ...): ...
serialized_cursor: Any
def __bool__(self) -> None: ...
__nonzero__: Any
dbname: str
dsn: dict
__pool: ConnectionPool
def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict) -> None: ...
def cursor(self, **kwargs) -> Cursor: ...
def serialized_cursor(self, **kwargs) -> Cursor: ...
def __bool__(self) -> NoReturn: ...
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 close_db(db_name) -> None: ...
def db_connect(to: str, allow_uri: bool = ...) -> Connection: ...
def close_db(db_name: str) -> None: ...
def close_all() -> None: ...

View File

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

View File

@@ -1,18 +1,36 @@
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):
time_start: Any
queries_start: Any
time_start: float | None
queries_start: int | None
_soft_fail: bool
had_failure: bool
stats: defaultdict[Any, Stat]
def __init__(self) -> None: ...
def __str__(self): ...
def __str__(self) -> str: ...
def soft_fail(self) -> Generator[None, None, None]: ...
shouldStop: Any
def update(self, other) -> None: ...
def log(self, level, msg, *args, test: Any | None = ..., exc_info: Any | None = ..., extra: Any | None = ..., stack_info: bool = ..., caller_infos: Any | None = ...) -> None: ...
def log(self, level, msg, *args, test: Any | None = ..., exc_info: Any | None = ..., extra: Any | None = ...,
stack_info: bool = ..., caller_infos: Any | None = ...) -> None: ...
def log_stats(self) -> None: ...
def getDescription(self, test): ...
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 addFailure(self, test, 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: Any
IGNORE: Any
BLACKLIST: set[str]
IGNORE: tuple[str, ...]
def install(db_name, module_id, module_name) -> None: ...
def uninstall(db_name, module_id, module_name) -> None: ...
def cycle(db_name, module_id, module_name) -> None: ...
def parse_args(): ...
def test_full(args): ...
def test_uninstall(args) -> None: ...
def test_scripts(args) -> None: ...
def install(db_name: str, module_id: int, module_name: str) -> None: ...
def uninstall(db_name: str, module_id: int, module_name: str) -> None: ...
def cycle(db_name: str, module_id: int, module_name: str) -> None: ...
def parse_args() -> Namespace: ...
def test_full(args: Namespace) -> None: ...
def test_uninstall(args: Namespace) -> None: ...
def test_scripts(args: Namespace) -> None: ...

View File

@@ -1,16 +1,31 @@
from .misc import *
from .translate import *
from .image import *
from .sql import *
from .float_utils import *
from .mail import *
from .func import *
from .debugger import *
from .xml_utils import *
from .barcode 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 . 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 .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

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__: Any
__version_info__: tuple
__version__: str
def user_data_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., roaming: bool = ...): ...
def site_data_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., multipath: bool = ...): ...
def user_config_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., roaming: bool = ...): ...
def site_config_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., multipath: bool = ...): ...
def user_cache_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., opinion: bool = ...): ...
def user_log_dir(appname: Any | None = ..., appauthor: Any | None = ..., version: Any | None = ..., opinion: bool = ...): ...
def user_data_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ...) -> str: ...
def site_data_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ...) -> str: ...
def user_config_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ...) -> str: ...
def site_config_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ...) -> str: ...
def user_cache_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ...) -> str: ...
def user_log_dir(appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ...) -> str: ...
class AppDirs:
appname: Any
appauthor: Any
version: Any
roaming: Any
multipath: Any
def __init__(self, appname, appauthor: Any | None = ..., version: Any | None = ..., roaming: bool = ..., multipath: bool = ...) -> None: ...
appname: str
appauthor: str | None
version: str | None
roaming: bool
multipath: bool
def __init__(self, appname: str, appauthor: str | None = ..., version: str | None = ..., roaming: bool = ..., multipath: bool = ...) -> None: ...
@property
def user_data_dir(self): ...
def user_data_dir(self) -> str: ...
@property
def site_data_dir(self): ...
def site_data_dir(self) -> str: ...
@property
def user_config_dir(self): ...
def user_config_dir(self) -> str: ...
@property
def site_config_dir(self): ...
def site_config_dir(self) -> str: ...
@property
def user_cache_dir(self): ...
def user_cache_dir(self) -> str: ...
@property
def user_log_dir(self): ...
def user_log_dir(self) -> str: ...
def _get_win_folder_from_registry(csidl_name): ...
def _get_win_folder_with_pywin32(csidl_name): ...
def _get_win_folder_with_ctypes(csidl_name): ...
_get_win_folder = _get_win_folder_with_pywin32
_get_win_folder = _get_win_folder_with_ctypes
_get_win_folder = _get_win_folder_from_registry
def _get_win_folder_from_registry(csidl_name: str) -> str: ...
def _get_win_folder_with_pywin32(csidl_name: str) -> str: ...
def _get_win_folder_with_ctypes(csidl_name: str) -> str: ...
_get_win_folder: Callable[[str], str]

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
_logger: Any
class ormcache_counter:
__slots__: Any
hit: int
miss: int
err: int
def __init__(self) -> None: ...
@property
def ratio(self): ...
def ratio(self) -> float: ...
STAT: Any
STAT: defaultdict[Any, ormcache_counter]
class ormcache:
args: Any
skiparg: Any
def __init__(self, *args, **kwargs) -> None: ...
method: Any
def __call__(self, method): ...
method: Callable
def __call__(self, method: _CallableT) -> _CallableT: ...
key: Any
def determine_key(self): ...
def lru(self, model): ...
def lookup(self, method, *args, **kwargs): ...
def clear(self, model, *args) -> None: ...
def lru(self, model: BaseModel) -> tuple[LRU, tuple[str, Callable], ormcache_counter]: ...
def lookup(self, method: Callable, *args, **kwargs): ...
def clear(self, model: BaseModel, *args) -> None: ...
class ormcache_context(ormcache):
keys: Any
@@ -38,7 +43,7 @@ class ormcache_multi(ormcache):
key_multi: Any
multi_pos: Any
def determine_key(self) -> None: ...
def lookup(self, method, *args, **kwargs): ...
def lookup(self, method: Callable, *args, **kwargs): ...
class dummy_cache:
def __init__(self, *l, **kw) -> None: ...

View File

@@ -1,24 +1,32 @@
from typing import Any
from ..api import Environment
VERSION: int
DEFAULT_EXCLUDE: Any
STANDARD_MODULES: Any
MAX_FILE_SIZE: Any
DEFAULT_EXCLUDE: list[str]
STANDARD_MODULES: list[str]
MAX_FILE_SIZE: int
VALID_EXTENSION: list[str]
class Cloc:
modules: Any
code: Any
total: Any
errors: Any
modules: dict
code: dict
total: dict
errors: dict
excluded: dict
max_width: int
def __init__(self) -> None: ...
def parse_xml(self, s): ...
def parse_py(self, s): ...
def parse_js(self, s): ...
def book(self, module, item: str = ..., count=...) -> None: ...
def count_path(self, path, exclude: Any | None = ...) -> None: ...
def count_modules(self, env) -> None: ...
def count_customization(self, env) -> None: ...
def count_env(self, env) -> None: ...
def parse_c_like(self, s: str, regex: str) -> tuple[int, int]: ...
def parse_xml(self, s: str) -> tuple[int, int]: ...
def parse_py(self, s: str) -> tuple[int, int]: ...
def parse_js(self, s: str) -> tuple[int, int]: ...
def parse_scss(self, s: str) -> tuple[int, int]: ...
def parse_css(self, s: str) -> tuple[int, int]: ...
def parse(self, s: str, ext: str) -> tuple[int, int]: ...
def book(self, module: str, item: str = ..., count: tuple[Any, Any] = ..., exclude: bool = ...) -> None: ...
def 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 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
crypt_context: Any
from passlib.context import CryptContext
class MyOption(optparse.Option):
crypt_context: CryptContext
class MyOption(Option):
my_default: Any
def __init__(self, *opts, **attrs) -> None: ...
DEFAULT_LOG_HANDLER: str
def _get_default_datadir(): ...
def _deduplicate_loggers(loggers): ...
def _get_default_datadir() -> str: ...
def _deduplicate_loggers(loggers) -> tuple[str, ...]: ...
class configmanager:
options: Any
blacklist_for_save: Any
casts: Any
misc: Any
config_file: Any
_LOGLEVELS: Any
parser: Any
def __init__(self, fname: Any | None = ...) -> None: ...
def parse_config(self, args: Any | None = ...): ...
rcfile: Any
def _parse_config(self, args: Any | None = ...): ...
options: dict[str, Any]
blacklist_for_save: set[str]
casts: dict
misc: dict
config_file: str
_LOGLEVELS: dict
parser: OptionParser
def __init__(self, fname: str | None = ...) -> None: ...
def parse_config(self, args: list | None = ...): ...
rcfile: str
def _parse_config(self, args: list | None = ...): ...
def _warn_deprecated_options(self) -> None: ...
def _is_addons_path(self, path): ...
def _check_addons_path(self, option, opt, value, parser) -> None: ...
def _check_upgrade_path(self, option, opt, value, parser) -> None: ...
def _is_upgrades_path(self, res): ...
def _test_enable_callback(self, option, opt, value, parser) -> None: ...
def _is_addons_path(self, path: str) -> bool: ...
def _check_addons_path(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
def _check_upgrade_path(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
def _is_upgrades_path(self, res: str) -> bool: ...
def _test_enable_callback(self, option: MyOption, opt, value, parser: OptionParser) -> None: ...
def load(self) -> None: ...
def save(self) -> None: ...
def save(self, keys: Any | None = ...) -> None: ...
def get(self, key, default: Any | None = ...): ...
def pop(self, key, default: Any | None = ...): ...
def get_misc(self, sect, key, default: Any | None = ...): ...
def __setitem__(self, key, value) -> None: ...
def __getitem__(self, key): ...
@property
def addons_data_dir(self): ...
def addons_data_dir(self) -> str: ...
@property
def session_dir(self): ...
def filestore(self, dbname): ...
def session_dir(self) -> str: ...
def filestore(self, dbname: str) -> str: ...
def set_admin_password(self, new_password) -> None: ...
def verify_admin_password(self, password): ...
def _normalize(self, path): ...
def verify_admin_password(self, password) -> bool: ...
def _normalize(self, path: str) -> str: ...
config: Any
config: configmanager

View File

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

View File

@@ -1,11 +1,18 @@
def get_month(date): ...
def get_quarter_number(date): ...
def get_quarter(date): ...
def get_fiscal_year(date, day: int = ..., month: int = ...): ...
def get_timedelta(qty, granularity): ...
def start_of(value, granularity): ...
def end_of(value, granularity): ...
def add(value, *args, **kwargs): ...
def subtract(value, *args, **kwargs): ...
def json_default(obj): ...
def date_range(start, end, step=...): ...
import datetime
from typing import Tuple, Iterator, TypeVar
from dateutil.relativedelta import relativedelta
_DateTimeT = TypeVar('_DateTimeT', datetime.date, datetime.datetime)
def get_month(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
def get_quarter_number(date) -> int: ...
def get_quarter(date: _DateTimeT) -> Tuple[_DateTimeT, _DateTimeT]: ...
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: Any
SUPPORTED_DEBUGGER: set[str]
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): ...
def _float_check_precision(precision_digits: Any | None = ..., precision_rounding: Any | None = ...): ...
def float_round(value, precision_digits: Any | None = ..., precision_rounding: Any | None = ..., rounding_method: str = ...): ...
def float_is_zero(value, precision_digits: Any | None = ..., precision_rounding: Any | None = ...): ...
def float_compare(value1, value2, precision_digits: Any | None = ..., precision_rounding: Any | None = ...): ...
def float_repr(value, precision_digits): ...
def round(f: float) -> float: ...
def _float_check_precision(precision_digits: int | None = ..., precision_rounding: float | None = ...) -> float: ...
def float_round(value: float, precision_digits: int | None = ..., precision_rounding: float | None = ..., rounding_method: str = ...) -> float: ...
def float_is_zero(value: float, precision_digits: int | None = ..., precision_rounding: float | None = ...) -> bool: ...
def float_compare(value1: float, value2: float, precision_digits: int | None = ..., precision_rounding: float | None = ...) -> int: ...
def float_repr(value: float, precision_digits: int) -> str: ...
_float_repr = float_repr
def float_split_str(value, precision_digits): ...
def float_split(value, precision_digits): ...
def float_split_str(value: float, precision_digits: int) -> tuple[str, str]: ...
def float_split(value: float, precision_digits: int) -> tuple[int, int]: ...

View File

@@ -1,32 +1,36 @@
from json import JSONEncoder as JSONEncoder
from typing import Any
from typing import Callable, Generic, TypeVar
__all__: Any
_T = TypeVar('_T')
class lazy_property:
fget: Any
def __init__(self, fget) -> None: ...
def __get__(self, obj, cls): ...
class lazy_property(Generic[_T]):
fget: Callable[..., _T]
def __init__(self, fget: Callable[..., _T]) -> None: ...
def __get__(self, obj, cls) -> _T: ...
@property
def __doc__(self): ...
@staticmethod
def reset_all(obj) -> None: ...
class lazy_classproperty(lazy_property):
def __get__(self, obj, cls): ...
class lazy_classproperty(lazy_property[_T]):
def __get__(self, obj, cls) -> _T: ...
def conditional(condition, decorator): ...
def synchronized(lock_attr: str = ...): ...
def frame_codeinfo(fframe, back: int = ...): ...
def compose(a, b): ...
def filter_kwargs(func, kwargs) -> dict: ...
def synchronized(lock_attr: str = ...) -> Callable[[_T], _T]: ...
class _ClassProperty(property):
def __get__(self, cls, owner): ...
locked: Callable[[_T], _T]
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:
__slots__: Any
__slots__ = ['_func', '_args', '_kwargs', '_cached_value']
def __init__(self, func, *args, **kwargs) -> None: ...
@property
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 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_TO_TRANSPOSE_METHODS: Any
EXIF_TAG_ORIENTATION_TO_TRANSPOSE_METHODS: dict[int, list]
IMAGE_MAX_RESOLUTION: float
class ImageProcess:
base64_source: Any
source: bytes
operationsCount: int
image: bool
original_format: Any
def __init__(self, base64_source, verify_resolution: bool = ...) -> None: ...
def image_base64(self, quality: int = ..., output_format: str = ...): ...
def resize(self, max_width: int = ..., max_height: int = ...): ...
def crop_resize(self, max_width, max_height, center_x: float = ..., center_y: float = ...): ...
def colorize(self): ...
image: Image | Literal[False]
original_format: str
def __init__(self, source: bytes, verify_resolution: bool = ...) -> None: ...
def image_quality(self, quality: int = ..., output_format: str = ...) -> bytes | Literal[False]: ...
def resize(self, max_width: int = ..., max_height: int = ...) -> ImageProcess: ...
def crop_resize(self, max_width: int, max_height: int, center_x: float = ..., center_y: float = ...) -> ImageProcess: ...
def colorize(self) -> ImageProcess: ...
def image_process(base64_source, size=..., verify_resolution: bool = ..., quality: int = ..., crop: Any | None = ..., colorize: bool = ..., output_format: str = ...): ...
def average_dominant_color(colors, mitigate: int = ..., max_margin: int = ...): ...
def image_fix_orientation(image): ...
def base64_to_image(base64_source): ...
def image_to_base64(image, format, **params): ...
def is_image_size_above(base64_source_1, base64_source_2): ...
def image_guess_size_from_field_name(field_name): ...
def image_data_uri(base64_source): ...
def get_saturation(rgb): ...
def get_lightness(rgb): ...
def hex_to_rgb(hx): ...
def rgb_to_hex(rgb): ...
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: list[tuple[Any, Any]], mitigate: int = ..., max_margin: int = ...) -> tuple[Any, Any]: ...
def image_fix_orientation(image: Image) -> Image: ...
def binary_to_image(source: bytes) -> Image: ...
def base64_to_image(base64_source: bytes) -> Image: ...
def image_apply_opt(image: Image, output_format: str | None, **params) -> bytes: ...
def image_to_base64(image: Image, output_format: str | None, **params) -> bytes: ...
def is_image_size_above(base64_source_1: bytes, base64_source_2: bytes) -> bool: ...
def image_guess_size_from_field_name(field_name: str) -> tuple[int, int]: ...
def image_data_uri(base64_source: bytes) -> str: ...
def get_saturation(rgb: Iterable[int]) -> float: ...
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 wrap_with_odoo_define(module_path, content): ...
def url_to_module_path(url: str) -> str: ...
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 relative_path_to_module_path(url, path_rel): ...
def convert_relative_require(url: str, content: str) -> str: ...
ODOO_MODULE_RE: Any
IMPORT_STAR: Pattern
def is_odoo_module(content): ...
def get_aliased_odoo_define_content(module_path, content): ...
def convert_as(val): ...
def remove_as(val): ...
def convert_star_import(content: str) -> str: ...
IMPORT_DEFAULT_AND_STAR: Pattern
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):
def __html__(self): ...
def __html__(self) -> Markup: ...
class JSON:
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
__all__: Any
__all__ = ['LRU']
class LRU:
_lock: Any
count: Any
d: Any
def __init__(self, count, pairs=...) -> None: ...
def __contains__(self, obj): ...
_lock: RLock
count: int
d: OrderedDict
def __init__(self, count: int, pairs: tuple[Any, Any] = ...) -> None: ...
def __contains__(self, obj) -> bool: ...
def get(self, obj, val: Any | None = ...): ...
def __getitem__(self, obj): ...
def __setitem__(self, obj, val) -> None: ...
def __delitem__(self, obj) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def pop(self, key): ...
def clear(self) -> None: ...

View File

@@ -1,50 +1,56 @@
from lxml.html import clean
from typing import Any
from email.message import Message
from re import Pattern
from typing import Collection, FrozenSet, Literal
_logger: Any
tags_to_kill: Any
tags_to_remove: Any
allowed_tags: Any
safe_attrs: Any
from lxml.etree import _Element
from lxml.html import clean
from markupsafe import Markup
safe_attrs: FrozenSet
SANITIZE_TAGS: dict[str, Collection[str]]
class _Cleaner(clean.Cleaner):
_style_re: Any
_style_whitelist: Any
_style_re: Pattern
_style_whitelist: list[str]
strip_classes: bool
sanitize_style: bool
def __call__(self, doc) -> None: ...
def tag_quote(self, el): ...
def strip_class(self, el) -> None: ...
def parse_style(self, el) -> None: ...
def __call__(self, doc: _Element) -> None: ...
def tag_quote(self, el: _Element) -> None: ...
def strip_class(self, el: _Element) -> 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
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 is_html_empty(html_content): ...
def html_keep_url(text): ...
def html2plaintext(html, body_id: Any | None = ..., encoding: str = ...): ...
def plaintext2html(text, container_tag: bool = ...): ...
def append_content_to_html(html, content, plaintext: bool = ..., preserve: bool = ..., container_tag: bool = ...): ...
def prepend_html_content(html_body, html_content): ...
def validate_url(url: str) -> str: ...
def is_html_empty(html_content: str) -> bool: ...
def html_keep_url(text: str) -> str: ...
def html_to_inner_content(html: str) -> str: ...
def html2plaintext(html: str, body_id: str | None = ..., encoding: str = ...) -> str: ...
def plaintext2html(text: str, container_tag: str = ...) -> Markup: ...
def append_content_to_html(html: str, content: str, plaintext: bool = ..., preserve: bool = ..., container_tag: str = ...) -> Markup: ...
def prepend_html_content(html_body: str, html_content: str) -> str: ...
email_re: Any
single_email_re: Any
mail_header_msgid_re: Any
email_addr_escapes_re: Any
email_re: Pattern
single_email_re: Pattern
mail_header_msgid_re: Pattern
email_addr_escapes_re: Pattern
def generate_tracking_message_id(res_id): ...
def email_split_tuples(text): ...
def email_split(text): ...
def email_split_and_format(text): ...
def email_normalize(text): ...
def email_domain_extract(email): ...
def email_domain_normalize(domain): ...
def url_domain_extract(url): ...
def email_escape_char(email_address): ...
def decode_message_header(message, header, separator: str = ...): ...
def formataddr(pair, charset: str = ...): ...
def encapsulate_email(old_email, new_email): ...
def generate_tracking_message_id(res_id: str) -> str: ...
def email_split_tuples(text: str) -> list[str]: ...
def email_split(text: str) -> list[str]: ...
def email_split_and_format(text: str) -> list[str]: ...
def email_normalize(text: str, strict: bool = ...) -> str | Literal[False]: ...
def email_domain_extract(email: str) -> str | Literal[False]: ...
def email_domain_normalize(domain: str) -> str | Literal[False]: ...
def url_domain_extract(url: str) -> str | Literal[False]: ...
def email_escape_char(email_address: str) -> str: ...
def decode_message_header(message: Message, header: str, separator: str = ...) -> str: ...
def formataddr(pair: tuple[str, str], charset: str = ...) -> str: ...
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
_logger: Any
_ooxml_dirs: Any
__all__ = ['guess_mimetype']
_ooxml_dirs: dict[str, str]
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
_ppt_pattern: Any
_xls_pattern: Pattern
_ppt_pattern: Pattern
def _check_olecf(data): ...
def _check_svg(data): ...
def _check_olecf(data: bytes) -> str | Literal[False]: ...
def _check_svg(data: bytes) -> str | None: ...
class _Entry(NamedTuple):
mimetype: Any
signatures: Any
discriminants: Any
_mime_mappings: Any
_Entry = collections.namedtuple('_Entry', ['mimetype', 'signatures', 'discriminants'])
_mime_mappings: tuple[_Entry, ...]
def _odoo_guess_mimetype(bin_data, default: str = ...): ...
def _odoo_guess_mimetype(bin_data: str, default: str = ...) -> str: ...
_guesser: Any
ms: Any
def guess_mimetype(bin_data, default: Any | None = ...): ...
guess_mimetype = _odoo_guess_mimetype
def guess_mimetype(bin_data: str, default: str | None = ...) -> str: ...
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_
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 xlwt
from babel.core import Locale
from xlwt import Worksheet
from .cache import *
from .parse_version import parse_version as parse_version
from collections.abc import Mapping, MutableMapping, MutableSet
from odoo.loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings
from typing import Any
from ..api import Environment
from ..loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings
_logger: Any
SKIPPED_ELEMENT_TYPES: Any
_T = TypeVar('_T')
_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): ...
def _exec_pipe(prog, args, env: Any | None = ...): ...
def exec_command_pipe(name, *args): ...
def find_pg_tool(name): ...
def exec_pg_environ(): ...
def exec_pg_command(name, *args) -> None: ...
def exec_pg_command_pipe(name, *args): ...
def file_path(file_path, filter_ext=...): ...
def file_open(name, mode: str = ..., filter_ext: Any | None = ...): ...
def flatten(list): ...
SKIPPED_ELEMENT_TYPES: tuple
NON_BREAKING_SPACE: str
def find_in_path(name: str) -> str: ...
def _exec_pipe(prog, args, env: Mapping[str, str] | None = ...) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def exec_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def find_pg_tool(name: str) -> str: ...
def exec_pg_environ() -> dict[str, str]: ...
def exec_pg_command(name: str, *args) -> None: ...
def exec_pg_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def 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 partition(pred, elems): ...
def topological_sort(elems): ...
def merge_sequences(*iterables): ...
def partition(pred: Callable[[_T], bool], elems: Iterable[_T]) -> tuple[list[_T], list[_T]]: ...
def topological_sort(elems: dict[_T, Any]) -> list[_T]: ...
def merge_sequences(*iterables: Iterable[_T]) -> list[_T]: ...
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):
def add_worksheet(self, name: Any | None = ..., **kw): ...
def add_worksheet(self, name: str | None = ..., **kw) -> Worksheet: ...
def to_xml(s): ...
def get_iso_codes(lang): ...
def scan_languages(): ...
def mod10r(number): ...
def str2bool(s, default: Any | None = ...): ...
def human_size(sz): ...
def logged(f): ...
def to_xml(s: str) -> str: ...
def get_iso_codes(lang: str) -> str: ...
def scan_languages() -> list[tuple[str, str]]: ...
def mod10r(number: str) -> str: ...
def str2bool(s: str, default: Any | None = ...) -> bool: ...
def human_size(sz) -> str: ...
def logged(f: _CallableT) -> _CallableT: ...
class profile:
fname: Any
def __init__(self, fname: Any | None = ...) -> None: ...
def __call__(self, f): ...
fname: str | None
def __init__(self, fname: str | None = ...) -> None: ...
def __call__(self, f: _CallableT) -> _CallableT: ...
def detect_ip_addr(): ...
def detect_ip_addr() -> str: ...
DEFAULT_SERVER_DATE_FORMAT: str
DEFAULT_SERVER_TIME_FORMAT: str
DEFAULT_SERVER_DATETIME_FORMAT: Any
DATE_LENGTH: Any
DATETIME_FORMATS_MAP: Any
POSIX_TO_LDML: Any
DEFAULT_SERVER_DATETIME_FORMAT: str
DATE_LENGTH: int
DATETIME_FORMATS_MAP: dict[str, str]
POSIX_TO_LDML: dict[str, str]
def posix_to_ldml(fmt, locale): ...
def split_every(n, iterable, piece_maker=...) -> None: ...
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 = ...): ...
def resolve_attr(obj, attr): ...
def posix_to_ldml(fmt: str, locale: Locale) -> str: ...
def split_every(n: int, iterable: Iterable[_T], piece_maker: Callable[[Iterable[_T]], _T1] = ...) -> Iterator[_T1]: ...
raise_error: object
def resolve_attr(obj, attr: str, default: object = ...): ...
def attrgetter(*items): ...
def discardattr(obj, key) -> None: ...
def remove_accents(input_str): ...
def discardattr(obj, key: str) -> None: ...
def remove_accents(input_str: str) -> str: ...
class unquote(str):
def __repr__(self): ...
def __repr__(self) -> str: ...
class UnquoteEvalContext(defaultdict):
def __init__(self, *args, **kwargs) -> None: ...
def __missing__(self, key): ...
class mute_logger:
loggers: Any
def __init__(self, *loggers) -> None: ...
def filter(self, record): ...
class mute_logger(Handler):
loggers: tuple[str]
old_params: dict[str, tuple[list[Handler], bool]]
def __init__(self, *loggers: str) -> None: ...
def __enter__(self) -> 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
class CountingStream:
stream: Any
index: Any
class CountingStream(Generic[_T]):
stream: Iterator[_T]
index: int
stopped: bool
def __init__(self, stream, start: int = ...) -> None: ...
def __iter__(self): ...
def next(self): ...
__next__: Any
def __init__(self, stream: Iterable[_T], start: int = ...) -> None: ...
def __iter__(self) -> CountingStream[_T]: ...
def next(self) -> _T: ...
__next__ = next
def stripped_sys_argv(*strip_args): ...
def stripped_sys_argv(*strip_args: str) -> list[str]: ...
class ConstantMapping(Mapping):
__slots__: Any
_value: Any
def __init__(self, val) -> None: ...
def __len__(self): ...
def __iter__(self): ...
def __getitem__(self, item): ...
class ConstantMapping(Mapping[_KT, _VT]):
__slots__ = ['_value']
_value: _VT
def __init__(self, val: _VT) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator: ...
def __getitem__(self, item) -> _VT: ...
def dumpstacks(sig: Any | None = ..., frame: Any | None = ..., thread_idents: Any | None = ...) -> None: ...
def freehash(arg): ...
def clean_context(context): ...
def freehash(arg) -> int: ...
def clean_context(context: dict[str, Any]) -> dict[str, Any]: ...
class frozendict(dict):
__slots__: Any
def __delitem__(self, key) -> None: ...
def __setitem__(self, key, val) -> None: ...
def clear(self) -> None: ...
def pop(self, key, default: Any | None = ...) -> None: ...
def popitem(self) -> None: ...
def setdefault(self, key, default: Any | None = ...) -> None: ...
def update(self, *args, **kwargs) -> None: ...
def __hash__(self): ...
__slots__ = ()
def __delitem__(self, key) -> NoReturn: ...
def __setitem__(self, key, val) -> NoReturn: ...
def clear(self) -> NoReturn: ...
def pop(self, key, default: Any | None = ...) -> NoReturn: ...
def popitem(self) -> NoReturn: ...
def setdefault(self, key, default: Any | None = ...) -> NoReturn: ...
def update(self, *args, **kwargs) -> NoReturn: ...
def __hash__(self) -> int: ...
class Collector(dict):
__slots__: Any
def __getitem__(self, key): ...
def __setitem__(self, key, val) -> None: ...
def add(self, key, val) -> None: ...
class Collector(dict[_KT, tuple[_T]]):
__slots__ = ()
def __getitem__(self, key: _KT) -> tuple[_T]: ...
def __setitem__(self, key: _KT, val: Iterable[_T]) -> None: ...
def add(self, key: _KT, val: _T) -> None: ...
def discard_keys_and_values(self, excludes: Collection): ...
class StackMap(MutableMapping):
__slots__: Any
_maps: Any
def __init__(self, m: Any | None = ...) -> None: ...
__slots__ = ['_maps']
_maps: list[MutableMapping]
def __init__(self, m: MutableMapping | None = ...) -> None: ...
def __getitem__(self, key): ...
def __setitem__(self, key, val) -> None: ...
def __delitem__(self, key) -> None: ...
def __iter__(self): ...
def __len__(self): ...
def __str__(self): ...
def pushmap(self, m: Any | None = ...) -> None: ...
def popmap(self): ...
def __iter__(self) -> Iterator: ...
def __len__(self) -> int: ...
def __str__(self) -> str: ...
def pushmap(self, m: MutableMapping | None = ...) -> None: ...
def popmap(self) -> MutableMapping: ...
class OrderedSet(MutableSet):
__slots__: Any
_map: Any
def __init__(self, elems=...) -> None: ...
def __contains__(self, elem): ...
def __iter__(self): ...
def __len__(self): ...
__slots__ = ['_map']
_map: dict
def __init__(self, elems: Iterable = ...) -> None: ...
def __contains__(self, elem) -> bool: ...
def __iter__(self) -> Iterator: ...
def __len__(self) -> int: ...
def add(self, elem) -> None: ...
def discard(self, elem) -> None: ...
def update(self, elems) -> None: ...
def difference_update(self, elems) -> None: ...
def __repr__(self): ...
def update(self, elems: Iterable) -> None: ...
def difference_update(self, elems: Iterable) -> None: ...
def __repr__(self) -> str: ...
class LastOrderedSet(OrderedSet):
def add(self, elem) -> None: ...
class Callbacks:
__slots__: Any
_funcs: Any
data: Any
__slots__ = ['_funcs', 'data']
_funcs: deque
data: dict
def __init__(self) -> None: ...
def add(self, func) -> None: ...
def add(self, func: Callable) -> None: ...
def run(self) -> None: ...
def clear(self) -> None: ...
class IterableGenerator:
__slots__: Any
func: Any
args: Any
def __init__(self, func, *args) -> None: ...
def __iter__(self): ...
class ReversedIterable(Generic[_T]):
__slots__ = ['iterable']
iterable: Iterable[_T]
def __init__(self, iterable: Iterable[_T]) -> None: ...
def __iter__(self) -> Iterator[_T]: ...
def __reversed__(self) -> Iterator[_T]: ...
def groupby(iterable, key: Any | None = ...): ...
def unique(it) -> None: ...
def groupby(iterable: Iterable[_T], key: Callable[..., _T1] | None = ...) -> ItemsView[_T1, _T]: ...
def unique(it: Iterable[_T]) -> Iterator[_T]: ...
def submap(mapping: Mapping[_KT, _VT], keys: Iterable[_KT]) -> dict[_KT, _VT]: ...
class Reverse:
__slots__: Any
__slots__ = ['val']
val: Any
def __init__(self, val) -> None: ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __ge__(self, other): ...
def __gt__(self, other): ...
def __le__(self, other): ...
def __lt__(self, other): ...
def __eq__(self, other) -> bool: ...
def __ne__(self, other) -> bool: ...
def __ge__(self, other) -> bool: ...
def __gt__(self, other) -> bool: ...
def __le__(self, other) -> bool: ...
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 = ...): ...
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): ...
html_escape = markupsafe.escape
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):
find_global: 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):
def __getattr__(self, attrib): ...
def get_diff(data_from, data_to, custom_style: bool = ...): ...
def traverse_containers(val, type_) -> None: ...
def hmac(env, scope, message, hash_function=...): ...
def get_diff(data_from: tuple[str, str], data_to: tuple[str, str], custom_style: bool = ...) -> str: ...
def hmac(env: Environment, scope, message, hash_function = ...) -> str: ...
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 typing import Any
from re import Pattern
from typing import BinaryIO, Callable, Iterable
_logger: Any
WINDOWS_RESERVED: Any
WINDOWS_RESERVED: Pattern
def clean_filename(name, replacement: str = ...): ...
def listdir(dir, recursive: bool = ...): ...
def walksymlinks(top, topdown: bool = ..., onerror: Any | None = ...): ...
def tempdir() -> None: ...
def zip_dir(path, stream, include_dir: bool = ..., fnct_sort: Any | None = ...) -> None: ...
def clean_filename(name: str, replacement: str = ...) -> str: ...
def listdir(dir: str, recursive: bool = ...) -> Iterable[str]: ...
def zip_dir(path: str, stream: str | BinaryIO, include_dir: bool = ..., fnct_sort: Callable | None = ...) -> None: ...
getppid: Any
is_running_as_nt_service: Any
_TH32CS_SNAPPROCESS: int
class _PROCESSENTRY32(ctypes.Structure):
_fields_: Any
is_running_as_nt_service: Callable[[], bool]

View File

@@ -1,7 +1,8 @@
from typing import Any
from re import Pattern
from typing import Callable, Iterator
component_re: Any
replace: Any
component_re: Pattern
replace: Callable
def _parse_version_parts(s) -> None: ...
def parse_version(s): ...
def _parse_version_parts(s: str) -> Iterator[str]: ...
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.generic import ArrayObject as ArrayObject
from PyPDF2.generic import ArrayObject as ArrayObject, IndirectObject
from PyPDF2.utils import b_ as b_
from typing import Any
DEFAULT_PDF_DATETIME_FORMAT: str
REGEX_SUBTYPE_UNFORMATED: Pattern
REGEX_SUBTYPE_FORMATED: Pattern
def _unwrapping_get(self, key, default: Any | None = ...): ...
@@ -11,14 +16,22 @@ class BrandedFileWriter(PdfFileWriter):
def __init__(self) -> None: ...
PdfFileWriter = BrandedFileWriter
def merge_pdf(pdf_data): ...
def rotate_pdf(pdf): ...
old_init: Any
def merge_pdf(pdf_data: Iterable[bytes]) -> bytes: ...
def rotate_pdf(pdf: bytes) -> bytes: ...
def add_banner(pdf_stream: str | BinaryIO, text: str | None = ..., logo: bool = ..., thickness: float = ...) -> BytesIO: ...
class OdooPdfFileReader(PdfFileReader):
def getAttachments(self): ...
def getAttachments(self) -> Iterable[tuple[Any, Any]]: ...
class OdooPdfFileWriter(PdfFileWriter):
def _create_attachment_object(self, attachment): ...
def addAttachment(self, fname, fdata) -> None: ...
_reader: PdfFileReader | 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
from typing import Any
import datetime
import random
from typing import Any, Callable, Iterable, Iterator, Sequence, TypeVar
def Random(seed): ...
def format_str(val, counter, values): ...
def chain_factories(field_factories, model_name): ...
def root_factory() -> None: ...
def randomize(vals, weights: Any | None = ..., seed: bool = ..., formatter=..., counter_offset: int = ...): ...
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 constant(val, formatter=...): ...
def compute(function, seed: Any | None = ...): ...
def randint(a, b, seed: Any | None = ...): ...
def randfloat(a, b, seed: Any | None = ...): ...
def randdatetime(*, base_date: Any | None = ..., relative_before: Any | None = ..., relative_after: Any | None = ..., seed: Any | None = ...): ...
from dateutil.relativedelta import relativedelta
from ..tools import pycompat as pycompat
_T = TypeVar('_T')
def Random(seed) -> random.Random: ...
def format_str(val: _T, counter, values) -> _T: ...
def chain_factories(field_factories: Iterable[tuple[str, Callable[..., Iterator]]], model_name: str) -> Iterator: ...
def root_factory() -> Iterator[dict]: ...
def randomize(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
counter_offset: int = ...) -> Callable[[Iterable, str, str], dict]: ...
def cartesian(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
then: Callable[[Iterable, str, str], dict] | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
def iterate(vals: Sequence, weights: Sequence | None = ..., seed: Any = ..., formatter: Callable[[Any, Any, Any], Any] = ...,
then: Callable[[Iterable, str, str], dict] | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
def constant(val: Sequence, formatter: Callable[[Any, Any, Any], Any] = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
def compute(function: Callable[[Any, Any, Any], Any], seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
def randint(a: int, b: int, seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
def randfloat(a: float, b: float, seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...
def randdatetime(*, base_date: datetime.datetime | None = ..., relative_before: datetime.timedelta | relativedelta | None = ...,
relative_after: datetime.timedelta | relativedelta | None = ..., seed: Any | None = ...) -> Callable[[Iterable, str, str], Iterator[dict]]: ...

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): ...
def _format_stack(stack): ...
def get_current_frame(thread: Any | None = ...): ...
def _get_stack_trace(frame, limit_frame: Any | None = ...): ...
def stack_size(): ...
def make_session(name: str = ...): ...
_T = TypeVar('_T')
real_datetime_now: Callable[..., datetime]
real_time: Callable[[], float]
def _format_frame(frame: FrameType) -> tuple[str, int, str, str]: ...
def _format_stack(stack: Iterable) -> list[list]: ...
def get_current_frame(thread: Thread | None = ...) -> FrameType: ...
def _get_stack_trace(frame: FrameType, limit_frame: FrameType | None = ...) -> list[tuple[str, int, str, str]]: ...
def stack_size() -> int: ...
def make_session(name: str = ...) -> str: ...
def force_hook() -> None: ...
class Collector:
name: Any
_registry: Any
name: str | None
_registry: dict[str, Any]
@classmethod
def __init_subclass__(cls) -> None: ...
@classmethod
def make(cls, name, *args, **kwargs): ...
def make(cls, name: str, *args, **kwargs): ...
_processed: bool
_entries: Any
profiler: Any
_entries: list[dict]
profiler: Profiler | None
def __init__(self) -> None: ...
def start(self) -> None: ...
def stop(self) -> None: ...
def add(self, entry: Any | None = ..., frame: Any | None = ...) -> None: ...
def _get_stack_trace(self, frame: Any | None = ...): ...
def add(self, entry: dict | None = ..., frame: FrameType | None = ...) -> None: ...
def _get_stack_trace(self, frame: FrameType | None = ...) -> list[tuple[str, int, str, str]]: ...
def post_process(self) -> None: ...
@property
def entries(self): ...
def entries(self) -> list[dict]: ...
class SQLCollector(Collector):
name: str
def start(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):
name: str
active: bool
frame_interval: Any
thread: Any
last_frame: Any
frame_interval: float
thread: Thread
last_frame: FrameType | None
def __init__(self, interval: float = ...) -> None: ...
def run(self) -> None: ...
def start(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):
name: str
def start(self) -> None: ...
def stop(self) -> None: ...
def hook(self, _frame, event, _arg: Any | None = ...): ...
def _get_stack_trace(self, frame: Any | None = ...) -> None: ...
def hook(self, _frame: FrameType, event: str, _arg: Any | None = ...): ...
def _get_stack_trace(self, frame: FrameType | None = ...) -> None: ...
def post_process(self) -> None: ...
class QwebTracker:
@classmethod
def wrap_render(cls, method_render): ...
def wrap_render(cls, method_render: _T) -> _T: ...
@classmethod
def wrap_compile(cls, method_compile): ...
def wrap_compile(cls, method_compile: _T) -> _T: ...
@classmethod
def wrap_compile_directive(cls, method_compile_directive): ...
def wrap_compile_directive(cls, method_compile_directive: _T) -> _T: ...
execution_context_enabled: Any
qweb_hooks: Any
context_stack: Any
cr: Any
qweb_hooks: Iterable[Callable]
context_stack: list[ExecutionContext]
cr: Cursor
view_id: Any
def __init__(self, view_id, arch, cr) -> 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):
name: str
events: Any
hook: Any
events: list
hook: Callable
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 stop(self) -> None: ...
def post_process(self) -> None: ...
class ExecutionContext:
context: Any
previous_context: Any
context: dict
previous_context: tuple | None
def __init__(self, **context) -> None: ...
def __enter__(self) -> None: ...
def __exit__(self, *_args) -> None: ...
@@ -92,26 +100,29 @@ class Profiler:
start_time: int
duration: int
profile_session: Any
description: Any
init_frame: Any
init_stack_trace: Any
init_thread: Any
disable_gc: Any
filecache: Any
description: str | None
init_frame: FrameType | None
init_stack_trace: list[tuple[str, int, str, str]] | None
init_thread: Thread | None
disable_gc: bool
filecache: dict
params: Any
db: Any
collectors: Any
def __init__(self, collectors: Any | None = ..., db=..., profile_session: Any | None = ..., description: Any | None = ..., disable_gc: bool = ..., params: Any | None = ...) -> None: ...
def __enter__(self): ...
profile_id: Any
db: str | None
collectors: list[Collector]
def __init__(self, collectors: list[str | Collector] | None = ..., db: str | None = ...,
profile_session: Any | None = ..., description: str | None = ..., disable_gc: bool = ...,
params: Any | None = ...) -> None: ...
def __enter__(self: _T) -> _T: ...
def __exit__(self, *args) -> None: ...
def _add_file_lines(self, stack) -> None: ...
def entry_count(self): ...
def format_path(self, path): ...
def json(self): ...
def _add_file_lines(self, stack: list[tuple[str, int, str, str]]) -> None: ...
def entry_count(self) -> int: ...
def format_path(self, path: str) -> str: ...
def json(self) -> str: ...
class Nested:
profiler: Any
context_manager: Any
def __init__(self, profiler, context_manager) -> None: ...
def __enter__(self): ...
class Nested(Generic[_T]):
profiler: Profiler
context_manager: ContextManager[_T]
def __init__(self, profiler: Profiler, context_manager: ContextManager[_T]) -> None: ...
def __enter__(self) -> _T: ...
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
_writer: Any
class _StreamReader(Protocol):
def __call__(self, stream: BinaryIO, errors: str = ...) -> StreamReader: ...
def csv_reader(stream, **params): ...
def csv_writer(stream, **params): ...
def to_text(source): ...
class _StreamWriter(Protocol):
def __call__(self, stream: BinaryIO, errors: str = ...) -> StreamWriter: ...
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): ...
template_env_globals: Any
template_env_globals: dict[str, Any]
def parse_inline_template(text): ...
def convert_inline_template_to_qweb(template): ...
def render_inline_template(template_instructions, variables): ...
def parse_inline_template(text: str) -> list[tuple[str, str]]: ...
def convert_inline_template_to_qweb(template: str) -> Markup: ...
def render_inline_template(template_instructions: Iterable[tuple[str, str]], variables: dict) -> str: ...

View File

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

View File

@@ -1,22 +1,22 @@
from typing import Any
class SourceMapGenerator:
_file: Any
_source_root: Any
_sources: Any
_mappings: Any
_sources_contents: Any
_file: None
_source_root: str | None
_sources: dict[str, int]
_mappings: list[dict[str, Any]]
_sources_contents: dict[str, str]
_version: int
_cache: Any
def __init__(self, source_root: Any | None = ...) -> None: ...
def _serialize_mappings(self): ...
def to_json(self): ...
def get_content(self): ...
def add_source(self, source_name, source_content, last_index, start_offset: int = ...) -> None: ...
_cache: dict[tuple[int, int], str]
def __init__(self, source_root: str | None = ...) -> None: ...
def _serialize_mappings(self) -> str: ...
def to_json(self) -> dict: ...
def get_content(self) -> bytes: ...
def add_source(self, source_name: str, source_content: str, last_index: int, start_offset: int = ...) -> None: ...
B64CHARS: bytes
SHIFTSIZE: Any
FLAG: Any
MASK: Any
SHIFTSIZE: int
FLAG: int
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
shorten: Any
_SpeedscopeT = TypeVar('_SpeedscopeT', bound=Speedscope)
shortener: Repr
shorten: Callable[[Any], str]
class Speedscope:
init_stack_trace: Any
init_stack_trace_level: Any
caller_frame: Any
init_caller_frame: Any
profiles_raw: Any
name: Any
frames_indexes: Any
init_stack_trace: list[Sequence]
init_stack_trace_level: int
caller_frame: Sequence | None
init_caller_frame: Sequence | None
profiles_raw: dict
name: str
frames_indexes: dict[Any, int]
frame_count: int
profiles: Any
def __init__(self, name: str = ..., init_stack_trace: Any | None = ...) -> None: ...
profiles: list
def __init__(self, name: str = ..., init_stack_trace: list | None = ...) -> None: ...
def add(self, key, profile) -> None: ...
def convert_stack(self, stack) -> None: ...
def add_output(self, names, complete: bool = ..., display_name: Any | None = ..., use_context: bool = ..., **params): ...
def add_default(self): ...
def make(self): ...
def get_frame_id(self, frame): ...
def stack_to_ids(self, stack, context, stack_offset: int = ...): ...
def process(self, entries, continuous: bool = ..., hide_gaps: bool = ..., use_context: bool = ...): ...
def convert_stack(self, stack: list[Sequence]) -> None: ...
def add_output(self: _SpeedscopeT, names: Iterable[str], complete: bool = ..., display_name: str | None = ...,
use_context: bool = ..., **params) -> _SpeedscopeT: ...
def add_default(self: _SpeedscopeT) -> _SpeedscopeT: ...
def make(self) -> dict: ...
def get_frame_id(self, frame) -> int: ...
def stack_to_ids(self, stack: list, context: Iterable[tuple[int, dict]], stack_offset: int = ...) -> list[int]: ...
def process(self, entries: list[dict], continuous: bool = ..., hide_gaps: bool = ..., use_context: bool = ...,
constant_time: bool = ...) -> list[dict]: ...

View File

@@ -1,31 +1,43 @@
from typing import Any
from collections import defaultdict
from typing import Iterable, Literal
_schema: Any
_CONFDELTYPES: Any
from ..models import BaseModel
from ..sql_db import Cursor
def existing_tables(cr, tablenames): ...
def table_exists(cr, tablename): ...
def table_kind(cr, tablename): ...
def create_model_table(cr, tablename, comment: Any | None = ..., columns=...) -> None: ...
def table_columns(cr, tablename): ...
def column_exists(cr, tablename, columnname): ...
def create_column(cr, tablename, columnname, columntype, comment: Any | None = ...) -> None: ...
def rename_column(cr, tablename, columnname1, columnname2) -> None: ...
def convert_column(cr, tablename, columnname, columntype) -> None: ...
def set_not_null(cr, tablename, columnname) -> None: ...
def drop_not_null(cr, tablename, columnname) -> None: ...
def constraint_definition(cr, tablename, constraintname): ...
def add_constraint(cr, tablename, constraintname, definition) -> None: ...
def drop_constraint(cr, tablename, constraintname) -> None: ...
def add_foreign_key(cr, tablename1, columnname1, tablename2, columnname2, ondelete): ...
def get_foreign_keys(cr, tablename1, columnname1, tablename2, columnname2, ondelete): ...
def fix_foreign_key(cr, tablename1, columnname1, tablename2, columnname2, ondelete): ...
def index_exists(cr, indexname): ...
def create_index(cr, indexname, tablename, expressions) -> None: ...
def create_unique_index(cr, indexname, tablename, expressions) -> None: ...
def drop_index(cr, indexname, tablename) -> None: ...
def drop_view_if_exists(cr, viewname) -> None: ...
def escape_psql(to_escape): ...
def pg_varchar(size: int = ...): ...
def reverse_order(order): ...
def increment_field_skiplock(record, field): ...
_CONFDELTYPES: dict[str, str]
def existing_tables(cr: Cursor, tablenames: Iterable[str]) -> list[str]: ...
def table_exists(cr: Cursor, tablename: str) -> bool: ...
def table_kind(cr: Cursor, tablename: str) -> str | None: ...
SQL_ORDER_BY_TYPE: defaultdict
def create_model_table(cr: Cursor, tablename: str, comment: str | None = ..., columns: Iterable = ...) -> None: ...
def table_columns(cr: Cursor, tablename: str) -> dict: ...
def column_exists(cr: Cursor, tablename: str, columnname: str) -> int: ...
def create_column(cr: Cursor, tablename: str, columnname: str, columntype: str, comment: str | None = ...) -> None: ...
def rename_column(cr: Cursor, tablename: str, columnname1: str, columnname2: str) -> None: ...
def convert_column(cr: Cursor, tablename: str, columnname: str, columntype: str) -> None: ...
def convert_column_translatable(cr: Cursor, tablename: str, columnname: str, columntype: str) -> None: ...
def _convert_column(cr: Cursor, tablename: str, columnname: str, columntype: str, using: str) -> None: ...
def drop_depending_views(cr: Cursor, table: str, column: str) -> None: ...
def get_depending_views(cr: Cursor, table: str, column: str): ...
def set_not_null(cr: Cursor, tablename: str, columnname: str) -> None: ...
def drop_not_null(cr: Cursor, tablename: str, columnname: str) -> None: ...
def constraint_definition(cr: Cursor, tablename: str, constraintname: str) -> str | None: ...
def add_constraint(cr: Cursor, tablename: str, constraintname: str, definition: str) -> None: ...
def drop_constraint(cr: Cursor, tablename: str, constraintname: str) -> None: ...
def add_foreign_key(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> Literal[True]: ...
def get_foreign_keys(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> list[str]: ...
def fix_foreign_key(cr: Cursor, tablename1: str, columnname1: str, tablename2: str, columnname2: str, ondelete) -> list[str]: ...
def 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: ...
def add_text_inside(node, text) -> None: ...
def remove_element(node) -> None: ...
def locate_node(arch, spec): ...
def apply_inheritance_specs(source, specs_tree, inherit_branding: bool = ..., pre_locate=...): ...
RSTRIP_REGEXP: Pattern
def add_stripped_items_before(node: _Element, spec: _Element, extract: Callable[[_Element], _Element]) -> None: ...
def add_text_before(node: _Element, text: str | None) -> None: ...
def remove_element(node: _Element) -> None: ...
def locate_node(arch: _Element, spec: _Element) -> _Element: ...
def apply_inheritance_specs(source: _Element, specs_tree: _Element, inherit_branding: bool = ...,
pre_locate: Callable[[_Element], Any] = ...) -> _Element: ...

View File

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

View File

@@ -1,133 +1,163 @@
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
SKIPPED_ELEMENTS: Any
_LOCALE2WIN32: Any
ENGLISH_SMALL_WORDS: Any
SKIPPED_ELEMENTS: tuple[str, ...]
_LOCALE2WIN32: dict[str, str]
class UNIX_LINE_TERMINATOR(csv.excel):
lineterminator: str
def encode(s): ...
def encode(s: str) -> str: ...
TRANSLATED_ELEMENTS: Any
TRANSLATED_ATTRS: Any
TRANSLATED_ELEMENTS: set[str]
TRANSLATED_ATTRS: dict[str, Any]
def translate_attrib_value(node): ...
def translate_attrib_value(node: _Element) -> bool: ...
avoid_pattern: Any
node_pattern: Any
avoid_pattern: Pattern
def translate_xml_node(node, callback, parse, serialize): ...
def parse_xml(text): ...
def serialize_xml(node): ...
def translate_xml_node(node: _Element, callback: Callable[[str], str | None], parse: Callable[[str], _Element],
serialize: Callable[[_Element], str]) -> _Element: ...
def parse_xml(text: str) -> _Element: ...
def serialize_xml(node: _Element) -> str: ...
_HTML_PARSER: Any
_HTML_PARSER: HTMLParser
def parse_html(text): ...
def serialize_html(node): ...
def xml_translate(callback, value): ...
def html_translate(callback, value): ...
def translate(cr, name, source_type, lang, source: Any | None = ...): ...
def translate_sql_constraint(cr, key, lang): ...
def parse_html(text: str) -> _Element: ...
def serialize_html(node: _Element) -> str: ...
def xml_translate(callback: Callable[[str], str | None], value: str) -> str: ...
def xml_term_converter(value: str) -> str: ...
def html_translate(callback: Callable[[str], str | None], value: str) -> str: ...
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:
def _get_db(self): ...
def _get_cr(self, frame, allow_create: bool = ...): ...
def _get_uid(self, frame): ...
def _get_lang(self, frame): ...
def __call__(self, source, *args, **kwargs): ...
def _get_translation(self, source): ...
def _get_db(self) -> Connection | None: ...
def _get_cr(self, frame: FrameType, allow_create: bool = ...) -> tuple[Cursor, bool]: ...
def _get_uid(self, frame: FrameType) -> int: ...
def _get_lang(self, frame: FrameType) -> str: ...
def __call__(self, source: str, *args, **kwargs) -> str: ...
def _get_translation(self, source: str, module: str | None = ...) -> str: ...
class _lt:
__slots__: Any
_source: Any
_args: Any
def __init__(self, source, *args, **kwargs) -> None: ...
def __str__(self): ...
def __eq__(self, other): ...
def __lt__(self, other): ...
def __add__(self, other): ...
def __radd__(self, other): ...
__slots__ = ['_source', '_args', '_module']
_source: str
_args: tuple
_module: str
def __init__(self, source: str, *args, **kwargs) -> None: ...
def __str__(self) -> str: ...
def __eq__(self, other) -> NoReturn: ...
def __lt__(self, other) -> NoReturn: ...
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_replacements: Any
re_escaped_char: Pattern
re_escaped_replacements: dict[str, str]
def _sub_replacement(match_obj): ...
def unquote(str): ...
def TranslationFileReader(source, fileformat: str = ...): ...
def _sub_replacement(match_obj: Match) -> str: ...
def unquote(str: str) -> str: ...
def TranslationFileReader(source: IO, fileformat: str = ...) -> CSVFileReader | PoFileReader: ...
class CSVFileReader:
source: Any
source: csv.DictReader
prev_code_src: str
def __init__(self, source) -> None: ...
def __iter__(self): ...
def __init__(self, source: IO) -> None: ...
def __iter__(self) -> Iterator[csv.DictReader]: ...
class PoFileReader:
pofile: Any
def __init__(self, source): ...
def __iter__(self): ...
pofile: POFile
def __init__(self, source: str | IO): ...
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:
writer: Any
def __init__(self, target) -> None: ...
def write_rows(self, rows) -> None: ...
writer: _CsvWriter
def __init__(self, target: BinaryIO) -> None: ...
def write_rows(self, rows: Iterable) -> None: ...
class PoFileWriter:
buffer: Any
lang: Any
po: Any
def __init__(self, target, lang) -> None: ...
def write_rows(self, rows) -> None: ...
def add_entry(self, modules, tnrs, source, trad, comments: Any | None = ...) -> None: ...
buffer: IO
lang: str
po: POFile
def __init__(self, target: IO, lang: str) -> None: ...
def write_rows(self, rows: Iterable) -> None: ...
def add_entry(self, modules, tnrs, source, trad, comments: Iterable[str] | None = ...) -> None: ...
class TarFileWriter:
tar: Any
lang: Any
def __init__(self, target, lang) -> None: ...
def write_rows(self, rows) -> None: ...
tar: TarFile
lang: str
def __init__(self, target: IO, lang: str) -> None: ...
def write_rows(self, rows: Iterable) -> None: ...
def trans_export(lang, modules, buffer, format, cr) -> None: ...
def trans_parse_rml(de): ...
def _push(callback, term, source_line) -> None: ...
def in_modules(object_name, modules): ...
def _extract_translatable_qweb_terms(element, callback) -> None: ...
def babel_extract_qweb(fileobj, keywords, comment_tags, options): ...
def trans_export(lang: str, modules: list[str], buffer, format: str, cr: Cursor) -> None: ...
def _push(callback: Callable[[str, int], Any], term: str, source_line: int) -> None: ...
def _extract_translatable_qweb_terms(element: _Element, callback: Callable[[str, int], Any]) -> None: ...
def babel_extract_qweb(fileobj: IO, keywords, comment_tags, options) -> list[tuple]: ...
def extract_formula_terms(formula: str) -> Iterator[str]: ...
def extract_spreadsheet_terms(fileobj, keywords, comment_tags, options) -> Iterator[tuple[int, str, str, list]]: ...
class ImdInfo(NamedTuple):
name: Any
model: Any
res_id: Any
module: Any
ImdInfo = namedtuple('ExternalId', ['name', 'model', 'res_id', 'module'])
class TranslationModuleReader:
_cr: Any
_modules: Any
_lang: Any
env: Any
_to_translate: Any
_path_list: Any
_installed_modules: Any
def __init__(self, cr, modules: Any | None = ..., lang: Any | None = ...) -> None: ...
def __iter__(self): ...
def _push_translation(self, module, ttype, name, res_id, source, comments: Any | None = ..., record_id: Any | None = ...) -> None: ...
def _get_translatable_records(self, imd_records): ...
_cr: Cursor
_modules: list[str]
_lang: str | None
env: Environment
_to_translate: list[tuple]
_path_list: list[tuple[str, Any]]
_installed_modules: list[str]
def __init__(self, cr: Cursor, modules: list[str] | None = ..., lang: str | None = ...) -> None: ...
def __iter__(self) -> Iterable[tuple]: ...
def _push_translation(self, module: str, ttype: str, name: str, res_id: str, source: str,
comments: Iterable[str] | None = ..., record_id: int | None = ..., value: Any | None = ...) -> None: ...
def _get_translatable_records(self, imd_records: Iterable[ImdInfo]) -> BaseModel: ...
def _export_translatable_records(self) -> None: ...
def _get_module_from_path(self, path): ...
def _verified_module_filepaths(self, fname, path, root): ...
def _babel_extract_terms(self, fname, path, root, extract_method: str = ..., trans_type: str = ..., extra_comments: Any | None = ..., extract_keywords=...) -> None: ...
def _get_module_from_path(self, path: str) -> str: ...
def _verified_module_filepaths(self, fname: str, path: str, root: str) -> tuple[str | None, str | None, str | None, str | None]: ...
def _babel_extract_terms(self, fname: str, path: str, root: str, extract_method: str = ..., trans_type: str = ...,
extra_comments: list[str] | None = ..., extract_keywords: dict = ...) -> None: ...
def _export_translatable_resources(self) -> None: ...
def trans_load(cr, filename, lang, verbose: bool = ..., create_empty_translation: bool = ..., overwrite: bool = ...): ...
def trans_load_data(cr, fileobj, fileformat, lang, verbose: bool = ..., create_empty_translation: bool = ..., overwrite: bool = ...) -> None: ...
def get_locales(lang: Any | None = ...) -> None: ...
def resetlocale(): ...
def load_language(cr, lang) -> None: ...
def trans_load(cr: Cursor, filename: str, lang: str, verbose: bool = ..., overwrite: bool = ...) -> None: ...
def trans_load_data(cr: Cursor, fileobj: IO, fileformat: str, lang: str, verbose: bool = ..., overwrite: bool = ...) -> None: ...
def _trans_load_data(cr: Cursor, reader, lang: str, overwrite: bool = ..., force_overwrite: bool = ...,
xml_ids: Container[str] | None = ...) -> 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
_validators: Any
_relaxng_cache: Any
READONLY: Any
from lxml.etree import RelaxNG, _Element
def _get_attrs_symbols(): ...
def get_variable_names(expr): ...
def get_dict_asts(expr): ...
def _check(condition, explanation) -> None: ...
def get_domain_identifiers(expr): ...
def valid_view(arch, **kwargs): ...
def validate(*view_types): ...
def relaxng(view_type): ...
def schema_valid(arch, **kwargs): ...
_CallableT = TypeVar('_CallableT', bound=Callable)
_validators: defaultdict[str, list[Callable]]
_relaxng_cache: dict[str, RelaxNG | None]
READONLY: Pattern
def _get_attrs_symbols() -> set[str]: ...
def get_variable_names(expr: str | _expr) -> set[str]: ...
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.path import dirname as dirname
from typing import Any
from typing import Iterator
__docformat__: str
__all__: Any
ENOENT: int
windows: Any
seen: Any
defpathext: Any
windows: bool
seen: set
defpathext: list[str]
def which_files(file, mode=..., path: Any | None = ..., pathext: Any | None = ...) -> None: ...
def which(file, mode=..., path: Any | None = ..., pathext: Any | None = ...): ...
def which_files(file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...) -> Iterator[str]: ...
def which(file: str, mode: int = ..., path: str | None = ..., pathext: str | None = ...) -> str: ...

View File

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

View File

@@ -1,11 +1,22 @@
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):
env: Any
def __init__(self, env) -> None: ...
def resolve(self, url, id, context): ...
env: Environment
prefix: str | None
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 create_xml_node_chain(first_parent_node, nodes_list, last_node_value: Any | None = ...): ...
def create_xml_node(parent_node, node_name, node_value: Any | 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: _Element, nodes_list: Iterable[str], last_node_value: str | None = ...) -> list[_Element]: ...
def create_xml_node(parent_node: _Element, node_name: str, node_value: str | None = ...) -> _Element: ...
def cleanup_xml_node(xml_node_or_string: _Element | str, remove_blank_text: bool = ..., remove_blank_nodes: bool = ...,
indent_level: int = ..., indent_space: str = ...) -> _Element: ...
def 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