Update stubs

This commit is contained in:
Trinh Anh Ngoc
2020-11-15 18:53:50 +07:00
parent 417368c916
commit 82476bb0af
13 changed files with 61 additions and 13 deletions

View File

@@ -1,2 +1,2 @@
from . import deploy as deploy, scaffold as scaffold, server as server, shell as shell, start as start
from . import cloc as cloc, deploy as deploy, scaffold as scaffold, server as server, shell as shell, start as start
from .command import Command as Command, main as main

5
odoo-stubs/cli/cloc.pyi Normal file
View File

@@ -0,0 +1,5 @@
from . import Command
from typing import Any
class Cloc(Command):
def run(self, args: Any) -> None: ...

View File

@@ -1,4 +1,3 @@
import datetime
from typing import Any, Optional
from odoo.tools import date_utils
@@ -274,6 +273,7 @@ class Binary(Field):
_slots: Any = ...
@property
def column_type(self): ...
def _get_attrs(self, model: Any, name: Any): ...
_description_attachment: Any = ...
def convert_to_column(self, value: Any, record: Any, values: Optional[Any] = ..., validate: bool = ...): ...
def convert_to_cache(self, value: Any, record: Any, validate: bool = ...): ...
@@ -354,7 +354,7 @@ class Many2one(_Relational):
def convert_to_display_name(self, value: Any, record: Any): ...
def convert_to_onchange(self, value: Any, record: Any, names: Any): ...
def write(self, records: Any, value: Any): ...
def _remove_inverses(self, records: Any, value: Any) -> None: ...
def _remove_inverses(self, records: Any, value: Any): ...
def _update_inverses(self, records: Any, value: Any) -> None: ...
class Many2oneReference(Integer):
@@ -387,6 +387,7 @@ class One2many(_RelationalMulti):
_description_relation_field: Any = ...
def update_db(self, model: Any, columns: Any) -> None: ...
def get_domain_list(self, records: Any): ...
# def __get__(self, records: Any, owner: Any): ...
def read(self, records: Any): ...
def write_real(self, records_commands_list: Any, create: bool = ...): ...
def write_new(self, records_commands_list: Any): ...
@@ -418,3 +419,4 @@ class Id(Field):
def prefetch_many2one_ids(record: Any, field: Any): ...
def prefetch_x2many_ids(record: Any, field: Any): ...
def apply_required(model: Any, field_name: Any) -> None: ...

View File

@@ -44,6 +44,7 @@ class NewId:
def __repr__(self): ...
def origin_ids(ids: Any): ...
def expand_ids(id0: Any, ids: Any) -> None: ...
IdType: Any
PREFETCH_MAX: int
@@ -73,6 +74,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
_needaction: bool = ...
_translate: bool = ...
_check_company_auto: bool = ...
_depends: Any = ...
_transient_check_count: int = ...
_transient_max_count: Any = ...
_transient_max_hours: Any = ...
@@ -247,6 +249,10 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
def with_user(self, user: Any) -> BaseModel: ...
def with_context(self, *args: Any, **kwargs: Any) -> BaseModel: ...
def with_prefetch(self, prefetch_ids: Optional[Any] = ...) -> BaseModel: ...
def _update_cache(self, values: Any, validate: bool = ...): ...
def _convert_to_record(self, values: Any): ...
def _convert_to_write(self, values: Any): ...
def _mapped_func(self, func: Any): ...
def mapped(self, func: Any): ...
def _mapped_cache(self, name_seq: Any): ...
def filtered(self, func: Any) -> BaseModel: ...

View File

@@ -23,6 +23,7 @@ def AND(domains: Any): ...
def OR(domains: Any): ...
def distribute_not(domain: Any): ...
def _quote(to_quote: Any): ...
def _shorten_alias(alias: Any): ...
def generate_table_alias(src_table_alias: Any, joined_tables: Any = ...): ...
def get_alias_from_query(from_query: Any): ...
def normalize_leaf(element: Any): ...

View File

@@ -149,6 +149,8 @@ class Worker:
def _runloop(self) -> None: ...
class WorkerHTTP(Worker):
sock_timeout: Any = ...
def __init__(self, multi: Any) -> None: ...
def process_request(self, client: Any, addr: Any) -> None: ...
def process_work(self) -> None: ...
server: Any = ...

View File

@@ -6,7 +6,7 @@ _logger: Any
def unbuffer(symb: Any, cr: Any): ...
def undecimalize(symb: Any, cr: Any): ...
def adapt_string(adapted: Any): ...
def flush_env(cr: Any) -> None: ...
def flush_env(cr: Any, *, clear: bool = ...) -> None: ...
def clear_env(cr: Any) -> None: ...
re_from: Any

