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:
@@ -61,6 +61,8 @@ def returns(
|
||||
def downgrade(method: Callable, value, self, args, kwargs): ...
|
||||
def autovacuum(method: _CallableT) -> _CallableT: ...
|
||||
def model(method: _CallableT) -> _CallableT: ...
|
||||
def readonly(method: _CallableT) -> _CallableT: ...
|
||||
def private(method: _CallableT) -> _CallableT: ...
|
||||
def model_create_single(method: _CallableT) -> _CallableT: ...
|
||||
def model_create_multi(method: _CallableT) -> _CallableT: ...
|
||||
def call_kw(model: BaseModel, name: str, args, kwargs): ...
|
||||
|
||||
@@ -269,10 +269,10 @@ class Html(_String):
|
||||
|
||||
class Date(Field[datetime.date]):
|
||||
type: str
|
||||
start_of = date_utils.start_of
|
||||
end_of = date_utils.end_of
|
||||
add = date_utils.add
|
||||
subtract = date_utils.subtract
|
||||
start_of = staticmethod(date_utils.start_of)
|
||||
end_of = staticmethod(date_utils.end_of)
|
||||
add = staticmethod(date_utils.add)
|
||||
subtract = staticmethod(date_utils.subtract)
|
||||
@staticmethod
|
||||
def today(*args) -> datetime.date: ...
|
||||
@staticmethod
|
||||
@@ -293,10 +293,10 @@ class Date(Field[datetime.date]):
|
||||
|
||||
class Datetime(Field[datetime.datetime]):
|
||||
type: str
|
||||
start_of = date_utils.start_of
|
||||
end_of = date_utils.end_of
|
||||
add = date_utils.add
|
||||
subtract = date_utils.subtract
|
||||
start_of = staticmethod(date_utils.start_of)
|
||||
end_of = staticmethod(date_utils.end_of)
|
||||
add = staticmethod(date_utils.add)
|
||||
subtract = staticmethod(date_utils.subtract)
|
||||
@staticmethod
|
||||
def now(*args) -> datetime.datetime: ...
|
||||
@staticmethod
|
||||
|
||||
@@ -6,14 +6,15 @@ from typing import Any, Callable, Generator, Iterable, Literal, Mapping, TypeVar
|
||||
import geoip2.database
|
||||
import geoip2.models
|
||||
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.exceptions import NotFound
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
|
||||
from werkzeug.routing import Map, Rule
|
||||
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 .models import BaseModel
|
||||
from .modules.registry import Registry
|
||||
|
||||
@@ -15,6 +15,7 @@ from typing import (
|
||||
|
||||
import dateutil.relativedelta
|
||||
import psycopg2
|
||||
|
||||
from odoo.addons.base.models.res_company import Company
|
||||
from odoo.addons.base.models.res_users import Users
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ def get_modules() -> list[str]: ...
|
||||
def get_modules_with_version() -> dict[str, Any]: ...
|
||||
def adapt_version(version: str) -> str: ...
|
||||
|
||||
current_test: Any
|
||||
current_test: bool
|
||||
|
||||
def check_python_external_dependency(pydep) -> None: ...
|
||||
def check_manifest_dependencies(manifest) -> None: ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
from ..api import Environment
|
||||
from ..models import BaseModel
|
||||
from ..sql_db import Cursor
|
||||
|
||||
_CallableT = TypeVar("_CallableT", bound=Callable)
|
||||
@@ -9,6 +10,7 @@ PG_CONCURRENCY_ERRORS_TO_RETRY: tuple[str, str, str]
|
||||
PG_CONCURRENCY_EXCEPTIONS_TO_RETRY: tuple[Exception, ...]
|
||||
MAX_TRIES_ON_CONCURRENCY_FAILURE: int
|
||||
|
||||
def get_public_method(model: BaseModel, name: str): ...
|
||||
def dispatch(method: str, params): ...
|
||||
def execute_cr(cr: Cursor, uid: int, obj: str, method: str, *args, **kw): ...
|
||||
def execute_kw(
|
||||
|
||||
@@ -14,3 +14,6 @@ class TestCase(_TestCase):
|
||||
def doCleanups(self) -> None: ...
|
||||
@classmethod
|
||||
def doClassCleanups(cls) -> None: ...
|
||||
@property
|
||||
def canonical_tag(self) -> str: ...
|
||||
def get_log_metadata(self) -> dict: ...
|
||||
|
||||
@@ -8,11 +8,12 @@ from xmlrpc import client as xmlrpclib
|
||||
|
||||
import requests
|
||||
from freezegun.api import _freeze_time
|
||||
from odoo.addons.base.models.res_currency import Currency
|
||||
from odoo.addons.base.models.res_users import Users
|
||||
from urllib3.util import Url
|
||||
from websocket import WebSocket
|
||||
|
||||
from odoo.addons.base.models.res_currency import Currency
|
||||
from odoo.addons.base.models.res_users import Users
|
||||
|
||||
from ..api import Environment
|
||||
from ..http import Session
|
||||
from ..models import BaseModel
|
||||
@@ -262,6 +263,7 @@ class HttpCase(TransactionCase):
|
||||
watch: bool = ...,
|
||||
success_signal: str = ...,
|
||||
debug: bool = ...,
|
||||
cpu_throttling: int | None = ...,
|
||||
**kw
|
||||
) -> None: ...
|
||||
def start_tour(
|
||||
|
||||
@@ -6,4 +6,6 @@ from .suite import OdooSuite
|
||||
def get_module_test_cases(module) -> Iterator: ...
|
||||
def get_test_modules(module: str) -> list: ...
|
||||
def make_suite(module_names: list[str], position: str = ...) -> OdooSuite: ...
|
||||
def run_suite(suite: OdooSuite) -> OdooTestResult: ...
|
||||
def run_suite(
|
||||
suite: OdooSuite, global_report: OdooTestResult | None = ...
|
||||
) -> OdooTestResult: ...
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import Any, NamedTuple
|
||||
|
||||
STDOUT_LINE: str
|
||||
STDERR_LINE: str
|
||||
ODOO_TEST_MAX_FAILED_TESTS: int
|
||||
stats_logger: Logger
|
||||
|
||||
class Stat(NamedTuple):
|
||||
@@ -21,12 +22,16 @@ class OdooTestResult:
|
||||
queries_start: int | None
|
||||
had_failure: bool
|
||||
stats: dict[str, Stat]
|
||||
global_report: OdooTestResult | None
|
||||
shouldStop: bool
|
||||
def __init__(
|
||||
self,
|
||||
stream: Any | None = ...,
|
||||
descriptions: Any | None = ...,
|
||||
verbosity: Any | None = ...,
|
||||
global_report: OdooTestResult | None = ...,
|
||||
) -> None: ...
|
||||
def total_errors_count(self) -> int: ...
|
||||
def printErrors(self) -> None: ...
|
||||
def startTest(self, test) -> None: ...
|
||||
def stopTest(self, test) -> None: ...
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
from re import Pattern
|
||||
|
||||
from ..tools import OrderedSet
|
||||
|
||||
class TagsSelector:
|
||||
filter_spec_re: Pattern
|
||||
exclude: set
|
||||
include: set
|
||||
parameters: OrderedSet
|
||||
def __init__(self, spec: str) -> None: ...
|
||||
def check(self, test) -> bool: ...
|
||||
|
||||
@@ -67,6 +67,7 @@ def email_split_and_format(text: str) -> list[str]: ...
|
||||
def email_split_and_format_normalize(text: str) -> list[str]: ...
|
||||
def email_normalize(text: str, strict: bool = ...) -> str | Literal[False]: ...
|
||||
def email_normalize_all(text: str) -> list[str]: ...
|
||||
def email_anonymize(normalized_email: str, *, redact_domain: bool = ...) -> str: ...
|
||||
def email_domain_extract(email: str) -> str | Literal[False]: ...
|
||||
def email_domain_normalize(domain: str) -> str | Literal[False]: ...
|
||||
def url_domain_extract(url: str) -> str | Literal[False]: ...
|
||||
|
||||
@@ -23,9 +23,10 @@ import markupsafe
|
||||
import xlsxwriter
|
||||
import xlwt
|
||||
from babel.core import Locale
|
||||
from xlwt import Worksheet
|
||||
|
||||
from odoo.addons.base.models.res_currency import Currency
|
||||
from odoo.addons.base.models.res_lang import LangData
|
||||
from xlwt import Worksheet
|
||||
|
||||
from ..api import Environment
|
||||
from ..loglevels import exception_to_unicode as exception_to_unicode
|
||||
|
||||
@@ -2,9 +2,10 @@ from io import BytesIO
|
||||
from re import Pattern
|
||||
from typing import Any, BinaryIO, Iterable
|
||||
|
||||
from odoo.addons.base.models.ir_attachment import IrAttachment
|
||||
from PyPDF2 import PdfFileReader, PdfFileWriter
|
||||
|
||||
from odoo.addons.base.models.ir_attachment import IrAttachment
|
||||
|
||||
DEFAULT_PDF_DATETIME_FORMAT: str
|
||||
REGEX_SUBTYPE_UNFORMATED: Pattern
|
||||
REGEX_SUBTYPE_FORMATED: Pattern
|
||||
|
||||
@@ -11,7 +11,8 @@ class Query:
|
||||
def __init__(
|
||||
self, env: Environment, alias: str, table: SQL | None = ...
|
||||
) -> None: ...
|
||||
def make_alias(self, alias: str, link: str) -> str: ...
|
||||
@staticmethod
|
||||
def make_alias(alias: str, link: str) -> str: ...
|
||||
def add_table(self, alias: str, table: SQL | None = ...) -> None: ...
|
||||
def add_join(
|
||||
self, kind: str, alias: str, table: str | SQL | None, condition: SQL
|
||||
|
||||
@@ -2,6 +2,7 @@ from typing import Callable, Iterable, Literal
|
||||
|
||||
from lxml import etree
|
||||
from lxml.etree import _Element
|
||||
|
||||
from odoo.addons.base.models.ir_attachment import IrAttachment
|
||||
|
||||
from ..api import Environment
|
||||
|
||||
Reference in New Issue
Block a user