This commit is contained in:
Trinh Anh Ngoc
2023-05-19 17:46:34 +07:00
parent ad59b8ee5f
commit 00da547cc0
43 changed files with 39 additions and 633 deletions

View File

@@ -1,5 +1,3 @@
from psycopg2 import connection
from . import addons as addons
from . import api as api
from . import conf as conf
@@ -18,13 +16,7 @@ from .tools.translate import _ as _
from .tools.translate import _lt as _lt
evented: bool
def gevent_wait_callback(conn: connection, timeout: float | None = ...) -> None: ...
multi_process: bool
def _decompress(data: bytes) -> bytes: ...
SUPERUSER_ID: int
def registry(database_name: str | None = ...) -> Registry: ...

View File

@@ -6,7 +6,6 @@ from typing import (
Iterable,
Iterator,
KeysView,
Literal,
Mapping,
Optional,
TypeVar,
@@ -14,7 +13,8 @@ from typing import (
)
from weakref import WeakSet
from werkzeug.local import Local
from odoo.addons.base.models.res_company import Company
from odoo.addons.base.models.res_users import Users
from .fields import Field
from .models import BaseModel
@@ -32,7 +32,6 @@ class Params:
args: tuple
kwargs: dict
def __init__(self, args: tuple, kwargs: dict) -> None: ...
def __str__(self) -> str: ...
class Meta(type):
def __new__(meta, name: str, bases: tuple, attrs: dict): ...
@@ -49,19 +48,8 @@ def returns(
def downgrade(method: Callable, value, self, args, kwargs): ...
def split_context(method: Callable, args, kwargs) -> tuple: ...
def model(method: _CallableT) -> _CallableT: ...
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): ...
class Environment(Mapping[str, BaseModel]):
@@ -69,7 +57,6 @@ class Environment(Mapping[str, BaseModel]):
uid: int = ...
context: dict[str, Any] = ...
su: bool = ...
_local: Local
envs: Environments
args: tuple[Cursor, int, dict, bool]
@classmethod
@@ -79,7 +66,6 @@ class Environment(Mapping[str, BaseModel]):
all: Environments
registry: Registry
cache: Cache
_protected: StackMap[Field, set[int]]
def __new__(
cls, cr: Cursor, uid: int, context: dict, su: bool = ...
) -> Environment: ...
@@ -93,7 +79,7 @@ class Environment(Mapping[str, BaseModel]):
def __call__(
self,
cr: Cursor | None = ...,
user: Union["odoo.model.res_users", int, None] = ...,
user: "Union[Users, int, None]" = ...,
context: dict | None = ...,
su: bool | None = ...,
) -> Environment: ...
@@ -104,11 +90,11 @@ class Environment(Mapping[str, BaseModel]):
def is_admin(self) -> bool: ...
def is_system(self) -> bool: ...
@property
def user(self) -> "odoo.model.res_users": ...
def user(self) -> "Users": ...
@property
def company(self) -> "odoo.model.res_company": ...
def company(self) -> "Company": ...
@property
def companies(self) -> "odoo.model.res_company": ...
def companies(self) -> "Company": ...
@property
def lang(self) -> str: ...
def clear(self) -> None: ...
@@ -139,7 +125,6 @@ class Environments:
NOTHING: object
class Cache:
_data: defaultdict[Field, dict]
def __init__(self) -> None: ...
def contains(self, record: BaseModel, field: Field) -> bool: ...
def get(self, record: BaseModel, field: Field, default=...): ...

View File

@@ -6,7 +6,6 @@ from typing import (
Generic,
Iterator,
Sequence,
Type,
TypeVar,
Union,
overload,
@@ -51,13 +50,7 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
column_type: tuple[str, str] | None
column_format: str
column_cast_from: tuple[str, ...]
_slots: dict[str, Any]
args: dict[str, Any] | None
_attrs: dict[str | None]
_module: str
_modules: set[str]
_setup_done: str | None
_sequence: int | None
automatic: bool
inherited: bool
inherited_field: Field | None
@@ -98,54 +91,15 @@ class Field(Generic[_FieldValueT], metaclass=MetaField):
def __setattr__(self, name, value) -> None: ...
def set_all_attrs(self, attrs) -> None: ...
def __delattr__(self, name) -> None: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def setup_base(self, model: BaseModel, name: str) -> None: ...
def _can_setup_from(self, field: Field) -> bool: ...
def _get_attrs(self, model: BaseModel, name: str) -> dict[str, Any]: ...
def _setup_attrs(self, model: BaseModel, name: str): ...
def setup_full(self, model: BaseModel) -> None: ...
def _setup_regular_base(self, model: BaseModel) -> None: ...
def _setup_regular_full(self, model: BaseModel) -> None: ...
def _setup_related_full(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: 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) -> Field: ...
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 cache_key(self, env: Environment) -> tuple: ...
recursive: bool
def resolve_depends(self, model: BaseModel) -> Iterator[tuple]: ...
def get_description(self, env: Environment) -> dict[str, Any]: ...
_description_store: bool | None
_description_manual: Any
_description_depends: Collection[str] | None
_description_related: str | Sequence[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_deprecated: bool | None
_description_group_operator: str | None
@property
def _description_searchable(self) -> bool: ...
@property
def _description_sortable(self) -> bool: ...
def _description_string(self, env: Environment) -> str | None: ...
def _description_help(self, env: Environment) -> str | None: ...
def null(self, record: BaseModel) -> bool: ...
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
@@ -188,7 +142,6 @@ class Boolean(Field[bool]):
class Integer(Field[int]):
type: str
column_type: tuple[str, str]
_slots: dict[str, Any]
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
) -> int: ...
@@ -197,22 +150,17 @@ class Integer(Field[int]):
) -> 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[float]):
type: str
column_cast_from: tuple[str, str, str]
_slots: dict[str, Any]
_digits: tuple[int, int] | str | None
def __init__(
self, string: str = ..., digits: tuple[int, int] | str | None = ..., **kwargs
) -> None: ...
@property
def column_type(self): ...
def get_digits(self, env: Environment) -> tuple[int, int]: ...
_related__digits: Any
def _description_digits(self, env: Environment) -> tuple[int, int]: ...
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
) -> float: ...
@@ -226,16 +174,11 @@ class Monetary(Field[float]):
type: str
column_type: tuple[str, str]
column_cast_from: tuple[str]
_slots: dict[str, Any]
currency_field: str | None
group_operator: str
def __init__(
self, string: str = ..., currency_field: str = ..., **kwargs
) -> None: ...
_description_currency_field: str | None
def _setup_currency_field(self, model: BaseModel) -> None: ...
def _setup_regular_full(self, model: BaseModel) -> None: ...
def _setup_related_full(self, model: BaseModel) -> None: ...
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
) -> float: ...
@@ -247,13 +190,9 @@ class Monetary(Field[float]):
def convert_to_write(self, value, record: BaseModel): ...
class _String(Field[str]):
_slots: dict[str, Any]
translate: Callable | bool
prefetch: Any
def __init__(self, string: str = ..., **kwargs) -> None: ...
def _setup_attrs(self, model: BaseModel, name: str) -> None: ...
_related_translate: bool
def _description_translate(self, env: Environment) -> bool: ...
def get_trans_terms(self, value) -> list: ...
def get_trans_func(self, records: BaseModel) -> Callable: ...
def check_trans_value(self, value): ...
@@ -262,17 +201,11 @@ class _String(Field[str]):
class Char(_String):
type: str
column_cast_from: tuple[str]
_slots: dict[str, Any]
size: int | None
trim: bool
@property
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 _setup_regular_base(self, model: BaseModel) -> None: ...
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
) -> str | None: ...
@@ -289,7 +222,6 @@ class Text(_String):
class Html(_String):
type: str
column_type: tuple[str, str]
_slots: dict[str, Any]
sanitize: bool
sanitize_tags: bool
sanitize_attributes: bool
@@ -297,19 +229,6 @@ class Html(_String):
sanitize_form: bool
strip_style: bool
strip_classes: bool
def _get_attrs(self, model: BaseModel, name: str) -> dict[str, Any]: ...
_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: ...
@@ -368,18 +287,13 @@ class Datetime(Field[datetime.datetime]):
def convert_to_export(self, value, record: BaseModel): ...
def convert_to_display_name(self, value, record: BaseModel) -> str: ...
_BINARY = memoryview
class Binary(Field[bytes]):
type: str
_slots: dict[str, Any]
prefetch: bool
depends_context: tuple[str]
attachment: bool
@property
def column_type(self) -> tuple[str, str] | None: ...
def _get_attrs(self, model: 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: ...
@@ -393,29 +307,20 @@ class Binary(Field[bytes]):
def write(self, records: _ModelT, value) -> _ModelT: ...
class Image(Binary):
_slots: dict[str, Any]
max_width: int
max_height: int
verify_resolution: bool
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[str]):
type: str
column_type: tuple[str, str]
_slots: dict[str, Any]
selection: _SelectionRaw
validate: bool
def __init__(
self, selection: _SelectionRaw = ..., string: str = ..., **kwargs
) -> None: ...
def _setup_regular_base(self, model: BaseModel) -> None: ...
def _setup_related_full(self, model: BaseModel) -> None: ...
def _setup_attrs(self, model: BaseModel, name: str) -> None: ...
def _selection_modules(self, model: BaseModel) -> dict[str, set[str, str]]: ...
def _description_selection(self, env: Environment) -> _Selection: ...
def get_values(self, env: Environment) -> list[str]: ...
def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
@@ -442,37 +347,25 @@ class Reference(Selection):
class _Relational(Field[BaseModel]):
relational: bool
_slots: dict[str, Any]
domain: _DomainRaw
context: dict
check_company: bool
comodel_name: str
def _setup_regular_base(self, model: BaseModel) -> None: ...
def get_domain_list(self, model: BaseModel) -> _Domain: ...
@property
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: tuple[str, str]
_slots: dict[str, Any]
ondelete: str | None
auto_join: bool
delegate: bool
def __init__(
self, comodel_name: str = ..., string: str = ..., **kwargs
) -> None: ...
def _setup_attrs(self, model: BaseModel, name: str) -> None: ...
def _setup_regular_base(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 = ...
): ...
@@ -484,36 +377,26 @@ class Many2one(_Relational):
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
_slots: dict[str, Any]
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 _RelationalMulti(_Relational):
write_sequence: int
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_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 _setup_regular_full(self, model: BaseModel) -> None: ...
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
_slots: dict[str, Any]
inverse_name: str | None
auto_join: bool
limit: int | None
@@ -525,8 +408,6 @@ class One2many(_RelationalMulti):
string: str = ...,
**kwargs
) -> None: ...
def _setup_regular_full(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 read(self, records: BaseModel): ...
@@ -535,8 +416,6 @@ class One2many(_RelationalMulti):
class Many2many(_RelationalMulti):
type: str
_slots: dict[str, Any]
_explicit: bool
relation: str | None
column1: str | None
column2: str | None
@@ -552,8 +431,6 @@ class Many2many(_RelationalMulti):
string: str = ...,
**kwargs
) -> None: ...
def _setup_regular_base(self, model: BaseModel) -> None: ...
def _setup_regular_full(self, model: BaseModel) -> None: ...
def update_db(self, model: BaseModel, columns) -> None: ...
def update_db_foreign_keys(self, model: BaseModel) -> None: ...
def read(self, records: BaseModel) -> None: ...
@@ -563,7 +440,6 @@ class Many2many(_RelationalMulti):
class Id(Field[int]):
type: str
column_type: tuple[str, str]
_slots: dict[str, Any]
string: str
store: bool
readonly: bool

