mirror of
https://github.com/odoo-ide/odoo-stubs.git
synced 2025-05-08 16:52:26 +03:00
Update stubs
This commit is contained in:
@@ -1,230 +1,262 @@
|
||||
import collections
|
||||
import logging
|
||||
import unittest
|
||||
from typing import Any, Optional
|
||||
from xmlrpc.client import ServerProxy
|
||||
from re import Pattern
|
||||
|
||||
from itertools import count
|
||||
from typing import Any, Callable, Generator, Generic, Iterator, Literal, Mapping, Match, TypeVar
|
||||
from xmlrpc import client as xmlrpclib
|
||||
|
||||
import requests
|
||||
from lxml.etree import _Element
|
||||
from websocket import WebSocket
|
||||
|
||||
from ..api import Environment
|
||||
from ..http import OpenERPSession
|
||||
from ..models import BaseModel
|
||||
from ..modules.registry import Registry
|
||||
from ..sql_db import Cursor
|
||||
|
||||
_logger: Any
|
||||
ADDONS_PATH: Any
|
||||
_T = TypeVar('_T')
|
||||
_CallableT = TypeVar('_CallableT', bound=Callable)
|
||||
_ModelT = TypeVar('_ModelT', bound=BaseModel)
|
||||
_FormT = TypeVar('_FormT', bound=Form)
|
||||
|
||||
ADDONS_PATH: str
|
||||
HOST: str
|
||||
PORT: Any
|
||||
ADMIN_USER_ID: Any
|
||||
ADMIN_USER_ID: int
|
||||
|
||||
def get_db_name(): ...
|
||||
def get_db_name() -> str: ...
|
||||
|
||||
DB: Any
|
||||
DB: str
|
||||
def at_install(flag): ...
|
||||
def post_install(flag): ...
|
||||
|
||||
def at_install(flag: Any): ...
|
||||
def post_install(flag: Any): ...
|
||||
def new_test_user(env: Any, login: str = ..., groups: str = ..., context: Optional[Any] = ..., **kwargs: Any): ...
|
||||
def new_test_user(env: Environment, login: str = ..., groups: str = ..., context: dict | None = ..., **kwargs) -> 'odoo.model.res_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 TreeCase(unittest.TestCase):
|
||||
_class_cleanups: list
|
||||
@classmethod
|
||||
def addClassCleanup(cls, function, *args, **kwargs) -> None: ...
|
||||
@classmethod
|
||||
def doClassCleanups(cls) -> None: ...
|
||||
def __init__(self, methodName: str = ...) -> None: ...
|
||||
def assertTreesEqual(self, n1: Any, n2: Any, msg: Optional[Any] = ...) -> None: ...
|
||||
def assertTreesEqual(self, n1, n2, msg: Any | None = ...) -> None: ...
|
||||
|
||||
class MetaCase(type):
|
||||
def __init__(cls, name: Any, bases: Any, attrs: Any) -> None: ...
|
||||
def __init__(cls, name, bases, attrs) -> None: ...
|
||||
|
||||
class BaseCase(TreeCase):
|
||||
longMessage: bool = ...
|
||||
warm: bool = ...
|
||||
registry: Registry = ...
|
||||
cr: Cursor = ...
|
||||
env: Environment = ...
|
||||
def cursor(self): ...
|
||||
_class_cleanups: list
|
||||
tearDown_exceptions: list
|
||||
registry: Registry
|
||||
env: Environment
|
||||
cr: Cursor
|
||||
@classmethod
|
||||
def addClassCleanup(cls, function, *args, **kwargs) -> None: ...
|
||||
@classmethod
|
||||
def doClassCleanups(cls) -> None: ...
|
||||
longMessage: bool
|
||||
warm: bool
|
||||
def cursor(self) -> Cursor: ...
|
||||
@property
|
||||
def uid(self): ...
|
||||
def uid(self) -> int: ...
|
||||
@uid.setter
|
||||
def uid(self, user: Any) -> None: ...
|
||||
def ref(self, xid: Any): ...
|
||||
def browse_ref(self, xid: Any): ...
|
||||
def _assertRaises(self, exception: Any) -> None: ...
|
||||
def assertRaises(self, exception: Any, func: Optional[Any] = ..., *args: Any, **kwargs: Any): ...
|
||||
def assertQueryCount(self, default: int = ..., flush: bool = ..., **counters: Any): ...
|
||||
def assertRecordValues(self, records: Any, expected_values: Any): ...
|
||||
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: ...
|
||||
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 shortDescription(self) -> None: ...
|
||||
def assertItemsEqual(self, a: Any, b: Any, msg: Optional[Any] = ...) -> None: ...
|
||||
def assertItemsEqual(self, a, b, msg: str | None = ...) -> None: ...
|
||||
|
||||
class TransactionCase(BaseCase):
|
||||
registry: Registry
|
||||
env: Environment
|
||||
cr: Cursor
|
||||
def setUp(self): ...
|
||||
def patch(self, obj: Any, key: Any, val: Any) -> None: ...
|
||||
def patch_order(self, model: Any, order: Any) -> None: ...
|
||||
def patch(self, obj, key, val) -> None: ...
|
||||
def patch_order(self, model, order) -> None: ...
|
||||
|
||||
class SingleTransactionCase(BaseCase):
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None: ...
|
||||
def setUp(self) -> None: ...
|
||||
@classmethod
|
||||
def tearDownClass(cls) -> None: ...
|
||||
|
||||
savepoint_seq: Any
|
||||
savepoint_seq: count[int]
|
||||
|
||||
class SavepointCase(SingleTransactionCase):
|
||||
_savepoint_id: Any = ...
|
||||
class SavepointCase(TransactionCase):
|
||||
_savepoint_id: int
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
|
||||
class ChromeBrowserException(Exception): ...
|
||||
|
||||
class ChromeBrowser:
|
||||
_logger: Any = ...
|
||||
test_class: Any = ...
|
||||
devtools_port: Any = ...
|
||||
ws_url: str = ...
|
||||
ws: Any = ...
|
||||
request_id: int = ...
|
||||
user_data_dir: Any = ...
|
||||
chrome_pid: Any = ...
|
||||
screenshots_dir: Any = ...
|
||||
screencasts_dir: Any = ...
|
||||
screencast_frames: Any = ...
|
||||
window_size: Any = ...
|
||||
sigxcpu_handler: Any = ...
|
||||
def __init__(self, logger: Any, window_size: Any, test_class: Any) -> None: ...
|
||||
def signal_handler(self, sig: Any, frame: Any) -> None: ...
|
||||
test_class: str
|
||||
devtools_port: int | None
|
||||
ws_url: str
|
||||
ws: WebSocket | None
|
||||
request_id: int
|
||||
user_data_dir: str
|
||||
chrome_pid: int | None
|
||||
screenshots_dir: str
|
||||
screencasts_dir: str | None
|
||||
screencast_frames: list
|
||||
window_size: str
|
||||
sigxcpu_handler: Any
|
||||
def __init__(self, logger: logging.Logger, window_size: str, test_class: str) -> None: ...
|
||||
def signal_handler(self, sig, frame) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
@property
|
||||
def executable(self): ...
|
||||
def _spawn_chrome(self, cmd: Any): ...
|
||||
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: Any, timeout: int = ..., get_key: Optional[Any] = ...): ...
|
||||
def _json_command(self, command: str, timeout: int = ..., get_key: Any | None = ...): ...
|
||||
def _open_websocket(self) -> None: ...
|
||||
def _websocket_send(self, method: Any, params: Optional[Any] = ...): ...
|
||||
def _get_message(self, raise_log_error: bool = ...): ...
|
||||
_TO_LEVEL: Any = ...
|
||||
def _websocket_wait_id(self, awaited_id: Any, timeout: int = ...): ...
|
||||
def _websocket_wait_event(self, method: Any, params: Optional[Any] = ..., timeout: int = ...): ...
|
||||
def take_screenshot(self, prefix: str = ..., suffix: Optional[Any] = ...) -> 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: Any = ...
|
||||
screencasts_frames_dir: str
|
||||
def start_screencast(self) -> None: ...
|
||||
def set_cookie(self, name: Any, value: Any, path: Any, domain: Any): ...
|
||||
def delete_cookie(self, name: Any, **kwargs: Any): ...
|
||||
def _wait_ready(self, ready_code: Any, timeout: int = ...): ...
|
||||
def _wait_code_ok(self, code: Any, timeout: Any): ...
|
||||
def navigate_to(self, url: Any, wait_stop: bool = ...) -> 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: Any): ...
|
||||
LINE_PATTERN: str = ...
|
||||
def _format_stack(self, logrecord: Any) -> None: ...
|
||||
def console_formatter(self, args: Any): ...
|
||||
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 = ...
|
||||
browser_size: str = ...
|
||||
xmlrpc_url: str = ...
|
||||
xmlrpc_common: ServerProxy = ...
|
||||
xmlrpc_db: ServerProxy = ...
|
||||
xmlrpc_object: ServerProxy = ...
|
||||
registry_test_mode: bool
|
||||
browser: ChromeBrowser | None
|
||||
browser_size: str
|
||||
_logger: logging.Logger
|
||||
xmlrpc_url: str
|
||||
xmlrpc_common: xmlrpclib.ServerProxy
|
||||
xmlrpc_db: xmlrpclib.ServerProxy
|
||||
xmlrpc_object: xmlrpclib.ServerProxy
|
||||
def __init__(self, methodName: str = ...) -> None: ...
|
||||
@classmethod
|
||||
def start_browser(cls) -> None: ...
|
||||
@classmethod
|
||||
def terminate_browser(cls) -> None: ...
|
||||
@classmethod
|
||||
def tearDownClass(cls) -> None: ...
|
||||
session: OpenERPSession = ...
|
||||
session_id: Any = ...
|
||||
opener: requests.Session = ...
|
||||
session: OpenERPSession
|
||||
session_id: Any
|
||||
opener: requests.Session
|
||||
def setUp(self) -> None: ...
|
||||
def url_open(self, url: Any, data: Optional[Any] = ..., files: Optional[Any] = ..., timeout: int = ..., headers: Optional[Any] = ...): ...
|
||||
def _wait_remaining_requests(self, timeout: int = ...): ...
|
||||
def url_open(self, url: str, data: Any | None = ..., files: Mapping | None = ..., 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: Any, password: Any) -> None: ...
|
||||
def browser_js(self, url_path: Any, code: Any, ready: str = ..., login: Optional[Any] = ..., timeout: int = ..., **kw: Any) -> None: ...
|
||||
def start_tour(self, url_path: Any, tour_name: Any, step_delay: Optional[Any] = ..., **kwargs: Any): ...
|
||||
phantom_js: Any = ...
|
||||
def authenticate(self, user, password) -> None: ...
|
||||
def browser_js(self, url_path: str, code: str, ready: str = ..., login: str | None = ..., timeout: int = ..., **kw) -> None: ...
|
||||
def start_tour(self, url_path: str, tour_name: str, step_delay: float | None = ..., **kwargs) -> None: ...
|
||||
phantom_js = browser_js
|
||||
|
||||
def users(*logins: Any): ...
|
||||
def warmup(func: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||
def can_import(module: Any): ...
|
||||
def users(*logins: str) -> Callable[[_CallableT], _CallableT]: ...
|
||||
def warmup(func: _CallableT, *args, **kwargs) -> _CallableT: ...
|
||||
def can_import(module: str) -> bool: ...
|
||||
|
||||
ref_re: Any
|
||||
ref_re: Pattern
|
||||
|
||||
class Form:
|
||||
def __init__(self, recordp: Any, view: Optional[Any] = ...) -> None: ...
|
||||
def _o2m_set_edition_view(self, descr: Any, node: Any, level: Any) -> None: ...
|
||||
def __str__(self): ...
|
||||
def _process_fvg(self, model: Any, fvg: Any, level: int = ...) -> None: ...
|
||||
def _init_from_defaults(self, model: Any): ...
|
||||
def _init_from_values(self, values: Any) -> None: ...
|
||||
def __getattr__(self, field: Any): ...
|
||||
def _get_modifier(self, field: Any, modifier: Any, default: bool = ..., modmap: Optional[Any] = ..., vals: Optional[Any] = ...): ...
|
||||
_OPS: Any = ...
|
||||
def _get_context(self, field: Any): ...
|
||||
def __setattr__(self, field: Any, value: Any) -> None: ...
|
||||
def __enter__(self) -> Form: ...
|
||||
def __exit__(self, etype: Any, _evalue: Any, _etb: Any) -> None: ...
|
||||
def save(self): ...
|
||||
def _values_to_save(self, all_fields: bool = ...): ...
|
||||
def _values_to_save_(self, record_values: Any, fields: Any, view: Any, changed: Any, all_fields: bool = ..., modifiers_values: Optional[Any] = ..., parent_link: Optional[Any] = ...): ...
|
||||
def _perform_onchange(self, fields: Any) -> None: ...
|
||||
def _onchange_values(self): ...
|
||||
def _onchange_values_(self, fields: Any, record: Any): ...
|
||||
def _cleanup_onchange(self, descr: Any, value: Any, current: Any): ...
|
||||
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):
|
||||
def __init__(self, proxy: Any, index: Optional[Any] = ...) -> None: ...
|
||||
def _get_modifier(self, field: Any, modifier: Any, default: bool = ..., modmap: Optional[Any] = ..., vals: Optional[Any] = ...): ...
|
||||
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 = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def changed_items(self): ...
|
||||
def update(self, *args: Any, **kw: Any) -> None: ...
|
||||
_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: 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: Any, field: Any) -> 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: Any): ...
|
||||
def new(self): ...
|
||||
def edit(self, index: Any): ...
|
||||
def remove(self, index: Any) -> 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: Any, field: Any) -> None: ...
|
||||
def __getitem__(self, it: Any): ...
|
||||
def __len__(self): ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def __contains__(self, record: Any): ...
|
||||
def add(self, record: Any) -> None: ...
|
||||
def _get_ids(self): ...
|
||||
def remove(self, id: Optional[Any] = ..., index: Optional[Any] = ...) -> 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: Any, record: Any): ...
|
||||
def _cleanup_from_default(type_: Any, value: Any): ...
|
||||
def _get_node(view: Any, f: Any, *arg: Any): ...
|
||||
def tagged(*tags: Any): ...
|
||||
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:
|
||||
filter_spec_re: Any = ...
|
||||
exclude: Any = ...
|
||||
include: Any = ...
|
||||
def __init__(self, spec: Any) -> None: ...
|
||||
def check(self, test: Any): ...
|
||||
filter_spec_re: Pattern
|
||||
exclude: set
|
||||
include: set
|
||||
def __init__(self, spec: str) -> None: ...
|
||||
def check(self, test) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user