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:
@@ -53,6 +53,7 @@ def downgrade(method: Callable, value, self, args, kwargs): ...
|
|||||||
def split_context(method: Callable, args, kwargs) -> tuple: ...
|
def split_context(method: Callable, args, kwargs) -> tuple: ...
|
||||||
def autovacuum(method: _CallableT) -> _CallableT: ...
|
def autovacuum(method: _CallableT) -> _CallableT: ...
|
||||||
def model(method: _CallableT) -> _CallableT: ...
|
def model(method: _CallableT) -> _CallableT: ...
|
||||||
|
def private(method: _CallableT) -> _CallableT: ...
|
||||||
def model_create_single(method: _CallableT) -> _CallableT: ...
|
def model_create_single(method: _CallableT) -> _CallableT: ...
|
||||||
def model_create_multi(method: _CallableT) -> _CallableT: ...
|
def model_create_multi(method: _CallableT) -> _CallableT: ...
|
||||||
def call_kw(model: BaseModel, name: str, args, kwargs): ...
|
def call_kw(model: BaseModel, name: str, args, kwargs): ...
|
||||||
|
|||||||
@@ -270,10 +270,10 @@ class Html(_String):
|
|||||||
class Date(Field[datetime.date]):
|
class Date(Field[datetime.date]):
|
||||||
type: str
|
type: str
|
||||||
column_type: tuple[str, str]
|
column_type: tuple[str, str]
|
||||||
start_of = date_utils.start_of
|
start_of = staticmethod(date_utils.start_of)
|
||||||
end_of = date_utils.end_of
|
end_of = staticmethod(date_utils.end_of)
|
||||||
add = date_utils.add
|
add = staticmethod(date_utils.add)
|
||||||
subtract = date_utils.subtract
|
subtract = staticmethod(date_utils.subtract)
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def today(*args) -> datetime.date: ...
|
def today(*args) -> datetime.date: ...
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -293,10 +293,10 @@ class Date(Field[datetime.date]):
|
|||||||
class Datetime(Field[datetime.datetime]):
|
class Datetime(Field[datetime.datetime]):
|
||||||
type: str
|
type: str
|
||||||
column_type: tuple[str, str]
|
column_type: tuple[str, str]
|
||||||
start_of = date_utils.start_of
|
start_of = staticmethod(date_utils.start_of)
|
||||||
end_of = date_utils.end_of
|
end_of = staticmethod(date_utils.end_of)
|
||||||
add = date_utils.add
|
add = staticmethod(date_utils.add)
|
||||||
subtract = date_utils.subtract
|
subtract = staticmethod(date_utils.subtract)
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def now(*args) -> datetime.datetime: ...
|
def now(*args) -> datetime.datetime: ...
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -6,14 +6,15 @@ from typing import Any, Callable, Generator, Iterable, Literal, Mapping, TypeVar
|
|||||||
import geoip2.database
|
import geoip2.database
|
||||||
import geoip2.models
|
import geoip2.models
|
||||||
import werkzeug
|
import werkzeug
|
||||||
from odoo.addons.base.models.res_lang import Lang
|
|
||||||
from odoo.addons.website.models.website import Website
|
|
||||||
from werkzeug.datastructures import Headers
|
from werkzeug.datastructures import Headers
|
||||||
from werkzeug.exceptions import NotFound
|
from werkzeug.exceptions import NotFound
|
||||||
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
|
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
|
||||||
from werkzeug.routing import Map, Rule
|
from werkzeug.routing import Map, Rule
|
||||||
from werkzeug.urls import URL
|
from werkzeug.urls import URL
|
||||||
|
|
||||||
|
from odoo.addons.base.models.res_lang import Lang
|
||||||
|
from odoo.addons.website.models.website import Website
|
||||||
|
|
||||||
from .api import Environment
|
from .api import Environment
|
||||||
from .models import BaseModel
|
from .models import BaseModel
|
||||||
from .modules.registry import Registry
|
from .modules.registry import Registry
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from typing import (
|
|||||||
|
|
||||||
import dateutil.relativedelta
|
import dateutil.relativedelta
|
||||||
import psycopg2
|
import psycopg2
|
||||||
|
|
||||||
from odoo.addons.base.models.res_company import Company
|
from odoo.addons.base.models.res_company import Company
|
||||||
from odoo.addons.base.models.res_users import Users
|
from odoo.addons.base.models.res_users import Users
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,12 @@ class MigrationManager:
|
|||||||
migrations: dict
|
migrations: dict
|
||||||
def __init__(self, cr: Cursor, graph: Graph) -> None: ...
|
def __init__(self, cr: Cursor, graph: Graph) -> None: ...
|
||||||
def migrate_module(self, pkg: Node, stage: str) -> None: ...
|
def migrate_module(self, pkg: Node, stage: str) -> None: ...
|
||||||
|
|
||||||
|
def exec_script(
|
||||||
|
cr: Cursor,
|
||||||
|
installed_version: str,
|
||||||
|
pyfile: str,
|
||||||
|
addon,
|
||||||
|
stage,
|
||||||
|
version: str | None = ...,
|
||||||
|
) -> None: ...
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def get_modules() -> list[str]: ...
|
|||||||
def get_modules_with_version() -> dict[str, Any]: ...
|
def get_modules_with_version() -> dict[str, Any]: ...
|
||||||
def adapt_version(version: str) -> str: ...
|
def adapt_version(version: str) -> str: ...
|
||||||
|
|
||||||
current_test: Any
|
current_test: bool
|
||||||
|
|
||||||
def check_python_external_dependency(pydep) -> None: ...
|
def check_python_external_dependency(pydep) -> None: ...
|
||||||
def check_manifest_dependencies(manifest) -> None: ...
|
def check_manifest_dependencies(manifest) -> None: ...
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Any, Callable, TypeVar
|
from typing import Any, Callable, TypeVar
|
||||||
|
|
||||||
from ..api import Environment
|
from ..api import Environment
|
||||||
|
from ..models import BaseModel
|
||||||
from ..sql_db import Cursor
|
from ..sql_db import Cursor
|
||||||
|
|
||||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||||
@@ -8,6 +9,7 @@ _CallableT = TypeVar("_CallableT", bound=Callable)
|
|||||||
PG_CONCURRENCY_ERRORS_TO_RETRY: tuple[str, str, str]
|
PG_CONCURRENCY_ERRORS_TO_RETRY: tuple[str, str, str]
|
||||||
MAX_TRIES_ON_CONCURRENCY_FAILURE: int
|
MAX_TRIES_ON_CONCURRENCY_FAILURE: int
|
||||||
|
|
||||||
|
def get_public_method(model: BaseModel, name: str): ...
|
||||||
def dispatch(method: str, params): ...
|
def dispatch(method: str, params): ...
|
||||||
def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...
|
def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...
|
||||||
def execute_kw(
|
def execute_kw(
|
||||||
|
|||||||
@@ -14,3 +14,6 @@ class TestCase(_TestCase):
|
|||||||
def doCleanups(self) -> None: ...
|
def doCleanups(self) -> None: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def doClassCleanups(cls) -> None: ...
|
def doClassCleanups(cls) -> None: ...
|
||||||
|
@property
|
||||||
|
def canonical_tag(self) -> str: ...
|
||||||
|
def get_log_metadata(self) -> dict: ...
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ from typing import Any, Callable, Generator, Mapping, Match, TypeVar
|
|||||||
from xmlrpc import client as xmlrpclib
|
from xmlrpc import client as xmlrpclib
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from odoo.addons.base.models.res_users import Users
|
|
||||||
from urllib3.util import Url
|
from urllib3.util import Url
|
||||||
from websocket import WebSocket
|
from websocket import WebSocket
|
||||||
|
|
||||||
|
from odoo.addons.base.models.res_users import Users
|
||||||
|
|
||||||
from ..api import Environment
|
from ..api import Environment
|
||||||
from ..http import Session
|
from ..http import Session
|
||||||
from ..models import BaseModel
|
from ..models import BaseModel
|
||||||
@@ -222,6 +223,7 @@ class HttpCase(TransactionCase):
|
|||||||
cookies: Any | None = ...,
|
cookies: Any | None = ...,
|
||||||
error_checker: Any | None = ...,
|
error_checker: Any | None = ...,
|
||||||
watch: bool = ...,
|
watch: bool = ...,
|
||||||
|
cpu_throttling: int | None = ...,
|
||||||
**kw
|
**kw
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -5,5 +5,9 @@ from .suite import OdooSuite
|
|||||||
|
|
||||||
def get_test_modules(module: str) -> list: ...
|
def get_test_modules(module: str) -> list: ...
|
||||||
def make_suite(module_names: list[str], position: str = ...) -> OdooSuite: ...
|
def make_suite(module_names: list[str], position: str = ...) -> OdooSuite: ...
|
||||||
def run_suite(suite: OdooSuite, module_name: str | None = ...) -> OdooTestResult: ...
|
def run_suite(
|
||||||
|
suite: OdooSuite,
|
||||||
|
module_name: str | None = ...,
|
||||||
|
global_report: OdooTestResult | None = ...,
|
||||||
|
) -> OdooTestResult: ...
|
||||||
def unwrap_suite(test) -> Iterator: ...
|
def unwrap_suite(test) -> Iterator: ...
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from typing import Any, NamedTuple
|
|||||||
|
|
||||||
STDOUT_LINE: str
|
STDOUT_LINE: str
|
||||||
STDERR_LINE: str
|
STDERR_LINE: str
|
||||||
|
ODOO_TEST_MAX_FAILED_TESTS: int
|
||||||
stats_logger: Logger
|
stats_logger: Logger
|
||||||
|
|
||||||
class Stat(NamedTuple):
|
class Stat(NamedTuple):
|
||||||
@@ -21,12 +22,16 @@ class OdooTestResult:
|
|||||||
queries_start: int | None
|
queries_start: int | None
|
||||||
had_failure: bool
|
had_failure: bool
|
||||||
stats: dict[str, Stat]
|
stats: dict[str, Stat]
|
||||||
|
global_report: OdooTestResult | None
|
||||||
|
shouldStop: bool
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
stream: Any | None = ...,
|
stream: Any | None = ...,
|
||||||
descriptions: Any | None = ...,
|
descriptions: Any | None = ...,
|
||||||
verbosity: Any | None = ...,
|
verbosity: Any | None = ...,
|
||||||
|
global_report: OdooTestResult | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def total_errors_count(self) -> int: ...
|
||||||
def printErrors(self) -> None: ...
|
def printErrors(self) -> None: ...
|
||||||
def startTest(self, test) -> None: ...
|
def startTest(self, test) -> None: ...
|
||||||
def stopTest(self, test) -> None: ...
|
def stopTest(self, test) -> None: ...
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
from re import Pattern
|
from re import Pattern
|
||||||
|
|
||||||
|
from ..tools import OrderedSet
|
||||||
|
|
||||||
class TagsSelector:
|
class TagsSelector:
|
||||||
filter_spec_re: Pattern
|
filter_spec_re: Pattern
|
||||||
exclude: set
|
exclude: set
|
||||||
include: set
|
include: set
|
||||||
|
parameters: OrderedSet
|
||||||
def __init__(self, spec: str) -> None: ...
|
def __init__(self, spec: str) -> None: ...
|
||||||
def check(self, test) -> bool: ...
|
def check(self, test) -> bool: ...
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
from typing import Iterator, Tuple, TypeVar
|
from typing import Iterator, Tuple, TypeVar
|
||||||
|
|
||||||
|
import babel
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
_DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime)
|
_DateTimeT = TypeVar("_DateTimeT", datetime.date, datetime.datetime)
|
||||||
@@ -21,3 +22,4 @@ def json_default(obj) -> str: ...
|
|||||||
def date_range(
|
def date_range(
|
||||||
start: datetime.datetime, end: datetime.datetime, step: relativedelta = ...
|
start: datetime.datetime, end: datetime.datetime, step: relativedelta = ...
|
||||||
) -> Iterator[datetime.datetime]: ...
|
) -> Iterator[datetime.datetime]: ...
|
||||||
|
def weeknumber(locale: babel.Locale, date: datetime.date) -> Tuple[int, int]: ...
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ import markupsafe
|
|||||||
import xlsxwriter
|
import xlsxwriter
|
||||||
import xlwt
|
import xlwt
|
||||||
from babel.core import Locale
|
from babel.core import Locale
|
||||||
|
from xlwt import Worksheet
|
||||||
|
|
||||||
from odoo.addons.base.models.res_currency import Currency
|
from odoo.addons.base.models.res_currency import Currency
|
||||||
from odoo.addons.base.models.res_lang import Lang
|
from odoo.addons.base.models.res_lang import Lang
|
||||||
from xlwt import Worksheet
|
|
||||||
|
|
||||||
from ..api import Environment
|
from ..api import Environment
|
||||||
from ..loglevels import exception_to_unicode as exception_to_unicode
|
from ..loglevels import exception_to_unicode as exception_to_unicode
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ from io import BytesIO
|
|||||||
from re import Pattern
|
from re import Pattern
|
||||||
from typing import Any, BinaryIO, Iterable
|
from typing import Any, BinaryIO, Iterable
|
||||||
|
|
||||||
from odoo.addons.base.models.ir_attachment import IrAttachment
|
|
||||||
from PyPDF2 import PdfFileReader, PdfFileWriter
|
from PyPDF2 import PdfFileReader, PdfFileWriter
|
||||||
|
|
||||||
|
from odoo.addons.base.models.ir_attachment import IrAttachment
|
||||||
|
|
||||||
DEFAULT_PDF_DATETIME_FORMAT: str
|
DEFAULT_PDF_DATETIME_FORMAT: str
|
||||||
REGEX_SUBTYPE_UNFORMATED: Pattern
|
REGEX_SUBTYPE_UNFORMATED: Pattern
|
||||||
REGEX_SUBTYPE_FORMATED: Pattern
|
REGEX_SUBTYPE_FORMATED: Pattern
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from typing import Callable, Iterable, Literal
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
from lxml.etree import _Element
|
from lxml.etree import _Element
|
||||||
|
|
||||||
from odoo.addons.base.models.ir_attachment import IrAttachment
|
from odoo.addons.base.models.ir_attachment import IrAttachment
|
||||||
|
|
||||||
from ..api import Environment
|
from ..api import Environment
|
||||||
|
|||||||
Reference in New Issue
Block a user