View File

@@ -1,11 +1,12 @@
from logging import Logger
from typing import Any, Callable, Collection, Generator, TypeVar
from typing import Any, Callable, Generator, TypeVar
import werkzeug.contrib.sessions
import werkzeug.wrappers
from odoo.addons.base.models.res_lang import Lang
from odoo.addons.website.models.website import Website
from werkzeug.datastructures import CombinedMultiDict
from werkzeug.exceptions import NotFound
from werkzeug.local import LocalStack
from werkzeug.routing import Map
from .api import Environment
@@ -19,7 +20,6 @@ rpc_response: Logger
STATIC_CACHE: int
STATIC_CACHE_LONG: int
ALLOWED_DEBUG_MODES: list[str]
_request_stack: LocalStack
request: HttpRequest | JsonRequest
def replace_request_password(args) -> tuple: ...
@@ -39,16 +39,11 @@ class WebRequest:
endpoint: EndPoint | None
endpoint_arguments: Any
auth_method: str | None
website: "odoo.model.website"
website: "Website"
website_routing: int
is_frontend: bool
is_frontend_multilang: bool
lang: "odoo.model.res_lang"
_cr: Cursor | None
_uid: int | None
_context: dict | None
_env: Environment | None
_failed: Exception | None
lang: "Lang"
def __init__(self, httprequest: werkzeug.wrappers.Request) -> None: ...
@property
def cr(self) -> Cursor: ...
@@ -67,8 +62,6 @@ class WebRequest:
def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def set_handler(self, endpoint: EndPoint, arguments, auth) -> None: ...
def _handle_exception(self, exception: Exception) -> None: ...
def _call_function(self, *args, **kwargs): ...
def registry_cr(self) -> Generator[tuple[Registry, Cursor], None, None]: ...
@property
def registry(self) -> Registry: ...
@@ -88,24 +81,17 @@ def route(
): ...
class JsonRequest(WebRequest):
_request_type: str
params: dict
jsonrequest: Any
context: dict
def __init__(self, *args) -> None: ...
def _json_response(
self, result: Any | None = ..., error: dict | None = ...
) -> Response: ...
def _handle_exception(self, exception: Exception) -> Response: ...
def dispatch(self) -> Response: ...
def serialize_exception(e: Exception) -> dict[str, Any]: ...
class HttpRequest(WebRequest):
_request_type: str
params: dict
def __init__(self, *args) -> None: ...
def _handle_exception(self, exception: Exception): ...
def dispatch(self): ...
def make_response(
self,
@@ -137,12 +123,6 @@ class EndPoint:
def __call__(self, *args, **kw): ...
def __eq__(self, other) -> bool: ...
def __hash__(self) -> int: ...
def _as_tuple(self) -> tuple[Callable, dict]: ...
def __repr__(self) -> str: ...
def _generate_routing_rules(
modules: Collection[str], nodb_only: bool, converters: Any | None = ...
) -> Generator[tuple[str, EndPoint, dict], None, None]: ...
class AuthenticationError(Exception): ...
class SessionExpiredException(Exception): ...
@@ -167,10 +147,8 @@ class OpenERPSession(werkzeug.contrib.sessions.Session):
) -> int: ...
def check_security(self) -> None: ...
def logout(self, keep_db: bool = ...) -> None: ...
def _default_values(self) -> None: ...
context: dict
def get_context(self) -> dict: ...
def _fix_lang(self, context: dict) -> None: ...
def save_action(self, action) -> int: ...
def get_action(self, key: int): ...
def save_request_data(self) -> None: ...
@@ -203,7 +181,6 @@ class DisableCacheMiddleware:
def __call__(self, environ: dict, start_response: Callable): ...
class Root:
_loaded: bool
def __init__(self) -> None: ...
@property
def session_store(self) -> werkzeug.contrib.sessions.FilesystemSessionStore: ...