View File

@@ -90,7 +90,7 @@ class ChromeBrowser:
def _spawn_chrome(self, cmd: Any): ...
def _chrome_start(self) -> None: ...
def _find_websocket(self) -> None: ...
def _json_command(self, command: Any, timeout: int = ...): ...
def _json_command(self, command: Any, timeout: int = ..., get_key: Optional[Any] = ...): ...
def _open_websocket(self) -> None: ...
def _websocket_send(self, method: Any, params: Optional[Any] = ...): ...
def _get_message(self, raise_log_error: bool = ...): ...
@@ -133,6 +133,7 @@ class HttpCase(TransactionCase):
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 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): ...
@@ -160,8 +161,10 @@ class 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 O2MForm(Form):

View File

@@ -10,6 +10,6 @@ from .xml_utils import *
from .date_utils import *
from .convert import *
from .template_inheritance import *
from . import appdirs as appdirs, pdf as pdf, pycompat as pycompat, win32 as win32
from . import appdirs as appdirs, cloc as cloc, pdf as pdf, pycompat as pycompat, win32 as win32
from .config import config as config
from .graph import graph as graph

24
odoo-stubs/tools/cloc.pyi Normal file
View File

@@ -0,0 +1,24 @@
from typing import Any, Optional
VERSION: int
DEFAULT_EXCLUDE: Any
STANDARD_MODULES: Any
MAX_FILE_SIZE: Any
class Cloc:
modules: Any = ...
code: Any = ...
total: Any = ...
errors: Any = ...
max_width: int = ...
def __init__(self) -> None: ...
def parse_xml(self, s: Any): ...
def parse_py(self, s: Any): ...
def parse_js(self, s: Any): ...
def book(self, module: Any, item: str = ..., count: Any = ...) -> None: ...
def count_path(self, path: Any, exclude: Optional[Any] = ...) -> None: ...
def count_modules(self, env: Any) -> None: ...
def count_customization(self, env: Any) -> None: ...
def count_env(self, env: Any) -> None: ...
def count_database(self, database: Any) -> None: ...
def report(self, verbose: bool = ..., width: Optional[Any] = ...): ...

View File

@@ -16,7 +16,6 @@ class _Cleaner(clean.Cleaner):
def tag_quote(self, el: Any): ...
def strip_class(self, el: Any) -> None: ...
def parse_style(self, el: Any) -> None: ...
def allow_element(self, el: Any): ...
def html_sanitize(src: Any, silent: bool = ..., sanitize_tags: bool = ..., sanitize_attributes: bool = ..., sanitize_style: bool = ..., strip_style: bool = ..., strip_classes: bool = ...): ...
def html_keep_url(text: Any): ...
@@ -36,6 +35,6 @@ def email_split(text: Any): ...
def email_split_and_format(text: Any): ...
def email_normalize(text: Any): ...
def email_escape_char(email_address: Any): ...
def decode_smtp_header(smtp_header: Any): ...
def decode_message_header(message: Any, header: Any, separator: str = ...): ...
def decode_smtp_header(smtp_header: Any, quoted: bool = ...): ...
def decode_message_header(message: Any, header: Any, separator: str = ..., quoted: bool = ...): ...
def formataddr(pair: Any, charset: str = ...): ...

View File

@@ -45,6 +45,8 @@ class _lt:
def __str__(self): ...
def __eq__(self, other: Any) -> Any: ...
def __lt__(self, other: Any) -> Any: ...
def __add__(self, other: Any): ...
def __radd__(self, other: Any): ...
_: Any
@@ -59,7 +61,7 @@ def TranslationFileReader(source: Any, fileformat: str = ...): ...
class CSVFileReader:
source: Any = ...
fields: Any = ...
prev_code_src: str = ...
def __init__(self, source: Any) -> None: ...
def __iter__(self) -> Any: ...

View File

@@ -1,7 +1,11 @@
from odoo.tools.misc import file_open as file_open
from lxml import etree
from typing import Any, Optional
def check_with_xsd(tree_or_str: Any, stream: Any) -> None: ...
def _check_with_xsd(tree_or_str: Any, stream: Any) -> None: ...
class odoo_resolver(etree.Resolver):
env: Any = ...
def __init__(self, env: Any) -> None: ...
def resolve(self, url: Any, id: Any, context: Any): ...
def _check_with_xsd(tree_or_str: Any, stream: Any, env: Optional[Any] = ...) -> None: ...
def create_xml_node_chain(first_parent_node: Any, nodes_list: Any, last_node_value: Optional[Any] = ...): ...
def create_xml_node(parent_node: Any, node_name: Any, node_value: Optional[Any] = ...): ...