View File

@@ -17,6 +17,7 @@ from typing import (
import psycopg2
from lxml.etree import _Element
from odoo.addons.base.models.res_partner import Partner
from . import api, fields
from .api import Environment
@@ -51,7 +52,6 @@ class MetaModel(api.Meta):
def __init__(
self: type[BaseModel], name: str, bases: tuple, attrs: dict
) -> None: ...
def _get_addon_name(self, full_name: str) -> str: ...
class NewId:
origin: int | None
@@ -60,7 +60,6 @@ class NewId:
def __bool__(self) -> bool: ...
def __eq__(self, other) -> bool: ...
def __hash__(self) -> int: ...
def __repr__(self) -> str: ...
def origin_ids(ids: Iterable) -> Iterator[int]: ...
def expand_ids(id0: _T, ids: Iterable) -> Iterator[_T]: ...
@@ -446,9 +445,7 @@ class BaseModel(metaclass=MetaModel):
def ensure_one(self: _ModelT) -> _ModelT: ...
def with_env(self: _ModelT, env: Environment) -> _ModelT: ...
def sudo(self: _ModelT, flag: bool = ...) -> _ModelT: ...
def with_user(
self: _ModelT, user: Union["odoo.model.res_partner", int]
) -> _ModelT: ...
def with_user(self: _ModelT, user: "Union[Partner, int]") -> _ModelT: ...
def with_context(self: _ModelT, *args, **kwargs) -> _ModelT: ...
def with_prefetch(
self: _ModelT, prefetch_ids: Iterable[int] | None = ...
@@ -491,7 +488,7 @@ class BaseModel(metaclass=MetaModel):
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 __int__(self) -> int: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def __hash__(self) -> int: ...
@@ -526,7 +523,6 @@ class BaseModel(metaclass=MetaModel):
) -> dict: ...
class RecordCache(MutableMapping):
_record: BaseModel
def __init__(self, record: BaseModel) -> None: ...
def __contains__(self, name: str) -> bool: ...
def __getitem__(self, name: str) -> Any: ...

View File

@@ -10,7 +10,6 @@ class Graph(dict[str, Node]):
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: str, graph: Graph, info: dict[str, Any]) -> Node: ...
@@ -31,8 +30,6 @@ class Node:
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) -> Iterable[Node]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Iterable
from typing import Any
from ..sql_db import Connection, Cursor
from ..tools.assertion_report import assertion_report
@@ -30,7 +30,6 @@ def load_module_graph(
report: assertion_report | 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,

View File

@@ -10,5 +10,4 @@ class MigrationManager:
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

@@ -42,8 +42,6 @@ def get_modules() -> list[str]: ...
def get_modules_with_version() -> dict[str, Any]: ...
def adapt_version(version: str) -> str: ...
def get_test_modules(module: str) -> list: ...
def _get_tests_modules(path: str, module: str) -> list: ...
def _get_upgrade_test_modules(module) -> Generator[ModuleType, None, None]: ...
class OdooTestResult(unittest.result.TestResult):
def log(

View File

@@ -1,19 +1,14 @@
import threading
from collections import defaultdict, deque
from collections.abc import Mapping
from threading import RLock
from typing import Any, Callable, ClassVar, Iterable, Iterator
from weakref import WeakValueDictionary
from ..models import BaseModel
from ..sql_db import Connection, Cursor
from ..tools.assertion_report import assertion_report
from ..sql_db import Cursor
from ..tools.lru import LRU
from .graph import Node
class Registry(Mapping[str, type[BaseModel]]):
_lock: RLock
_saved_lock: RLock | None
model_cache: WeakValueDictionary
registries: ClassVar[LRU]
def __new__(cls, db_name: str) -> Registry: ...
@@ -26,24 +21,15 @@ class Registry(Mapping[str, type[BaseModel]]):
update_module: bool = ...,
) -> Registry: ...
models: dict[str, type[BaseModel]]
_sql_constraints: set
_init: bool
_assertion_report: assertion_report
_fields_by_model: Any
_post_init_queue: deque
_constraint_queue: deque
_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
registry_sequence: int | None
cache_sequence: int | None
_invalidation_flags: threading.local
has_unaccent: bool
populated_models: dict[str, list[int]]
def init(self, db_name: str) -> None: ...
@@ -58,19 +44,16 @@ class Registry(Mapping[str, type[BaseModel]]):
def __setitem__(self, model_name: str, model: type[BaseModel]) -> 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: ...
def post_init(self, func: Callable, *args, **kwargs) -> None: ...
def post_constraint(self, func: Callable, *args, **kwargs) -> None: ...
def finalize_constraints(self) -> None: ...
_is_install: bool
def init_models(
self, cr: Cursor, model_names: Iterable[str], context: dict, install: bool = ...
) -> None: ...
def check_tables_exist(self, cr: Cursor) -> None: ...
@property
def cache(self) -> LRU: ...
def _clear_cache(self) -> None: ...
def clear_caches(self) -> None: ...
@property
def registry_invalidated(self) -> bool: ...

View File

@@ -41,8 +41,6 @@ class DBFormatter(logging.Formatter):
class ColoredFormatter(DBFormatter):
def format(self, record: LogRecord): ...
_logger_init: bool
def init_logger(): ...
DEFAULT_LOG_CONFIGURATION: list[str]

View File

@@ -27,8 +27,6 @@ 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 _shorten_alias(alias: str) -> str: ...
def generate_table_alias(
src_table_alias: str, joined_tables: list = ...
) -> tuple[str, str]: ...
@@ -53,7 +51,6 @@ class ExtendedLeaf:
join_context: list[tuple]
leaf: Any
model: BaseModel
_models: list[BaseModel]
def __init__(
self,
leaf,
@@ -61,12 +58,10 @@ class ExtendedLeaf:
join_context: list[tuple] | None = ...,
internal: bool = ...,
) -> None: ...
def __str__(self) -> str: ...
def generate_alias(self) -> str: ...
def add_join_context(self, model, lhs_col, table_col, link) -> None: ...
def get_join_conditions(self) -> list[str]: ...
def get_tables(self) -> set[str]: ...
def _get_context_debug(self) -> list[str]: ...
def check_leaf(self, internal: bool = ...) -> None: ...
def is_operator(self) -> bool: ...
def is_true_leaf(self) -> bool: ...
@@ -82,7 +77,6 @@ def create_substitution_leaf(
) -> ExtendedLeaf: ...
class expression:
_unaccent: Callable[[Any], str]
joins: list
root_model: BaseModel
expression: _Domain
@@ -92,5 +86,4 @@ class expression:
result: list
stack: list
def parse(self): ...
def __leaf_to_sql(self, eleaf: ExtendedLeaf) -> tuple[str, list]: ...
def to_sql(self) -> tuple[str, list]: ...

View File

@@ -1,5 +1,3 @@
def _quote(to_quote: str) -> str: ...
class Query:
tables: list[str] = ...
where_clause: list = ...
@@ -14,8 +12,6 @@ class Query:
joins: dict | None = ...,
extras: dict | None = ...,
) -> None: ...
def _get_table_aliases(self) -> list: ...
def _get_alias_mapping(self) -> dict: ...
def add_join(
self,
connection: tuple,
@@ -25,4 +21,3 @@ class Query:
extra_params: list = ...,
): ...
def get_sql(self) -> str: ...
def __str__(self) -> str: ...

View File

@@ -9,17 +9,6 @@ class DatabaseExists(Warning): ...
def check_db_management_enabled(method: _CallableT) -> _CallableT: ...
def check_super(passwd: str) -> Literal[True]: ...
def _initialize_db(
id,
db_name: str,
demo: bool,
lang: str,
user_password: str,
login: str = ...,
country_code: str | None = ...,
phone: str | None = ...,
) -> None: ...
def _create_empty_database(name: str) -> None: ...
def exp_create_database(
db_name: str,
demo: bool,
@@ -30,7 +19,6 @@ def exp_create_database(
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]: ...

View File

@@ -2,11 +2,11 @@ from typing import Callable, TypeVar
from ..sql_db import Cursor
_CallableT = TypeVar("_CallableT", bound=Callable)
PG_CONCURRENCY_ERRORS_TO_RETRY: tuple[str, str, str]
MAX_TRIES_ON_CONCURRENCY_FAILURE: int
_CallableT = TypeVar("_CallableT", bound=Callable)
def dispatch(method: str, params): ...
def check(f: _CallableT) -> _CallableT: ...
def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...

View File

@@ -1,7 +1,7 @@
from itertools import chain as chain
from socket import socket as socket_
from threading import Semaphore, Thread
from typing import Any, Callable, Iterable, Literal, TypeVar
from typing import Any, Callable, Literal, TypeVar
import werkzeug.serving
from gevent.pywsgi import WSGIServer
@@ -10,7 +10,6 @@ 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)
@@ -44,7 +43,6 @@ class ThreadedWSGIServerReloadable(
def server_bind(self) -> None: ...
def server_activate(self) -> None: ...
def process_request(self, request, client_address) -> None: ...
def _handle_request_noblock(self) -> None: ...
def shutdown_request(self, request) -> None: ...
class FSWatcherBase:
@@ -162,7 +160,6 @@ class Worker:
def start(self) -> None: ...
def stop(self) -> None: ...
def run(self) -> None: ...
def _runloop(self) -> None: ...
class WorkerHTTP(Worker):
sock_timeout: float
@@ -177,14 +174,12 @@ class WorkerCron(Worker):
watchdog_timeout: int
def __init__(self, multi: PreforkServer) -> None: ...
def sleep(self) -> None: ...
def _db_list(self): ...
def process_work(self) -> None: ...
def start(self) -> None: ...
server: CommonServer | None
def load_server_wide_modules() -> None: ...
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 = ...): ...

View File

@@ -10,7 +10,6 @@ RPC_FAULT_CODE_ACCESS_ERROR: int
def xmlrpc_handle_exception_int(e: Exception) -> str: ...
def xmlrpc_handle_exception_string(e: Exception) -> str: ...
def _patch_xmlrpc_marshaller() -> None: ...
def application_unproxied(environ, start_response): ...
ProxyFix: Callable[..., ProxyFix_]

View File

@@ -1,16 +1,6 @@
from re import Pattern
from threading import Lock, RLock
from typing import (
Any,
Callable,
Generator,
Iterable,
Iterator,
Literal,
NoReturn,
Sequence,
TypeVar,
)
from threading import RLock
from typing import Any, Callable, Generator, Iterable, Iterator, NoReturn, TypeVar
import psycopg2.extensions
@@ -35,21 +25,11 @@ class Cursor:
sql_into_log: dict
sql_log: bool
sql_log_count: int
_closed: bool
__pool: ConnectionPool
dbname: str
_serialized: bool
_cnx: PsycoConnection
_obj: psycopg2.extensions.cursor
__caller: tuple[str, int | str] | Literal[False]
__closer: bool
_default_log_exceptions: bool
cache: dict
_event_handlers: dict[str, list[Callable]]
def __init__(
self, pool: ConnectionPool, dbname: str, dsn: dict, serialized: bool = ...
) -> None: ...
def __build_dict(self, row: Sequence) -> dict[str, Any]: ...
def dictfetchone(self) -> dict[str, Any] | None: ...
def dictfetchmany(self, size) -> list[dict[str, Any]]: ...
def dictfetchall(self) -> list[dict[str, Any]]: ...
@@ -62,10 +42,8 @@ class Cursor:
) -> Iterator[tuple]: ...
def print_log(self): ...
def close(self): ...
def _close(self, leak: bool = ...) -> None: ...
def autocommit(self, on: bool) -> None: ...
def after(self, event: str, func: Callable) -> None: ...
def _pop_event_handlers(self) -> dict[str, list[Callable]]: ...
def commit(self): ...
def rollback(self): ...
def __enter__(self: _T) -> _T: ...
@@ -76,11 +54,6 @@ class Cursor:
def closed(self) -> bool: ...
class TestCursor:
_savepoint_seq: Iterator[int]
_closed: bool
_cursor: Cursor
_lock: RLock
_savepoint: str
def __init__(self, cursor: Cursor, lock: RLock) -> None: ...
def close(self) -> None: ...
def autocommit(self, on: bool) -> None: ...
@@ -94,12 +67,7 @@ class PsycoConnection(psycopg2.extensions.connection): ...
class ConnectionPool:
def locked(fun: Callable[..., _T]) -> Callable[..., _T]: ...
_connections: list[tuple[psycopg2.extensions.connection, bool]]
_maxconn: int
_lock: Lock
def __init__(self, maxconn: int = ...) -> None: ...
def __repr__(self) -> str: ...
def _debug(self, msg, *args) -> None: ...
def borrow(self, connection_info: dict) -> PsycoConnection: ...
def give_back(
self, connection: PsycoConnection, keep_in_pool: bool = ...
@@ -109,16 +77,12 @@ class ConnectionPool:
class Connection:
dbname: str
dsn: dict
__pool: ConnectionPool
def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict) -> None: ...
def cursor(self, serialized: bool = ...) -> Cursor: ...
serialized_cursor = cursor
def __bool__(self) -> NoReturn: ...
def connection_info_for(db_or_uri: str) -> tuple[str, dict]: ...
_Pool: ConnectionPool | None
def db_connect(to: str, allow_uri: bool = ...) -> Connection: ...
def close_db(db_name: str) -> None: ...
def close_all() -> None: ...

View File

@@ -3,21 +3,11 @@ import logging
import unittest
from itertools import count
from re import Pattern
from typing import (
Any,
Callable,
Generator,
Generic,
Iterator,
Literal,
Mapping,
Match,
TypeVar,
)
from typing import Any, Callable, Generator, Generic, Iterator, Mapping, Match, TypeVar
from xmlrpc import client as xmlrpclib
import requests
from lxml.etree import _Element
from odoo.addons.base.models.res_users import Users
from websocket import WebSocket
from ..api import Environment
@@ -47,20 +37,11 @@ def new_test_user(
groups: str = ...,
context: dict | None = ...,
**kwargs
) -> "odoo.model.res_users": ...
) -> "Users": ...
class OdooSuite(unittest.suite.TestSuite):
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 OdooSuite(unittest.suite.TestSuite): ...
class TreeCase(unittest.TestCase):
_class_cleanups: list
@classmethod
def addClassCleanup(cls, function, *args, **kwargs) -> None: ...
@classmethod
@@ -72,7 +53,6 @@ class MetaCase(type):
def __init__(cls, name, bases, attrs) -> None: ...
class BaseCase(TreeCase):
_class_cleanups: list
tearDown_exceptions: list
registry: Registry
env: Environment
@@ -90,7 +70,6 @@ class BaseCase(TreeCase):
def uid(self, user) -> None: ...
def ref(self, xid: str) -> int: ...
def browse_ref(self, xid: str) -> BaseModel | None: ...
def _assertRaises(self, exception) -> Generator[Any, None, None]: ...
def assertRaises(
self, exception, func: Any | None = ..., *args, **kwargs
) -> Generator[Any, None, None] | None: ...
@@ -119,7 +98,6 @@ class SingleTransactionCase(BaseCase):
savepoint_seq: count[int]
class SavepointCase(TransactionCase):
_savepoint_id: int
def setUp(self) -> None: ...
class ChromeBrowserException(Exception): ...
@@ -144,40 +122,20 @@ class ChromeBrowser:
def stop(self) -> None: ...
@property
def executable(self) -> str | None: ...
def _spawn_chrome(self, cmd: list[str]) -> int | None: ...
def _chrome_start(self) -> None: ...
def _find_websocket(self) -> None: ...
def _json_command(
self, command: str, timeout: int = ..., get_key: Any | None = ...
): ...
def _open_websocket(self) -> None: ...
def _websocket_send(self, method: str, params: Any | None = ...) -> int | None: ...
def _get_message(self, raise_log_error: bool = ...) -> dict: ...
_TO_LEVEL: dict[str, int]
def _websocket_wait_id(self, awaited_id: int, timeout: int = ...) -> dict: ...
def _websocket_wait_event(
self, method: str, params: dict | None = ..., timeout: int = ...
) -> dict | None: ...
def take_screenshot(self, prefix: str = ..., suffix: str | None = ...) -> None: ...
def _save_screencast(self, prefix: str = ...) -> None: ...
screencasts_frames_dir: str
def start_screencast(self) -> None: ...
def set_cookie(self, name: str, value, path, domain) -> dict: ...
def delete_cookie(self, name: str, **kwargs) -> dict: ...
def _wait_ready(self, ready_code, timeout: int = ...) -> bool: ...
def _wait_code_ok(self, code, timeout: float) -> Literal[True] | None: ...
def navigate_to(self, url: str, wait_stop: bool = ...) -> None: ...
def clear(self) -> None: ...
def _from_remoteobject(self, arg: Mapping): ...
LINE_PATTERN: str
def _format_stack(self, logrecord: Mapping) -> None: ...
def console_formatter(self, args: list) -> Callable[[Match[str]], str]: ...
class HttpCase(TransactionCase):
registry_test_mode: bool
browser: ChromeBrowser | None
browser_size: str
_logger: logging.Logger
xmlrpc_url: str
xmlrpc_common: xmlrpclib.ServerProxy
xmlrpc_db: xmlrpclib.ServerProxy
@@ -199,7 +157,6 @@ class HttpCase(TransactionCase):
timeout: int = ...,
headers: Mapping | None = ...,
) -> requests.Response: ...
def _wait_remaining_requests(self, timeout: int = ...) -> None: ...
def logout(self, keep_db: bool = ...) -> None: ...
def authenticate(self, user, password) -> None: ...
def browser_js(
@@ -223,90 +180,27 @@ def can_import(module: str) -> bool: ...
ref_re: Pattern
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 _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) -> _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]) -> None: ...
def _onchange_values(self) -> dict: ...
def _onchange_values_(self, fields, record: dict) -> dict: ...
def _cleanup_onchange(self, descr: dict, value, current): ...
class O2MForm(Form):
_proxy: O2MProxy
_index: int | None
def __init__(self, proxy: O2MProxy, index: int | None = ...) -> None: ...
def _get_modifier(
self,
field: str,
modifier: str,
*,
default: Any = ...,
view: Any = ...,
modmap: Any | None = ...,
vals: Any | None = ...
): ...
def _onchange_values(self) -> dict: ...
def save(self) -> None: ...
def _values_to_save(self, all_fields: bool = ...) -> UpdateDict: ...
class UpdateDict(dict):
_changed: set
def __init__(self, *args, **kwargs) -> None: ...
def changed_items(self) -> Iterator[tuple[Any, Any]]: ...
def update(self, *args, **kw) -> None: ...
class X2MProxy:
_parent: Form
_field: str
def _assert_editable(self) -> None: ...
class X2MProxy: ...
class O2MProxy(X2MProxy):
_records: list[dict]
def __init__(self, parent: Form, field: str) -> None: ...
def __len__(self) -> int: ...
@property
def _model(self) -> BaseModel: ...
@property
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: ...
@@ -318,13 +212,10 @@ class M2MProxy(X2MProxy, collections.Sequence):
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: dict, record: BaseModel) -> dict: ...
def _cleanup_from_default(type_: str, value): ...
def _get_node(view, f, *arg): ...
def tagged(*tags: str) -> Callable[[_CallableT], _CallableT]: ...
class TagsSelector:

View File

@@ -1,7 +1,4 @@
from typing import Callable
__version_info__: tuple
__version__: str
def user_data_dir(
appname: str | None = ...,
@@ -66,9 +63,3 @@ class AppDirs:
def user_cache_dir(self) -> str: ...
@property
def user_log_dir(self) -> str: ...
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

@@ -5,4 +5,3 @@ class assertion_report:
def record_success(self) -> None: ...
def record_failure(self) -> None: ...
def record_result(self, result) -> None: ...
def __str__(self) -> str: ...

View File

@@ -11,32 +11,16 @@ class MyOption(Option):
DEFAULT_LOG_HANDLER: str
def _get_default_datadir() -> str: ...
def _deduplicate_loggers(loggers) -> tuple[str, ...]: ...
class configmanager:
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 = ...) -> None: ...
rcfile: str
def _parse_config(self, args: list | None = ...) -> 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 get(self, key, default: Any | None = ...): ...
@@ -51,6 +35,5 @@ class configmanager:
def filestore(self, dbname: str) -> str: ...
def set_admin_password(self, new_password) -> None: ...
def verify_admin_password(self, password) -> bool: ...
def _normalize(self, path: str) -> str: ...
config: configmanager

View File

@@ -16,16 +16,12 @@ class ParseError(Exception):
filename: str
lineno: int
def __init__(self, msg: str, text: str, filename: str, lineno: int) -> None: ...
def __str__(self) -> str: ...
class RecordDictWrapper(dict):
record: Any
def __init__(self, record) -> None: ...
def __getitem__(self, key): ...
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: ...
@@ -34,19 +30,10 @@ class xml_import:
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) -> None: ...
def _tag_record(self, rec: _Element) -> tuple[str, int] | None: ...
def _tag_template(self, el: _Element) -> tuple[str, int] | None: ...
def id_get(self, id_str: str, raise_if_not_found: bool = ...) -> int | None: ...
def model_id_get(
self, id_str: str, raise_if_not_found: bool = ...
) -> tuple[Any, Any]: ...
def _tag_root(self, el: _Element) -> None: ...
@property
def env(self) -> Environment: ...
@property
@@ -56,9 +43,7 @@ class xml_import:
envs: list[Environment]
idref: dict
assertion_report: AssertionReport
_noupdate: list[bool]
xml_filename: str
_tags: dict[str, Callable]
def __init__(
self,
cr: Cursor,

View File

@@ -1,7 +1,4 @@
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 = ...,
@@ -20,8 +17,5 @@ def float_compare(
precision_rounding: float | None = ...,
) -> int: ...
def float_repr(value: float, precision_digits: int) -> str: ...
_float_repr = float_repr
def float_split_str(value: float, precision_digits: int) -> tuple[str, str]: ...
def float_split(value: float, precision_digits: int) -> tuple[int, int]: ...

View File

@@ -27,13 +27,9 @@ def classproperty(func: Callable[..., _T]) -> _ClassProperty[_T]: ...
class lazy:
def __init__(self, func, *args, **kwargs) -> None: ...
@property
def _value(self): ...
def __getattr__(self, name): ...
def __setattr__(self, name, value): ...
def __delattr__(self, name): ...
def __repr__(self): ...
def __str__(self): ...
def __bytes__(self): ...
def __format__(self, format_spec): ...
def __lt__(self, other): ...

View File

@@ -51,7 +51,6 @@ class graph:
tree_list: Any = ...
start: Any = ...
def process(self, starting_node: Any) -> None: ...
def __str__(self): ...
def scale(
self,
maxx: Any,

View File

@@ -1,4 +1,3 @@
__all__: list[str]
JSON_SCRIPTSAFE_MAPPER: dict[str, str]
def dumps(*args, **kwargs) -> str: ...

View File

@@ -1,8 +1,5 @@
from threading import RLock
from typing import Any, Generator, Iterator
__all__ = ["LRU"]
class LRUNode:
prev: Any
me: Any
@@ -10,7 +7,6 @@ class LRUNode:
def __init__(self, prev, me) -> None: ...
class LRU:
_lock: RLock
count: int
d: dict
first: Any

View File

@@ -2,8 +2,6 @@ from email.message import Message
from re import Pattern
from typing import Any, FrozenSet, Literal
from lxml.etree import _Element
from lxml.html import clean
from markupsafe import Markup
tags_to_kill: list[str]
@@ -11,16 +9,6 @@ tags_to_remove: list[str]
allowed_tags: FrozenSet
safe_attrs: FrozenSet
class _Cleaner(clean.Cleaner):
_style_re: Pattern
_style_whitelist: list[str]
strip_classes: bool
sanitize_style: bool
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: str,
silent: bool = ...,

View File

@@ -1,28 +1,2 @@
import collections
from re import Pattern
from typing import Any, Literal
__all__ = ["guess_mimetype"]
_ooxml_dirs: dict[str, str]
def _check_ooxml(data: bytes) -> str | Literal[False]: ...
_mime_validator: Pattern
def _check_open_container_format(data: bytes) -> str | Literal[False]: ...
_xls_pattern: Pattern
_ppt_pattern: Pattern
def _check_olecf(data: bytes) -> str | Literal[False]: ...
def _check_svg(data: bytes) -> str | None: ...
_Entry = collections.namedtuple("_Entry", ["mimetype", "signatures", "discriminants"])
_mime_mappings: tuple[_Entry, ...]
def guess_mimetype(bin_data: str, default: str | None = ...) -> str: ...
_guesser: Any
ms: Any
def get_extension(filename: str) -> str: ...

View File

@@ -19,6 +19,8 @@ from typing import (
import xlsxwriter
import xlwt
from babel.core import Locale
from odoo.addons.base.models.res_currency import Currency
from odoo.addons.base.models.res_lang import Lang
from xlwt import Worksheet
from ..api import Environment
@@ -38,9 +40,6 @@ 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]: ...
@@ -57,14 +56,6 @@ def file_open(
pathinfo: bool = ...,
filter_ext: Any | None = ...,
): ...
def _fileopen(
path: str,
mode: str,
basedir: str,
pathinfo,
basename: str | None = ...,
filter_ext: Any | None = ...,
): ...
def flatten(list) -> list: ...
def reverse_enumerate(l): ...
def partition(
@@ -115,8 +106,7 @@ def resolve_attr(obj, attr: str): ...
def attrgetter(*items): ...
def remove_accents(input_str: str) -> str: ...
class unquote(str):
def __repr__(self) -> str: ...
class unquote(str): ...
class UnquoteEvalContext(defaultdict):
def __init__(self, *args, **kwargs) -> None: ...
@@ -135,8 +125,6 @@ class mute_logger(Filter):
) -> None: ...
def __call__(self, func: _CallableT) -> _CallableT: ...
_ph: Any
class CountingStream(Generic[_T]):
stream: Iterator[_T]
index: int
@@ -149,7 +137,6 @@ class CountingStream(Generic[_T]):
def stripped_sys_argv(*strip_args: str) -> list[str]: ...
class ConstantMapping(Mapping[_KT, _VT]):
_value: _VT
def __init__(self, val: _VT) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator: ...
@@ -172,7 +159,6 @@ class frozendict(dict):
def __hash__(self) -> int: ...
class Collector(Mapping[_KT, _VT]):
_map: dict
def __init__(self) -> None: ...
def add(self, key: _KT, val: _T) -> None: ...
def __getitem__(self, key: _KT) -> tuple[_T]: ...
@@ -180,19 +166,16 @@ class Collector(Mapping[_KT, _VT]):
def __len__(self) -> int: ...
class StackMap(MutableMapping):
_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) -> Iterator: ...
def __len__(self) -> int: ...
def __str__(self) -> str: ...
def pushmap(self, m: MutableMapping | None = ...) -> None: ...
def popmap(self) -> MutableMapping: ...
class OrderedSet(MutableSet):
_map: dict
def __init__(self, elems: Iterable = ...) -> None: ...
def __contains__(self, elem) -> bool: ...
def __iter__(self) -> Iterator: ...
@@ -226,7 +209,7 @@ class Reverse:
def ignore(*exc) -> None: ...
def html_escape(text: str) -> str: ...
def get_lang(env: Environment, lang_code: str = ...) -> "odoo.model.res_lang": ...
def get_lang(env: Environment, lang_code: str = ...) -> "Lang": ...
def babel_locale_parse(lang_code: str) -> Locale: ...
def formatLang(
env: Environment,
@@ -235,7 +218,7 @@ def formatLang(
grouping: bool = ...,
monetary: bool = ...,
dp: bool = ...,
currency_obj: "odoo.model.res_currency" = ...,
currency_obj: "Currency" = ...,
) -> str: ...
def format_date(
env: Environment,
@@ -254,20 +237,13 @@ def format_datetime(
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_amount(
env: Environment,
amount: float,
currency: "odoo.model.res_currency",
currency: "Currency",
lang_code: str = ...,
) -> str: ...
def format_duration(value: float) -> str: ...
def _consteq(str1: str, str2: str) -> bool: ...
consteq: Callable[[str, str], bool]
@@ -275,17 +251,9 @@ class Unpickler(pickle_.Unpickler):
find_global: Any
find_class: Any
def _pickle_load(
stream: pickle_._ReadableFileobj, encoding: str = ..., errors: bool = ...
): ...
pickle: ModuleType
def wrap_values(d): ...
_missing: object
_cache: dict
def wrap_module(module, attr_list): ...
mods: list[str]

View File

@@ -1,4 +1,3 @@
import ctypes
from typing import Any, BinaryIO, Callable, Generator, Iterable, Iterator
def listdir(dir: str, recursive: bool = ...) -> Iterable[str]: ...
@@ -15,7 +14,3 @@ def zip_dir(
getppid: Callable[[], int]
is_running_as_nt_service: Callable[[], bool]
_TH32CS_SNAPPROCESS: int
class _PROCESSENTRY32(ctypes.Structure):
_fields_: list[tuple[str, Any]]

View File

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

View File

@@ -2,7 +2,6 @@ from typing import Any, Iterable
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import ArrayObject as ArrayObject
from PyPDF2.generic import IndirectObject
from PyPDF2.utils import b_ as b_
DEFAULT_PDF_DATETIME_FORMAT: str
@@ -10,15 +9,9 @@ DEFAULT_PDF_DATETIME_FORMAT: str
def merge_pdf(pdf_data: Iterable[bytes]) -> bytes: ...
class OdooPdfFileWriter(PdfFileWriter):
_reader: PdfFileReader | None
_header: bytes
_ID: Any
def __init__(self, *args, **kwargs):
None
def addAttachment(self, fname: str, fdata, subtype: str = ...) -> 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,21 +1,5 @@
from typing import Any
class _LogTracer:
profiles: dict
whitelist: Any
blacklist: Any
files: Any
deep: Any
first_frame: Any
def __init__(
self,
whitelist: Any | None = ...,
blacklist: Any | None = ...,
files: Any | None = ...,
deep: bool = ...,
) -> None: ...
def tracer(self, frame, event, arg): ...
def profile(
method: Any | None = ...,
whitelist: Any | None = ...,

View File

@@ -1,12 +1,5 @@
from codecs import StreamReader, StreamWriter
from csv import Dialect
from typing import Any, BinaryIO, Iterable, Iterator, Protocol
class _StreamReader(Protocol):
def __call__(self, stream: BinaryIO, errors: str = ...) -> StreamReader: ...
class _StreamWriter(Protocol):
def __call__(self, stream: BinaryIO, errors: str = ...) -> StreamWriter: ...
from typing import Any, BinaryIO, Iterable, Iterator
class _CsvReader(Iterator[list[str]]):
dialect: Dialect
@@ -19,10 +12,6 @@ class _CsvWriter:
def writerows(self, rows: Iterable[Iterable]) -> None: ...
def reraise(tp, value, tb: Any | None = ...) -> 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

@@ -1,17 +1,10 @@
from types import CodeType
from typing import Any, Iterator, Literal
from typing import Literal
from opcode import HAVE_ARGUMENT as HAVE_ARGUMENT
unsafe_eval = eval
_ALLOWED_MODULES: list[str]
_UNSAFE_ATTRIBUTES: list[str]
_POSSIBLE_OPCODES_P3: list[str]
_CONST_OPCODES: set[int]
_EXPR_OPCODES: set[int]
_SAFE_OPCODES: set[int]
def _get_opcodes(codeobj) -> Iterator[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
@@ -19,16 +12,6 @@ def assert_valid_codeobj(
def test_expr(expr: str, allowed_codes: set[int], mode: str = ...): ...
def const_eval(expr: str): ...
def expr_eval(expr: str): ...
def _import(
name: str,
globals: dict | None = ...,
locals: dict | None = ...,
fromlist: list | None = ...,
level: int = ...,
): ...
_BUILTINS: dict[str, Any]
def safe_eval(
expr: str,
globals_dict: dict | None = ...,

View File

@@ -2,8 +2,6 @@ from typing import Iterable, Literal
from ..sql_db import Cursor
_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: ...

View File

@@ -1,4 +0,0 @@
from typing import Any
config_file_00: Any
conf: Any

View File

@@ -1,18 +1,16 @@
import csv
from re import Match, Pattern
from re import Pattern
from tarfile import TarFile
from types import FrameType
from typing import IO, Any, BinaryIO, Callable, Container, Iterable, Iterator, NoReturn
from lxml.etree import HTMLParser, _Element
from lxml.etree import _Element
from polib import POFile
from ..sql_db import Connection, Cursor
from ..sql_db import Cursor
from .pycompat import _CsvWriter
WEB_TRANSLATION_COMMENT: str
SKIPPED_ELEMENTS: tuple[str, ...]
_LOCALE2WIN32: dict[str, str]
ENGLISH_SMALL_WORDS: set[str]
class UNIX_LINE_TERMINATOR(csv.excel):
@@ -33,9 +31,6 @@ def translate_xml_node(
) -> _Element: ...
def parse_xml(text: str) -> _Element: ...
def serialize_xml(node: _Element) -> str: ...
_HTML_PARSER: HTMLParser
def parse_html(text: str) -> _Element: ...
def serialize_html(node: _Element) -> str: ...
def xml_translate(callback: Callable[[str], str | None], value: str) -> str: ...
@@ -46,19 +41,10 @@ def translate(
def translate_sql_constraint(cr: Cursor, key: str, lang: str) -> str: ...
class GettextAlias:
def _get_db(self) -> Connection | None: ...
def _get_cr(
self, frame: FrameType, allow_create: bool = ...
) -> tuple[Cursor, bool]: ...
def _get_uid(self, frame: FrameType) -> int: ...
def _get_lang(self, frame: FrameType) -> str: ...
def __call__(self, source: str) -> str: ...
def _get_translation(self, source: str) -> str: ...
class _lt:
_source: str
def __init__(self, source: str) -> None: ...
def __str__(self) -> str: ...
def __eq__(self, other) -> NoReturn: ...
def __lt__(self, other) -> NoReturn: ...
def __add__(self, other: str | _lt) -> str: ...
@@ -71,7 +57,6 @@ def quote(s: str) -> str: ...
re_escaped_char: Pattern
re_escaped_replacements: dict[str, str]
def _sub_replacement(match_obj: Match) -> str: ...
def unquote(str: str) -> str: ...
def TranslationFileReader(
source: IO, fileformat: str = ...
@@ -120,11 +105,7 @@ def trans_export(
lang: str, modules: list[str], buffer, format: str, cr: Cursor
) -> None: ...
def trans_parse_rml(de: Iterable) -> list[bytes]: ...
def _push(callback: Callable[[str, int], Any], term: str, source_line: int) -> None: ...
def in_modules(object_name: str, modules: Container[str]) -> bool: ...
def _extract_translatable_qweb_terms(
element: _Element, callback: Callable[[str, int], Any]
) -> None: ...
def babel_extract_qweb(fileobj: IO, keywords, comment_tags, options) -> list[tuple]: ...
def trans_generate(lang: str, modules, cr: Cursor) -> list: ...
def trans_load(

View File

@@ -1,5 +1,4 @@
from ast import expr as _expr
from collections import defaultdict
from re import Pattern
from typing import Callable, TypeVar
@@ -10,13 +9,9 @@ from ..fields import Field
_CallableT = TypeVar("_CallableT", bound=Callable)
_validators: defaultdict[str, list[Callable]]
_relaxng_cache: dict[str, RelaxNG | None]
ATTRS_WITH_FIELD_NAMES: set[str]
READONLY: Pattern
def _get_attrs_symbols() -> set[str]: ...
def _view_is_editable(node: _Element) -> bool: ...
def field_is_editable(field: Field, node: _Element) -> bool: ...
def get_attrs_field_names(
env: Environment, arch: _Element, model, editable

View File

@@ -3,7 +3,6 @@ from os import W_OK as W_OK
from os.path import dirname as dirname
from typing import Iterator
__docformat__: str
ENOENT: int
windows: bool
seen: set

View File

@@ -1,4 +1,4 @@
from typing import IO, Iterable
from typing import Iterable
from lxml import etree
from lxml.etree import _Element
@@ -10,9 +10,6 @@ class odoo_resolver(etree.Resolver):
def __init__(self, env: Environment) -> None: ...
def resolve(self, url: str, id: str, context) -> str: ...
def _check_with_xsd(
tree_or_str: str | _Element, stream: str | IO, env: Environment | None = ...
) -> None: ...
def create_xml_node_chain(
first_parent_node: _Element,
nodes_list: Iterable[str],