Update stubs

This commit is contained in:
Trinh Anh Ngoc
2020-05-31 10:56:34 +07:00
parent 9796eccf4e
commit b7acd65ad8
75 changed files with 2455 additions and 80 deletions

View File

@@ -1 +1,16 @@
def __getattr__(name): ...
from . import addons as addons, api as api, cli as cli, conf as conf, fields as fields, http as http, loglevels as loglevels, models as models, netsvc as netsvc, osv as osv, release as release, service as service, sql_db as sql_db, tools as tools, upgrade as upgrade
from odoo.tools.translate import _ as _, _lt as _lt
from typing import Any, Optional
__path__: Any
evented: bool
def gevent_wait_callback(conn: Any, timeout: Optional[Any] = ...) -> None: ...
multi_process: bool
def _decompress(data: Any): ...
SUPERUSER_ID: int
def registry(database_name: Optional[Any] = ...): ...

View File

@@ -0,0 +1,3 @@
from typing import Any
__path__: Any

View File

@@ -1,24 +1,46 @@
from collections import Mapping
from collections.abc import Mapping
from typing import Any, Optional
from .sql_db import Cursor
from odoo.sql_db import Cursor
__all__: Any
_logger: Any
INHERITED_ATTRS: Any
class Params:
args: Any = ...
kwargs: Any = ...
def __init__(self, args: Any, kwargs: Any) -> None: ...
def __str__(self): ...
class Meta(type):
def __new__(meta: Any, name: Any, bases: Any, attrs: Any): ...
def attrsetter(attr: Any, value: Any): ...
def propagate(method1: Any, method2: Any): ...
def constrains(*args: Any): ...
def onchange(*args: Any): ...
def depends(*args: Any): ...
def depends_context(*args: Any): ...
def returns(model: Any, downgrade: Optional[Any] = ..., upgrade: Optional[Any] = ...): ...
def downgrade(method: Any, value: Any, self: Any, args: Any, kwargs: Any): ...
def split_context(method: Any, args: Any, kwargs: Any): ...
def autovacuum(method: Any): ...
def model(method: Any): ...
_create_logger: Any
def _model_create_single(create: Any, self: Any, arg: Any): ...
def model_create_single(method: Any): ...
def _model_create_multi(create: Any, self: Any, arg: Any): ...
def model_create_multi(method: Any): ...
def _call_kw_model(method: Any, self: Any, args: Any, kwargs: Any): ...
def _call_kw_model_create(method: Any, self: Any, args: Any, kwargs: Any): ...
def _call_kw_multi(method: Any, self: Any, args: Any, kwargs: Any): ...
def call_kw(model: Any, name: Any, args: Any, kwargs: Any): ...
class Environment(Mapping):
_local: Any = ...
cr: Cursor = ...
uid: int = ...
context: dict = ...
@@ -30,16 +52,18 @@ class Environment(Mapping):
def reset(cls) -> None: ...
registry: Any = ...
cache: Any = ...
_cache_key: Any = ...
_protected: Any = ...
all: Any = ...
def __new__(cls, cr: Any, uid: Any, context: Any) -> Environment: ...
def __new__(cls, cr: Any, uid: Any, context: Any, su: bool = ...) -> Environment: ...
def __contains__(self, model_name: Any): ...
def __getitem__(self, model_name: Any): ...
def __iter__(self): ...
def __iter__(self) -> Any: ...
def __len__(self): ...
def __eq__(self, other: Any): ...
def __ne__(self, other: Any): ...
def __hash__(self): ...
def __call__(self, cr: Optional[Any] = ..., user: Optional[Any] = ..., context: Optional[Any] = ...) -> Environment: ...
def __eq__(self, other: Any) -> Any: ...
def __ne__(self, other: Any) -> Any: ...
def __hash__(self) -> Any: ...
def __call__(self, cr: Optional[Any] = ..., user: Optional[Any] = ..., context: Optional[Any] = ..., su: Optional[Any] = ...): ...
def ref(self, xml_id: Any, raise_if_not_found: bool = ...): ...
def is_superuser(self): ...
def is_admin(self): ...
@@ -67,6 +91,7 @@ class Environment(Mapping):
def add_to_compute(self, field: Any, records: Any): ...
def remove_to_compute(self, field: Any, records: Any) -> None: ...
def norecompute(self) -> None: ...
def cache_key(self, field: Any): ...
class Environments:
envs: Any = ...
@@ -78,7 +103,10 @@ class Environments:
def add(self, env: Any) -> None: ...
def __iter__(self) -> Any: ...
NOTHING: Any
class Cache:
_data: Any = ...
def __init__(self) -> None: ...
def contains(self, record: Any, field: Any): ...
def get(self, record: Any, field: Any, default: Any = ...): ...
@@ -86,6 +114,7 @@ class Cache:
def update(self, records: Any, field: Any, values: Any) -> None: ...
def remove(self, record: Any, field: Any) -> None: ...
def get_values(self, records: Any, field: Any) -> None: ...
def get_until_miss(self, records: Any, field: Any): ...
def get_records_different_from(self, records: Any, field: Any, value: Any): ...
def get_fields(self, record: Any) -> None: ...
def get_records(self, model: Any, field: Any): ...

View File

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

View File

@@ -0,0 +1,13 @@
from typing import Any
commands: Any
class CommandType(type):
def __init__(cls, name: Any, bases: Any, attrs: Any) -> None: ...
Command: Any
class Help(Command):
def run(self, args: Any) -> None: ...
def main() -> None: ...

10
odoo-stubs/cli/deploy.pyi Normal file
View File

@@ -0,0 +1,10 @@
from . import Command
from typing import Any
class Deploy(Command):
session: Any = ...
def __init__(self) -> None: ...
def deploy_module(self, module_path: Any, url: Any, login: Any, password: Any, db: str = ..., force: bool = ...): ...
def login_upload_module(self, module_file: Any, url: Any, login: Any, password: Any, db: Any, force: bool = ...): ...
def zip_module(self, path: Any): ...
def run(self, cmdargs: Any) -> None: ...

View File

@@ -0,0 +1,11 @@
from . import Command
from typing import Any
_logger: Any
class Populate(Command):
def run(self, cmdargs: Any) -> None: ...
@classmethod
def populate(cls, env: Any, size: Any, model_patterns: bool = ...): ...
@classmethod
def _get_ordered_models(cls, env: Any, model_patterns: bool = ...): ...

View File

@@ -0,0 +1,25 @@
from . import Command
from typing import Any, Optional
class Scaffold(Command):
def run(self, cmdargs: Any) -> None: ...
def epilog(self): ...
builtins: Any
def snake(s: Any): ...
def pascal(s: Any): ...
def directory(p: Any, create: bool = ...): ...
env: Any
class template:
id: Any = ...
path: Any = ...
def __init__(self, identifier: Any) -> None: ...
def __str__(self): ...
def files(self) -> None: ...
def render_to(self, modname: Any, directory: Any, params: Optional[Any] = ...) -> None: ...
def die(message: Any, code: int = ...) -> None: ...
def warn(message: Any) -> None: ...

18
odoo-stubs/cli/server.pyi Normal file
View File

@@ -0,0 +1,18 @@
from . import Command
from typing import Any
__author__: Any
__version__: Any
_logger: Any
def check_root_user() -> None: ...
def check_postgres_user() -> None: ...
def report_configuration() -> None: ...
def rm_pid_file(main_pid: Any) -> None: ...
def setup_pid_file() -> None: ...
def export_translation() -> None: ...
def import_translation() -> None: ...
def main(args: Any) -> None: ...
class Server(Command):
def run(self, args: Any) -> None: ...

21
odoo-stubs/cli/shell.pyi Normal file
View File

@@ -0,0 +1,21 @@
import code
from . import Command
from typing import Any, Optional
_logger: Any
def raise_keyboard_interrupt(*a: Any) -> None: ...
class Console(code.InteractiveConsole):
def __init__(self, locals: Optional[Any] = ..., filename: str = ...) -> None: ...
class Shell(Command):
supported_shells: Any = ...
def init(self, args: Any) -> None: ...
def console(self, local_vars: Any): ...
def ipython(self, local_vars: Any) -> None: ...
def ptpython(self, local_vars: Any) -> None: ...
def bpython(self, local_vars: Any) -> None: ...
def python(self, local_vars: Any) -> None: ...
def shell(self, dbname: Any) -> None: ...
def run(self, args: Any): ...

8
odoo-stubs/cli/start.pyi Normal file
View File

@@ -0,0 +1,8 @@
from . import Command
from typing import Any
class Start(Command):
def get_module_list(self, path: Any): ...
def run(self, cmdargs: Any): ...
def die(message: Any, code: int = ...) -> None: ...

View File

@@ -0,0 +1,4 @@
from typing import Any
addons_paths: Any
server_wide_modules: Any

35
odoo-stubs/exceptions.pyi Normal file
View File

@@ -0,0 +1,35 @@
from typing import Any
_logger: Any
class UserError(Exception):
def __init__(self, message: Any) -> None: ...
@property
def name(self): ...
class RedirectWarning(Exception):
def __init__(self, message: Any, action: Any, button_text: Any) -> None: ...
@property
def name(self): ...
class AccessDenied(UserError):
__cause__: Any = ...
traceback: Any = ...
def __init__(self, message: str = ...) -> None: ...
class AccessError(UserError): ...
class CacheMiss(KeyError):
def __init__(self, record: Any, field: Any) -> None: ...
class MissingError(UserError): ...
class ValidationError(UserError): ...
class except_orm(UserError):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class Warning(UserError):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class QWebException(Exception):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...

View File

@@ -1,12 +1,13 @@
import datetime
from typing import Any, Optional
from .tools import date_utils
from odoo.tools import date_utils
DATE_LENGTH: Any
DATETIME_LENGTH: Any
EMPTY_DICT: Any
RENAMED_ATTRS: Any
IR_MODELS: Any
_logger: Any
_schema: Any
Default: Any
def first(records: Any): ...
@@ -14,9 +15,10 @@ def resolve_mro(model: Any, name: Any, predicate: Any): ...
class MetaField(type):
by_type: Any = ...
def __new__(meta: Any, name: Any, bases: Any, attrs: Any): ...
def __init__(cls, name: Any, bases: Any, attrs: Any) -> None: ...
_global_seq: Any
class Field(MetaField('DummyField', (object,), {})):
type: Any = ...
relational: bool = ...
@@ -25,25 +27,97 @@ class Field(MetaField('DummyField', (object,), {})):
column_format: str = ...
column_cast_from: Any = ...
args: Any = ...
_module: Any = ...
_modules: Any = ...
_setup_done: Any = ...
_sequence: Any = ...
automatic: bool = ...
inherited: bool = ...
inherited_field: Any = ...
name: Any = ...
model_name: Any = ...
comodel_name: Any = ...
store: bool = ...
index: bool = ...
manual: bool = ...
copy: bool = ...
depends: Any = ...
depends_context: Any = ...
recursive: bool = ...
compute: Any = ...
compute_sudo: bool = ...
inverse: Any = ...
search: Any = ...
related: Any = ...
company_dependent: bool = ...
default: Any = ...
string: Any = ...
help: Any = ...
invisible: bool = ...
readonly: bool = ...
required: bool = ...
states: Any = ...
groups: Any = ...
change_default: bool = ...
deprecated: Any = ...
related_field: Any = ...
group_operator: Any = ...
group_expand: Any = ...
prefetch: bool = ...
def __init__(self, string: Any = ..., **kwargs: Any) -> None: ...
def new(self, **kwargs: Any): ...
def __getattr__(self, name: Any): ...
def __setattr__(self, name: Any, value: Any) -> None: ...
def set_all_attrs(self, attrs: Any) -> None: ...
def __delattr__(self, name: Any) -> None: ...
def __str__(self): ...
def __repr__(self): ...
def setup_base(self, model: Any, name: Any) -> None: ...
def _can_setup_from(self, field: Any): ...
def _get_attrs(self, model: Any, name: Any): ...
def _setup_attrs(self, model: Any, name: Any): ...
def setup_full(self, model: Any) -> None: ...
def _setup_regular_base(self, model: Any) -> None: ...
def _setup_regular_full(self, model: Any) -> None: ...
def _setup_related_full(self, model: Any) -> None: ...
def traverse_related(self, record: Any): ...
def _compute_related(self, records: Any) -> None: ...
def _process_related(self, value: Any): ...
def _inverse_related(self, records: Any) -> None: ...
def _search_related(self, records: Any, operator: Any, value: Any): ...
_related_comodel_name: Any = ...
_related_string: Any = ...
_related_help: Any = ...
_related_groups: Any = ...
_related_group_operator: Any = ...
@property
def base_field(self): ...
def cache_key(self, env: Any): ...
recursive: bool = ...
def resolve_depends(self, model: Any) -> None: ...
def _default_company_dependent(self, model: Any): ...
def _compute_company_dependent(self, records: Any) -> None: ...
def _inverse_company_dependent(self, records: Any) -> None: ...
def _search_company_dependent(self, records: Any, operator: Any, value: Any): ...
def resolve_depends(self, registry: Any) -> None: ...
def get_description(self, env: Any): ...
_description_store: Any = ...
_description_manual: Any = ...
_description_depends: Any = ...
_description_related: Any = ...
_description_company_dependent: Any = ...
_description_readonly: Any = ...
_description_required: Any = ...
_description_states: Any = ...
_description_groups: Any = ...
_description_change_default: Any = ...
_description_deprecated: Any = ...
_description_group_operator: Any = ...
@property
def _description_searchable(self): ...
@property
def _description_sortable(self): ...
def _description_string(self, env: Any): ...
def _description_help(self, env: Any): ...
def is_editable(self): ...
def null(self, record: 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 = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
def convert_to_record_multi(self, values: Any, records: Any): ...
def convert_to_read(self, value: Any, record: Any, use_name_get: bool = ...): ...
def convert_to_write(self, value: Any, record: Any): ...
def convert_to_onchange(self, value: Any, record: Any, names: Any): ...
@@ -52,12 +126,12 @@ class Field(MetaField('DummyField', (object,), {})):
def update_db(self, model: Any, columns: Any): ...
def update_db_column(self, model: Any, column: Any) -> None: ...
def update_db_notnull(self, model: Any, column: Any) -> None: ...
def update_db_index(self, model: Any, column: Any) -> None: ...
def read(self, records: Any): ...
def read(self, records: Any) -> None: ...
def create(self, record_values: Any) -> None: ...
def write(self, records: Any, value: Any): ...
# def __get__(self, records: Any, owner: Any): ...
def __set__(self, records: Any, value: Any) -> None: ...
# def __get__(self, record: Any, owner: Any): ...
def mapped(self, records: Any): ...
def __set__(self, records: Any, value: Any): ...
def compute_value(self, records: Any) -> None: ...
def determine_inverse(self, records: Any) -> None: ...
def determine_domain(self, records: Any, operator: Any, value: Any): ...
@@ -72,29 +146,44 @@ class Boolean(Field):
class Integer(Field):
type: str = ...
column_type: Any = ...
group_operator: str = ...
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 = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
def convert_to_read(self, value: Any, record: Any, use_name_get: bool = ...): ...
def _update(self, records: Any, value: Any) -> None: ...
def convert_to_export(self, value: Any, record: Any): ...
class Float(Field):
type: str = ...
column_cast_from: Any = ...
_digits: Any = ...
group_operator: str = ...
def __init__(self, string: Any = ..., digits: Any = ..., **kwargs: Any) -> None: ...
@property
def column_type(self): ...
def get_digits(self, env: Any): ...
_related__digits: Any = ...
def _description_digits(self, env: 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 = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
def convert_to_export(self, value: Any, record: Any): ...
round: Any = ...
is_zero: Any = ...
compare: Any = ...
class Monetary(Field):
type: str = ...
column_type: Any = ...
column_cast_from: Any = ...
currency_field: Any = ...
group_operator: str = ...
def __init__(self, string: Any = ..., currency_field: Any = ..., **kwargs: Any) -> None: ...
_description_currency_field: Any = ...
def _setup_currency_field(self, model: Any) -> None: ...
def _setup_regular_full(self, model: Any) -> None: ...
def _setup_related_full(self, model: Any) -> None: ...
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 = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
@@ -102,7 +191,12 @@ class Monetary(Field):
def convert_to_write(self, value: Any, record: Any): ...
class _String(Field):
translate: bool = ...
prefetch: Any = ...
def __init__(self, string: Any = ..., **kwargs: Any) -> None: ...
def _setup_attrs(self, model: Any, name: Any) -> None: ...
_related_translate: Any = ...
def _description_translate(self, env: Any): ...
def get_trans_terms(self, value: Any): ...
def get_trans_func(self, records: Any): ...
def check_trans_value(self, value: Any): ...
@@ -111,9 +205,16 @@ class _String(Field):
class Char(_String):
type: str = ...
column_cast_from: Any = ...
size: Any = ...
trim: bool = ...
@property
def column_type(self): ...
def update_db_column(self, model: Any, column: Any) -> None: ...
_related_size: Any = ...
_related_trim: Any = ...
_description_size: Any = ...
_description_trim: Any = ...
def _setup_regular_base(self, model: Any) -> None: ...
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 = ...): ...
@@ -126,6 +227,26 @@ class Text(_String):
class Html(_String):
type: str = ...
column_type: Any = ...
sanitize: bool = ...
sanitize_tags: bool = ...
sanitize_attributes: bool = ...
sanitize_style: bool = ...
sanitize_form: bool = ...
strip_style: bool = ...
strip_classes: bool = ...
def _get_attrs(self, model: Any, name: Any): ...
_related_sanitize: Any = ...
_related_sanitize_tags: Any = ...
_related_sanitize_attributes: Any = ...
_related_sanitize_style: Any = ...
_related_strip_style: Any = ...
_related_strip_classes: Any = ...
_description_sanitize: Any = ...
_description_sanitize_tags: Any = ...
_description_sanitize_attributes: Any = ...
_description_sanitize_style: Any = ...
_description_strip_style: Any = ...
_description_strip_classes: 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 = ...): ...
@@ -171,11 +292,16 @@ class Datetime(Field):
def convert_to_cache(self, value: Any, record: Any, validate: bool = ...): ...
def convert_to_export(self, value: Any, record: Any): ...
def convert_to_display_name(self, value: Any, record: Any): ...
_BINARY = memoryview
class Binary(Field):
type: str = ...
prefetch: bool = ...
depends_context: Any = ...
attachment: bool = ...
@property
def column_type(self): ...
_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 = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
@@ -185,13 +311,27 @@ class Binary(Field):
def write(self, records: Any, value: Any): ...
class Image(Binary):
max_width: int = ...
max_height: int = ...
verify_resolution: bool = ...
def create(self, record_values: Any) -> None: ...
def write(self, records: Any, value: Any) -> None: ...
def _image_process(self, value: Any): ...
def _process_related(self, value: Any): ...
class Selection(Field):
type: str = ...
column_type: Any = ...
selection: Any = ...
validate: bool = ...
ondelete: Any = ...
def __init__(self, selection: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
def _setup_regular_base(self, model: Any) -> None: ...
def _setup_related_full(self, model: Any): ...
def _get_attrs(self, model: Any, name: Any): ...
def _setup_attrs(self, model: Any, name: Any) -> None: ...
def _selection_modules(self, model: Any): ...
def _description_selection(self, env: Any): ...
def get_values(self, env: 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 = ...): ...
@@ -210,45 +350,80 @@ class Reference(Selection):
class _Relational(Field):
relational: bool = ...
domain: Any = ...
context: Any = ...
check_company: bool = ...
def __get__(self, records: Any, owner: Any): ...
comodel_name: str = ...
def _setup_regular_base(self, model: Any) -> None: ...
def get_domain_list(self, model: Any): ...
@property
def _related_domain(self): ...
_related_context: Any = ...
_description_relation: Any = ...
_description_context: Any = ...
def _description_domain(self, env: Any): ...
def null(self, record: Any): ...
class Many2one(_Relational):
type: str = ...
column_type: Any = ...
ondelete: Any = ...
auto_join: bool = ...
delegate: bool = ...
def __init__(self, comodel_name: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
def _setup_attrs(self, model: Any, name: Any) -> None: ...
def _setup_regular_base(self, model: Any) -> None: ...
def update_db(self, model: Any, columns: Any): ...
def update_db_column(self, model: Any, column: Any) -> None: ...
def update_db_foreign_key(self, model: Any, column: Any) -> None: ...
def _update(self, records: Any, value: Any) -> None: ...
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 = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
def convert_to_record_multi(self, values: Any, records: Any): ...
def convert_to_read(self, value: Any, record: Any, use_name_get: bool = ...): ...
def convert_to_write(self, value: Any, record: Any): ...
def convert_to_export(self, value: Any, record: Any): ...
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 _update_inverses(self, records: Any, value: Any) -> None: ...
class Many2oneReference(Integer):
type: str = ...
model_field: Any = ...
_related_model_field: Any = ...
def convert_to_cache(self, value: Any, record: Any, validate: bool = ...): ...
def _remove_inverses(self, records: Any, value: Any) -> None: ...
def _update_inverses(self, records: Any, value: Any) -> None: ...
def _record_ids_per_res_model(self, records: Any): ...
class _RelationalMulti(_Relational):
def _update(self, records: Any, value: Any): ...
def convert_to_cache(self, value: Any, record: Any, validate: bool = ...): ...
def convert_to_record(self, value: Any, record: Any): ...
def convert_to_record_multi(self, values: Any, records: Any): ...
def convert_to_read(self, value: Any, record: Any, use_name_get: bool = ...): ...
def convert_to_write(self, value: Any, record: Any): ...
def convert_to_export(self, value: Any, record: Any): ...
def convert_to_display_name(self, value: Any, record: Any) -> None: ...
depends: Any = ...
def _setup_regular_full(self, model: Any) -> None: ...
def create(self, record_values: Any) -> None: ...
def write(self, records: Any, value: Any): ...
def write_batch(self, records_commands_list: Any, create: bool = ...): ...
class One2many(_RelationalMulti):
type: str = ...
inverse_name: Any = ...
auto_join: bool = ...
limit: Any = ...
copy: bool = ...
def __init__(self, comodel_name: Any = ..., inverse_name: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
def _setup_regular_full(self, model: Any) -> None: ...
_description_relation_field: Any = ...
def update_db(self, model: Any, columns: Any) -> None: ...
def get_domain_list(self, records: Any): ...
def read(self, records: Any): ...
@@ -257,8 +432,17 @@ class One2many(_RelationalMulti):
class Many2many(_RelationalMulti):
type: str = ...
_explicit: bool = ...
relation: Any = ...
column1: Any = ...
column2: Any = ...
auto_join: bool = ...
limit: Any = ...
ondelete: Any = ...
def __init__(self, comodel_name: Any = ..., relation: Any = ..., column1: Any = ..., column2: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
def update_db(self, model: Any, columns: Any): ...
def _setup_regular_base(self, model: Any) -> None: ...
def _setup_regular_full(self, model: Any) -> None: ...
def update_db(self, model: Any, columns: Any) -> None: ...
def update_db_foreign_keys(self, model: Any) -> None: ...
def read(self, records: Any) -> None: ...
def write_real(self, records_commands_list: Any, create: bool = ...): ...
@@ -267,6 +451,10 @@ class Many2many(_RelationalMulti):
class Id(Field):
type: str = ...
column_type: Any = ...
string: str = ...
store: bool = ...
readonly: bool = ...
prefetch: bool = ...
def update_db(self, model: Any, columns: Any) -> None: ...
def __get__(self, record: Any, owner: Any): ...
def __set__(self, record: Any, value: Any) -> None: ...

View File

@@ -1,16 +1,19 @@
from typing import Any, Optional, Union
from werkzeug.contrib.sessions import Session
import werkzeug.wrappers
from .api import Environment
from .sql_db import Cursor
from .tools._vendor import sessions
from datetime import date as date
from odoo import fields as fields
from typing import Any, Optional
_logger: Any
rpc_request: Any
rpc_response: Any
STATIC_CACHE: Any
STATIC_CACHE_LONG: Any
ALLOWED_DEBUG_MODES: Any
_request_stack: Any
request: '__Request'
def replace_request_password(args: Any): ...
@@ -28,6 +31,11 @@ class WebRequest:
endpoint: Any = ...
endpoint_arguments: Any = ...
auth_method: Any = ...
_cr: Cursor = ...
_uid: int = ...
_context: dict = ...
_env: Environment = ...
_failed: Any = ...
def __init__(self, httprequest: Any) -> None: ...
@property
def cr(self) -> Cursor: ...
@@ -46,6 +54,8 @@ class WebRequest:
def __enter__(self): ...
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ...
def set_handler(self, endpoint: Any, arguments: Any, auth: Any) -> None: ...
def _handle_exception(self, exception: Any) -> None: ...
def _call_function(self, *args: Any, **kwargs: Any): ...
def registry_cr(self) -> None: ...
@property
def registry(self): ...
@@ -57,17 +67,22 @@ class WebRequest:
def route(route: Optional[Any] = ..., **kw: Any): ...
class JsonRequest(WebRequest):
_request_type: str = ...
params: Any = ...
jsonrequest: Any = ...
context: Any = ...
def __init__(self, *args: Any) -> None: ...
def _json_response(self, result: Optional[Any] = ..., error: Optional[Any] = ...): ...
def _handle_exception(self, exception: Any): ...
def dispatch(self): ...
def serialize_exception(e: Any): ...
class HttpRequest(WebRequest):
_request_type: str = ...
params: Any = ...
def __init__(self, *args: Any) -> None: ...
def _handle_exception(self, exception: Any): ...
def dispatch(self): ...
def make_response(self, data: Any, headers: Optional[Any] = ..., cookies: Optional[Any] = ...): ...
def render(self, template: Any, qcontext: Optional[Any] = ..., lazy: bool = ..., **kw: Any): ...
@@ -83,7 +98,7 @@ controllers_per_module: Any
class ControllerType(type):
def __init__(cls, name: Any, bases: Any, attrs: Any) -> None: ...
Controller: Any = ...
Controller: Any
class EndPoint:
method: Any = ...
@@ -95,10 +110,12 @@ class EndPoint:
def first_arg_is_req(self): ...
def __call__(self, *args: Any, **kw: Any): ...
def _generate_routing_rules(modules: Any, nodb_only: Any, converters: Optional[Any] = ...): ...
class AuthenticationError(Exception): ...
class SessionExpiredException(Exception): ...
class OpenERPSession(Session):
class OpenERPSession(sessions.Session):
inited: bool = ...
modified: bool = ...
rotate: bool = ...
@@ -112,8 +129,10 @@ class OpenERPSession(Session):
def authenticate(self, db: Any, login: Optional[Any] = ..., password: Optional[Any] = ..., uid: Optional[Any] = ...): ...
def check_security(self) -> None: ...
def logout(self, keep_db: bool = ...) -> None: ...
def _default_values(self) -> None: ...
context: Any = ...
def get_context(self): ...
def _fix_lang(self, context: Any) -> None: ...
def save_action(self, action: Any): ...
def get_action(self, key: Any): ...
def save_request_data(self) -> None: ...
@@ -139,6 +158,7 @@ class DisableCacheMiddleware:
def __call__(self, environ: Any, start_response: Any): ...
class Root:
_loaded: bool = ...
def __init__(self) -> None: ...
def session_store(self): ...
def nodb_routing_map(self): ...

15
odoo-stubs/loglevels.pyi Normal file
View File

@@ -0,0 +1,15 @@
from typing import Any
LOG_NOTSET: str
LOG_DEBUG: str
LOG_INFO: str
LOG_WARNING: str
LOG_ERROR: str
LOG_CRITICAL: str
def get_encodings(hint_encoding: str = ...) -> None: ...
text_type: Any
def ustr(value: Any, hint_encoding: str = ..., errors: str = ...): ...
def exception_to_unicode(e: Any): ...

View File

@@ -1,14 +1,14 @@
from collections import MutableMapping
from typing import Any, Optional, List, Union, Sequence, Tuple, Dict, Generator
from . import api, fields
from collections.abc import MutableMapping
from typing import Any, Optional, List, Generator
from .api import Environment
from .modules.registry import Registry
from .sql_db import Cursor
SearchDomain = List[Union[str, Sequence[str]]]
RecordValue = Dict[str, Any]
_logger: Any
_schema: Any
_unlink: Any
regex_order: Any
regex_object_name: Any
regex_pg_name: Any
@@ -28,15 +28,20 @@ def trigger_tree_merge(node1: Any, node2: Any) -> None: ...
class MetaModel(api.Meta):
module_to_models: Any = ...
def __new__(meta: Any, name: Any, bases: Any, attrs: Any): ...
_register: bool = ...
_module: Any = ...
def __init__(self, name: Any, bases: Any, attrs: Any) -> None: ...
class NewId:
__slots__: Any = ...
origin: Any = ...
ref: Any = ...
def __init__(self, origin: Optional[Any] = ..., ref: Optional[Any] = ...) -> None: ...
def __bool__(self): ...
def __eq__(self, other: Any) -> Any: ...
def __hash__(self) -> Any: ...
def __repr__(self): ...
def origin_ids(ids: Any): ...
@@ -47,17 +52,31 @@ MAGIC_COLUMNS: Any
VALID_AGGREGATE_FUNCTIONS: Any
class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
_name: str
_description: str
_sql_constraints: List
_inherit: List[str]
_inherits: Dict[str, str]
_rec_name: str
_order: str
_fields: Dict[str, fields.Field]
_context: Dict
_cr: Cursor
_uid: int
__slots__: Any = ...
_auto: bool = ...
_register: bool = ...
_abstract: bool = ...
_transient: bool = ...
_name: str = ...
_description: str = ...
_custom: bool = ...
_inherit: Any = ...
_inherits: Any = ...
_table: Any = ...
_sequence: Any = ...
_sql_constraints: Any = ...
_rec_name: Any = ...
_order: str = ...
_parent_name: str = ...
_parent_store: bool = ...
_active_name: Any = ...
_date_name: str = ...
_fold_name: str = ...
_needaction: bool = ...
_translate: bool = ...
_check_company_auto: bool = ...
_transient_max_count: Any = ...
_transient_max_hours: Any = ...
env: Environment = ...
pool: Registry
id = fields.Id()
@@ -68,70 +87,179 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
write_date = fields.Datetime()
CONCURRENCY_CHECK_FIELD: str = ...
def view_init(self, fields_list: Any) -> None: ...
def _valid_field_parameter(self, field: Any, name: Any): ...
def _add_field(self, name: Any, field: Any) -> None: ...
def _pop_field(self, name: Any): ...
def _add_magic_fields(self) -> None: ...
def compute_concurrency_field(self) -> None: ...
def compute_concurrency_field_with_access(self) -> None: ...
@classmethod
def _build_model(cls, pool: Any, cr: Any): ...
@classmethod
def _build_model_check_base(model_class: Any, cls: Any) -> None: ...
@classmethod
def _build_model_check_parent(model_class: Any, cls: Any, parent_class: Any) -> None: ...
@classmethod
def _build_model_attributes(cls, pool: Any) -> None: ...
@classmethod
def _init_constraints_onchanges(cls) -> None: ...
@property
def _constraint_methods(self): ...
@property
def _onchange_methods(self): ...
def __new__(cls) -> BaseModel: ...
def __init__(self, pool: Any, cr: Any) -> None: ...
def _is_an_ordinary_table(self): ...
def __ensure_xml_id(self, skip: bool = ...): ...
def _export_rows(self, fields: Any, *, _is_toplevel_call: bool = ...): ...
__export_rows: Any = ...
def export_data(self, fields_to_export: Any): ...
def load(self, fields: Any, data: Any): ...
def default_get(self, fields_list: List[str]) -> Dict[str, Any]: ...
def _add_fake_fields(self, fields: Any): ...
def _extract_records(self, fields_: Any, data: Any, log: Any = ..., limit: Any = ...): ...
def _convert_records(self, records: Any, log: Any = ...) -> None: ...
def _validate_fields(self, field_names: Any) -> None: ...
def default_get(self, fields_list: Any): ...
def fields_get_keys(self): ...
def _rec_name_fallback(self): ...
def view_header_get(self, view_id: Optional[Any] = ..., view_type: str = ...): ...
def user_has_groups(self, groups: Any): ...
def _get_default_form_view(self): ...
def _get_default_search_view(self): ...
def _get_default_tree_view(self): ...
def _get_default_pivot_view(self): ...
def _get_default_kanban_view(self): ...
def _get_default_graph_view(self): ...
def _get_default_calendar_view(self): ...
def load_views(self, views: Any, options: Optional[Any] = ...): ...
def _fields_view_get(self, view_id: Optional[Any] = ..., view_type: str = ..., toolbar: bool = ..., submenu: bool = ...): ...
def fields_view_get(self, view_id: Optional[Any] = ..., view_type: str = ..., toolbar: bool = ..., submenu: bool = ...): ...
def get_formview_id(self, access_uid: Optional[Any] = ...): ...
def get_formview_action(self, access_uid: Optional[Any] = ...): ...
def get_access_action(self, access_uid: Optional[Any] = ...): ...
def search_count(self, args: Any) -> int: ...
def search(self, args: SearchDomain, offset: int = ..., limit: Optional[int] = ..., order: Optional[str] = ..., count: bool = ...) -> BaseModel: ...
def name_get(self) -> List[Tuple[int, str]]: ...
def search(self, args: Any, offset: int = ..., limit: Optional[Any] = ..., order: Optional[Any] = ..., count: bool = ...) -> BaseModel: ...
def _compute_display_name(self) -> None: ...
def name_get(self): ...
def name_create(self, name: Any): ...
def name_search(self, name: str = ..., args: Optional[Any] = ..., operator: str = ..., limit: int = ...): ...
def _name_search(self, name: str = ..., args: Optional[Any] = ..., operator: str = ..., limit: int = ..., name_get_uid: Optional[Any] = ...): ...
def _add_missing_default_values(self, values: Any): ...
@classmethod
def clear_caches(cls) -> None: ...
def read_group(self, domain: Any, fields: Any, groupby: Any, offset: int = ..., limit: Optional[Any] = ..., orderby: bool = ..., lazy: bool = ...) -> List[Dict]: ...
def _read_group_expand_full(self, groups: Any, domain: Any, order: Any): ...
def _read_group_fill_results(self, domain: Any, groupby: Any, remaining_groupbys: Any, aggregated_fields: Any, count_field: Any, read_group_result: Any, read_group_order: Optional[Any] = ...): ...
def _read_group_fill_temporal(self, data: Any, groupby: Any, aggregated_fields: Any, annotated_groupbys: Any, interval: Any = ...): ...
def _read_group_prepare(self, orderby: Any, aggregated_fields: Any, annotated_groupbys: Any, query: Any): ...
def _read_group_process_groupby(self, gb: Any, query: Any): ...
def _read_group_prepare_data(self, key: Any, value: Any, groupby_dict: Any): ...
def _read_group_format_result(self, data: Any, annotated_groupbys: Any, groupby: Any, domain: Any): ...
def read_group(self, domain: Any, fields: Any, groupby: Any, offset: int = ..., limit: Optional[Any] = ..., orderby: bool = ..., lazy: bool = ...): ...
def _read_group_raw(self, domain: Any, fields: Any, groupby: Any, offset: int = ..., limit: Optional[Any] = ..., orderby: bool = ..., lazy: bool = ...): ...
def _read_group_resolve_many2one_fields(self, data: Any, fields: Any) -> None: ...
def _inherits_join_add(self, current_model: Any, parent_model_name: Any, query: Any): ...
def _inherits_join_calc(self, alias: Any, fname: Any, query: Any, implicit: bool = ..., outer: bool = ...): ...
def _parent_store_compute(self): ...
def _check_removed_columns(self, log: bool = ...) -> None: ...
def _init_column(self, column_name: Any) -> None: ...
def _table_has_rows(self): ...
def _auto_init(self): ...
def init(self) -> None: ...
def _create_parent_columns(self) -> None: ...
def _add_sql_constraints(self) -> None: ...
def _execute_sql(self) -> None: ...
def _add_inherited_fields(self) -> None: ...
def _inherits_check(self) -> None: ...
def _prepare_setup(self) -> None: ...
def _setup_base(self): ...
def _setup_fields(self) -> None: ...
def _setup_complete(self) -> None: ...
def fields_get(self, allfields: Optional[Any] = ..., attributes: Optional[Any] = ...): ...
def get_empty_list_help(self, help: Any): ...
def check_field_access_rights(self, operation: Any, fields: Any): ...
def read(self, fields: Optional[List[str]] = ..., load: str = ...) -> List[Dict[str, Any]]: ...
def read(self, fields: Optional[Any] = ..., load: str = ...): ...
def _read_format(self, fnames: Any, load: str = ...): ...
def _fetch_field(self, field: Any) -> None: ...
def _read(self, fields: Any): ...
def get_metadata(self): ...
def get_base_url(self): ...
def _check_concurrency(self) -> None: ...
def _check_company(self, fnames: Optional[Any] = ...) -> None: ...
def check_access_rights(self, operation: Any, raise_exception: bool = ...): ...
def check_access_rule(self, operation: Any) -> None: ...
def _filter_access_rules(self, operation: Any): ...
def _filter_access_rules_python(self, operation: Any): ...
def unlink(self): ...
def write(self, vals: RecordValue): ...
def create(self, vals_list: Union[RecordValue, List[RecordValue]]) -> BaseModel: ...
def write(self, vals: Any): ...
def _write(self, vals: Any): ...
def create(self, vals_list: Any) -> BaseModel: ...
def _create(self, data_list: Any): ...
def _compute_field_value(self, field: Any) -> None: ...
def _parent_store_create(self) -> None: ...
def _parent_store_update_prepare(self, vals: Any): ...
def _parent_store_update(self) -> None: ...
def _load_records_write(self, values: Any) -> None: ...
def _load_records_create(self, values: Any): ...
def _load_records(self, data_list: Any, update: bool = ...): ...
def _where_calc(self, domain: Any, active_test: bool = ...): ...
def _check_qorder(self, word: Any): ...
def _apply_ir_rules(self, query: Any, mode: str = ...) -> None: ...
def _generate_translated_field(self, table_alias: Any, field: Any, query: Any): ...
def _generate_m2o_order_by(self, alias: Any, order_field: Any, query: Any, reverse_direction: Any, seen: Any): ...
def _generate_order_by_inner(self, alias: Any, order_spec: Any, query: Any, reverse_direction: bool = ..., seen: Optional[Any] = ...): ...
def _generate_order_by(self, order_spec: Any, query: Any): ...
def _flush_search(self, domain: Any, fields: Optional[Any] = ..., order: Optional[Any] = ..., seen: Optional[Any] = ...) -> None: ...
def _search(self, args: Any, offset: int = ..., limit: Optional[Any] = ..., order: Optional[Any] = ..., count: bool = ..., access_rights_uid: Optional[Any] = ...): ...
def copy_data(self, default: Optional[Any] = ...): ...
def copy_translations(old: Any, new: Any, excluded: Any = ...): ...
def copy(self, default: Optional[Any] = ...) -> BaseModel: ...
def exists(self) -> BaseModel: ...
def get_external_id(self) -> Dict[int, str]: ...
def _check_recursion(self, parent: Optional[Any] = ...): ...
def _check_m2m_recursion(self, field_name: Any): ...
def _get_external_ids(self): ...
def get_external_id(self): ...
get_xml_id: Any = ...
_get_xml_ids: Any = ...
@classmethod
def is_transient(cls): ...
def resolve_2many_commands(self, field_name: Any, commands: Any, fields: Optional[Any] = ...): ...
resolve_o2m_commands_to_record_dicts: Any = ...
def search_read(self, domain: Optional[Any] = ..., fields: Optional[Any] = ..., offset: int = ..., limit: Optional[Any] = ..., order: Optional[Any] = ...): ...
def toggle_active(self) -> None: ...
def action_archive(self): ...
def action_unarchive(self): ...
def browse(self, arg: Optional[Any] = ..., prefetch: Optional[Any] = ...) -> BaseModel: ...
def _register_hook(self) -> None: ...
@classmethod
def _patch_method(cls, name: Any, method: Any) -> None: ...
@classmethod
def _revert_method(cls, name: Any) -> None: ...
@classmethod
def _browse(cls, env: Any, ids: Any, prefetch_ids: Any): ...
def browse(self, ids: Optional[Any] = ...) -> BaseModel: ...
@property
def ids(self) -> List[int]: ...
_cr: Cursor = ...
_uid: int = ...
_context: dict = ...
def ensure_one(self): ...
def with_env(self, env: Any) -> BaseModel: ...
def sudo(self, flag: bool = ...) -> BaseModel: ...
def with_user(self, user: Any): ...
def with_user(self, user: Any) -> BaseModel: ...
def with_company(self, company: 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: ...
def filtered_domain(self, domain: Any): ...
def sorted(self, key: Optional[Any] = ..., reverse: bool = ...) -> BaseModel: ...
def update(self, values: RecordValue) -> None: ...
def update(self, values: Any) -> None: ...
def flush(self, fnames: Optional[Any] = ..., records: Optional[Any] = ...) -> None: ...
def new(self, values: RecordValue = ..., origin: Optional[Any] = ..., ref: Optional[Any] = ...) -> BaseModel: ...
def new(self, values: Any = ..., origin: Optional[Any] = ..., ref: Optional[Any] = ...) -> BaseModel: ...
@property
def _origin(self): ...
def __bool__(self) -> bool: ...
__nonzero__: Any = ...
def __len__(self) -> int: ...
@@ -149,16 +277,34 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
def __gt__(self, other: Any) -> bool: ...
def __ge__(self, other: Any) -> bool: ...
def __int__(self): ...
def __repr__(self): ...
def __hash__(self) -> Any: ...
def __getitem__(self, key: Any): ...
def __setitem__(self, key: Any, value: Any): ...
@property
def _cache(self): ...
def _in_cache_without(self, field: Any, limit: Any = ...): ...
def refresh(self) -> None: ...
def invalidate_cache(self, fnames: Optional[Any] = ..., ids: Optional[Any] = ...): ...
def modified(self, fnames: Any, create: bool = ...) -> None: ...
def _modified_triggers(self, tree: Any, create: bool = ...): ...
def recompute(self, fnames: Optional[Any] = ..., records: Optional[Any] = ...) -> None: ...
def _dependent_fields(self, field: Any): ...
def _has_onchange(self, field: Any, other_fields: Any): ...
def _onchange_spec(self, view_info: Optional[Any] = ...): ...
def _onchange_eval(self, field_name: Any, onchange: Any, result: Any) -> None: ...
def onchange(self, values: Any, field_name: Any, field_onchange: Any): ...
def _get_placeholder_filename(self, field: Optional[Any] = ...): ...
def _populate_factories(self): ...
@property
def _populate_sizes(self): ...
@property
def _populate_dependencies(self): ...
def _populate(self, size: Any): ...
class RecordCache(MutableMapping):
__slots__: Any = ...
_record: Any = ...
def __init__(self, record: Any) -> None: ...
def __contains__(self, name: Any): ...
def __getitem__(self, name: Any): ...
@@ -168,8 +314,20 @@ class RecordCache(MutableMapping):
def __len__(self): ...
AbstractModel = BaseModel
class Model(AbstractModel): ...
class TransientModel(Model): ...
class Model(AbstractModel):
_auto: bool = ...
_register: bool = ...
_abstract: bool = ...
_transient: bool = ...
class TransientModel(Model):
_auto: bool = ...
_register: bool = ...
_abstract: bool = ...
_transient: bool = ...
def _transient_vacuum(self) -> None: ...
def _transient_clean_old_rows(self, max_count: Any) -> None: ...
def _transient_clean_rows_older_than(self, seconds: Any) -> None: ...
def itemgetter_tuple(items: Any): ...
def convert_pgerror_not_null(model: Any, fields: Any, info: Any, e: Any): ...

View File

@@ -0,0 +1,3 @@
from . import db as db, graph as graph, loading as loading, migration as migration, module as module, registry as registry
from odoo.modules.loading import load_modules as load_modules, reset_modules_state as reset_modules_state
from odoo.modules.module import adapt_version as adapt_version, get_module_path as get_module_path, get_module_resource as get_module_resource, get_modules as get_modules, get_modules_with_version as get_modules_with_version, get_resource_from_path as get_resource_from_path, get_resource_path as get_resource_path, initialize_sys_path as initialize_sys_path, load_information_from_description_file as load_information_from_description_file, load_openerp_module as load_openerp_module

View File

@@ -0,0 +1,8 @@
from typing import Any
_logger: Any
def is_initialized(cr: Any): ...
def initialize(cr: Any) -> None: ...
def create_categories(cr: Any, categories: Any): ...
def has_unaccent(cr: Any): ...

View File

@@ -0,0 +1,30 @@
from typing import Any, Optional
_logger: Any
class Graph(dict):
def add_node(self, name: Any, info: Any): ...
def update_from_db(self, cr: Any) -> None: ...
def add_module(self, cr: Any, module: Any, force: Optional[Any] = ...) -> None: ...
def add_modules(self, cr: Any, module_list: Any, force: Optional[Any] = ...): ...
def __iter__(self) -> Any: ...
def __str__(self): ...
class Node:
def __new__(cls, name: Any, graph: Any, info: Any): ...
name: Any = ...
graph: Any = ...
info: Any = ...
children: Any = ...
depth: int = ...
def __init__(self, name: Any, graph: Any, info: Any) -> None: ...
@property
def data(self): ...
def add_child(self, name: Any, info: Any): ...
def __setattr__(self, name: Any, value: Any) -> None: ...
def __iter__(self) -> Any: ...
def __str__(self): ...
def _pprint(self, depth: int = ...): ...
def should_have_demo(self): ...
@property
def parents(self): ...

View File

@@ -0,0 +1,13 @@
from typing import Any, Optional
_logger: Any
_test_logger: Any
def load_data(cr: Any, idref: Any, mode: Any, kind: Any, package: Any, report: Any): ...
def load_demo(cr: Any, package: Any, idref: Any, mode: Any, report: Optional[Any] = ...): ...
def force_demo(cr: Any) -> None: ...
def load_module_graph(cr: Any, graph: Any, status: Optional[Any] = ..., perform_checks: bool = ..., skip_modules: Optional[Any] = ..., report: Optional[Any] = ..., models_to_check: Optional[Any] = ...): ...
def _check_module_names(cr: Any, module_names: Any) -> None: ...
def load_marked_modules(cr: Any, graph: Any, states: Any, force: Any, progressdict: Any, report: Any, loaded_modules: Any, perform_checks: Any, models_to_check: Optional[Any] = ...): ...
def load_modules(db: Any, force_demo: bool = ..., status: Optional[Any] = ..., update_module: bool = ...): ...
def reset_modules_state(db_name: Any) -> None: ...

View File

@@ -0,0 +1,13 @@
from typing import Any
_logger: Any
def load_script(path: Any, module_name: Any): ...
class MigrationManager:
cr: Any = ...
graph: Any = ...
migrations: Any = ...
def __init__(self, cr: Any, graph: Any) -> None: ...
def _get_files(self): ...
def migrate_module(self, pkg: Any, stage: Any): ...

View File

@@ -0,0 +1,56 @@
import unittest
from typing import Any, Optional
MANIFEST_NAMES: Any
README: Any
_logger: Any
def ad_paths(): ...
loaded: Any
class AddonsHook:
def find_module(self, name: Any, path: Optional[Any] = ...): ...
def load_module(self, name: Any): ...
class OdooHook:
def find_module(self, name: Any, path: Optional[Any] = ...): ...
def load_module(self, name: Any): ...
def initialize_sys_path() -> None: ...
def get_module_path(module: Any, downloaded: bool = ..., display_warning: bool = ...): ...
def get_module_filetree(module: Any, dir: str = ...): ...
def get_resource_path(module: Any, *args: Any): ...
get_module_resource = get_resource_path
def get_resource_from_path(path: Any): ...
def get_module_icon(module: Any): ...
def module_manifest(path: Any): ...
def get_module_root(path: Any): ...
def load_information_from_description_file(module: Any, mod_path: Optional[Any] = ...): ...
def load_openerp_module(module_name: Any) -> None: ...
def get_modules(): ...
def get_modules_with_version(): ...
def adapt_version(version: Any): ...
def get_test_modules(module: Any): ...
def _get_tests_modules(path: Any, module: Any): ...
class OdooTestResult(unittest.result.TestResult):
def log(self, level: Any, msg: Any, *args: Any, test: Optional[Any] = ..., exc_info: Optional[Any] = ..., extra: Optional[Any] = ..., stack_info: bool = ..., caller_infos: Optional[Any] = ...) -> None: ...
def getDescription(self, test: Any): ...
def startTest(self, test: Any) -> None: ...
def addError(self, test: Any, err: Any) -> None: ...
def addFailure(self, test: Any, err: Any) -> None: ...
def addSubTest(self, test: Any, subtest: Any, err: Any) -> None: ...
def addSkip(self, test: Any, reason: Any) -> None: ...
def addUnexpectedSuccess(self, test: Any) -> None: ...
def logError(self, flavour: Any, test: Any, error: Any) -> None: ...
def getErrorCallerInfo(self, error: Any, test: Any): ...
class OdooTestRunner:
def run(self, test: Any): ...
current_test: Any
def run_unit_tests(module_name: Any, position: str = ...): ...
def unwrap_suite(test: Any) -> None: ...

View File

@@ -0,0 +1,82 @@
from collections.abc import Mapping
from typing import Any, Optional
_logger: Any
_schema: Any
class Registry(Mapping):
_lock: Any = ...
_saved_lock: Any = ...
model_cache: Any = ...
def registries(cls): ...
def __new__(cls, db_name: Any): ...
@classmethod
def new(cls, db_name: Any, force_demo: bool = ..., status: Optional[Any] = ..., update_module: bool = ...): ...
models: Any = ...
_sql_constraints: Any = ...
_init: bool = ...
_assertion_report: Any = ...
_fields_by_model: Any = ...
_ordinary_tables: Any = ...
_constraint_queue: Any = ...
_init_modules: Any = ...
updated_modules: Any = ...
loaded_xmlids: Any = ...
db_name: Any = ...
_db: Any = ...
test_cr: Any = ...
test_lock: Any = ...
loaded: bool = ...
ready: bool = ...
registry_sequence: Any = ...
cache_sequence: Any = ...
registry_invalidated: bool = ...
cache_invalidated: bool = ...
has_unaccent: Any = ...
def init(self, db_name: Any) -> None: ...
@classmethod
def delete(cls, db_name: Any) -> None: ...
@classmethod
def delete_all(cls) -> None: ...
def __len__(self): ...
def __iter__(self) -> Any: ...
def __getitem__(self, model_name: Any): ...
def __call__(self, model_name: Any): ...
def __setitem__(self, model_name: Any, model: Any) -> None: ...
def __delitem__(self, model_name: Any) -> None: ...
def descendants(self, model_names: Any, *kinds: Any): ...
def load(self, cr: Any, module: Any): ...
_m2m: Any = ...
def setup_models(self, cr: Any) -> None: ...
def field_computed(self): ...
def field_triggers(self): ...
def post_init(self, func: Any, *args: Any, **kwargs: Any) -> None: ...
def post_constraint(self, func: Any, *args: Any, **kwargs: Any) -> None: ...
def finalize_constraints(self) -> None: ...
_post_init_queue: Any = ...
_foreign_keys: Any = ...
_is_install: Any = ...
def init_models(self, cr: Any, model_names: Any, context: Any, install: bool = ...) -> None: ...
def check_indexes(self, cr: Any, model_names: Any) -> None: ...
def add_foreign_key(self, table1: Any, column1: Any, table2: Any, column2: Any, ondelete: Any, model: Any, module: Any, force: bool = ...) -> None: ...
def check_foreign_keys(self, cr: Any) -> None: ...
def check_tables_exist(self, cr: Any) -> None: ...
def cache(self): ...
def _clear_cache(self) -> None: ...
def clear_caches(self) -> None: ...
def is_an_ordinary_table(self, model: Any): ...
def setup_signaling(self) -> None: ...
def check_signaling(self): ...
def signal_changes(self) -> None: ...
def reset_changes(self) -> None: ...
def manage_changes(self) -> None: ...
def in_test_mode(self): ...
def enter_test_mode(self, cr: Any) -> None: ...
def leave_test_mode(self) -> None: ...
def cursor(self): ...
class DummyRLock:
def acquire(self) -> None: ...
def release(self) -> None: ...
def __enter__(self) -> None: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...

47
odoo-stubs/netsvc.pyi Normal file
View File

@@ -0,0 +1,47 @@
import logging.handlers
from typing import Any, Optional
_logger: Any
def log(logger: Any, level: Any, prefix: Any, msg: Any, depth: Optional[Any] = ...) -> None: ...
class PostgreSQLHandler(logging.Handler):
def emit(self, record: Any) -> None: ...
BLACK: Any
RED: Any
GREEN: Any
YELLOW: Any
BLUE: Any
MAGENTA: Any
CYAN: Any
WHITE: Any
_NOTHING: Any
DEFAULT: Any
RESET_SEQ: str
COLOR_SEQ: str
BOLD_SEQ: str
COLOR_PATTERN: Any
LEVEL_COLOR_MAPPING: Any
class PerfFilter(logging.Filter):
def format_perf(self, query_count: Any, query_time: Any, remaining_time: Any): ...
def filter(self, record: Any): ...
class ColoredPerfFilter(PerfFilter):
def format_perf(self, query_count: Any, query_time: Any, remaining_time: Any): ...
class DBFormatter(logging.Formatter):
def format(self, record: Any): ...
class ColoredFormatter(DBFormatter):
def format(self, record: Any): ...
_logger_init: bool
def init_logger(): ...
DEFAULT_LOG_CONFIGURATION: Any
PSEUDOCONFIG_MAPPER: Any
def runbot(self, message: Any, *args: Any, **kws: Any) -> None: ...

View File

@@ -0,0 +1 @@
from . import osv as osv

View File

@@ -0,0 +1,47 @@
from ..models import MAGIC_COLUMNS as MAGIC_COLUMNS
from functools import partial as partial
from odoo.tools.misc import get_lang as get_lang
from typing import Any, Optional
NOT_OPERATOR: str
OR_OPERATOR: str
AND_OPERATOR: str
DOMAIN_OPERATORS: Any
TERM_OPERATORS: Any
NEGATIVE_TERM_OPERATORS: Any
DOMAIN_OPERATORS_NEGATION: Any
TERM_OPERATORS_NEGATION: Any
TRUE_LEAF: Any
FALSE_LEAF: Any
TRUE_DOMAIN: Any
FALSE_DOMAIN: Any
_logger: Any
def normalize_domain(domain: Any): ...
def is_false(model: Any, domain: Any): ...
def combine(operator: Any, unit: Any, zero: Any, domains: Any): ...
def AND(domains: Any): ...
def OR(domains: Any): ...
def distribute_not(domain: Any): ...
def _quote(to_quote: 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): ...
def is_operator(element: Any): ...
def is_leaf(element: Any, internal: bool = ...): ...
def is_boolean(element: Any): ...
def check_leaf(element: Any, internal: bool = ...) -> None: ...
def select_from_where(cr: Any, select_field: Any, from_table: Any, where_field: Any, where_ids: Any, where_operator: Any): ...
def get_unaccent_wrapper(cr: Any): ...
class expression:
_unaccent: Any = ...
root_model: Any = ...
root_alias: Any = ...
expression: Any = ...
query: Any = ...
def __init__(self, domain: Any, model: Any, alias: Optional[Any] = ..., query: Optional[Any] = ...) -> None: ...
def get_tables(self): ...
def parse(self): ...
def __leaf_to_sql(self, leaf: Any, model: Any, alias: Any): ...
def to_sql(self): ...

7
odoo-stubs/osv/osv.pyi Normal file
View File

@@ -0,0 +1,7 @@
from ..exceptions import UserError
from ..models import AbstractModel, Model, TransientModel
except_osv = UserError
osv = Model
osv_memory = TransientModel
osv_abstract = AbstractModel

19
odoo-stubs/osv/query.pyi Normal file
View File

@@ -0,0 +1,19 @@
from typing import Any, Optional
def _quote(to_quote: Any): ...
class Query:
_tables: Any = ...
where_clause: Any = ...
where_clause_params: Any = ...
joins: Any = ...
extras: Any = ...
def __init__(self, tables: Optional[Any] = ..., where_clause: Optional[Any] = ..., where_clause_params: Optional[Any] = ..., joins: Optional[Any] = ..., extras: Optional[Any] = ...) -> None: ...
def add_table(self, table: Any) -> None: ...
@property
def tables(self): ...
def _get_table_aliases(self): ...
def _get_alias_mapping(self): ...
def add_join(self, connection: Any, implicit: bool = ..., outer: bool = ..., extra: Optional[Any] = ..., extra_params: Any = ...): ...
def get_sql(self): ...
def __str__(self): ...

22
odoo-stubs/release.pyi Normal file
View File

@@ -0,0 +1,22 @@
from typing import Any
RELEASE_LEVELS: Any
ALPHA: Any
BETA: Any
RELEASE_CANDIDATE: Any
FINAL: Any
RELEASE_LEVELS_DISPLAY: Any
version_info: Any
version: Any
series: Any
serie: Any
major_version: Any
product_name: str
description: str
long_desc: str
classifiers: str
url: str
author: str
author_email: str
license: str
nt_service_name: Any

View File

@@ -0,0 +1 @@
from . import common as common, db as db, model as model, server as server, wsgi_server as wsgi_server

View File

@@ -0,0 +1,11 @@
from typing import Any, Optional
_logger: Any
RPC_VERSION_1: Any
def exp_login(db: Any, login: Any, password: Any): ...
def exp_authenticate(db: Any, login: Any, password: Any, user_agent_env: Any): ...
def exp_version(): ...
def exp_about(extended: bool = ...): ...
def exp_set_loglevel(loglevel: Any, logger: Optional[Any] = ...): ...
def dispatch(method: Any, params: Any): ...

31
odoo-stubs/service/db.pyi Normal file
View File

@@ -0,0 +1,31 @@
from functools import wraps as wraps
from typing import Any, Optional
_logger: Any
class DatabaseExists(Warning): ...
def check_db_management_enabled(method: Any): ...
def check_super(passwd: Any): ...
def _initialize_db(id: Any, db_name: Any, demo: Any, lang: Any, user_password: Any, login: str = ..., country_code: Optional[Any] = ..., phone: Optional[Any] = ...) -> None: ...
def _create_empty_database(name: Any) -> None: ...
def exp_create_database(db_name: Any, demo: Any, lang: Any, user_password: str = ..., login: str = ..., country_code: Optional[Any] = ..., phone: Optional[Any] = ...): ...
def exp_duplicate_database(db_original_name: Any, db_name: Any): ...
def _drop_conn(cr: Any, db_name: Any) -> None: ...
def exp_drop(db_name: Any): ...
def exp_dump(db_name: Any, format: Any): ...
def dump_db_manifest(cr: Any): ...
def dump_db(db_name: Any, stream: Any, backup_format: str = ...): ...
def exp_restore(db_name: Any, data: Any, copy: bool = ...): ...
def restore_db(db: Any, dump_file: Any, copy: bool = ...) -> None: ...
def exp_rename(old_name: Any, new_name: Any): ...
def exp_change_admin_password(new_password: Any): ...
def exp_migrate_databases(databases: Any): ...
def exp_db_exist(db_name: Any): ...
def list_dbs(force: bool = ...): ...
def list_db_incompatible(databases: Any): ...
def exp_list(document: bool = ...): ...
def exp_list_lang(): ...
def exp_list_countries(): ...
def exp_server_version(): ...
def dispatch(method: Any, params: Any): ...

View File

@@ -0,0 +1,11 @@
from typing import Any, Optional
_logger: Any
PG_CONCURRENCY_ERRORS_TO_RETRY: Any
MAX_TRIES_ON_CONCURRENCY_FAILURE: int
def dispatch(method: Any, params: Any): ...
def check(f: Any): ...
def execute_cr(cr: Any, uid: Any, obj: Any, method: Any, *args: Any, **kw: Any): ...
def execute_kw(db: Any, uid: Any, obj: Any, method: Any, args: Any, kw: Optional[Any] = ...): ...
def execute(db: Any, uid: Any, obj: Any, method: Any, *args: Any, **kw: Any): ...

View File

@@ -0,0 +1,6 @@
from typing import Any
def login(db: Any, login: Any, password: Any): ...
def check(db: Any, uid: Any, passwd: Any): ...
def compute_session_token(session: Any, env: Any): ...
def check_session(session: Any, env: Any): ...

View File

@@ -0,0 +1,175 @@
import werkzeug.serving
from typing import Any, Optional
INOTIFY_LISTEN_EVENTS: Any
_logger: Any
SLEEP_INTERVAL: int
def memory_info(process: Any): ...
def set_limit_memory_hard() -> None: ...
def empty_pipe(fd: Any) -> None: ...
class LoggingBaseWSGIServerMixIn:
def handle_error(self, request: Any, client_address: Any) -> None: ...
class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGIServer):
def __init__(self, app: Any) -> None: ...
def server_activate(self) -> None: ...
class RequestHandler(werkzeug.serving.WSGIRequestHandler):
timeout: int = ...
def setup(self) -> None: ...
class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer):
max_http_threads: Any = ...
http_threads_sem: Any = ...
daemon_threads: bool = ...
def __init__(self, host: Any, port: Any, app: Any) -> None: ...
reload_socket: bool = ...
socket: Any = ...
def server_bind(self) -> None: ...
def server_activate(self) -> None: ...
def process_request(self, request: Any, client_address: Any) -> None: ...
def _handle_request_noblock(self) -> None: ...
def shutdown_request(self, request: Any) -> None: ...
class FSWatcherBase:
def handle_file(self, path: Any): ...
class FSWatcherWatchdog(FSWatcherBase):
observer: Any = ...
def __init__(self) -> None: ...
def dispatch(self, event: Any) -> None: ...
def start(self) -> None: ...
def stop(self) -> None: ...
class FSWatcherInotify(FSWatcherBase):
started: bool = ...
watcher: Any = ...
def __init__(self) -> None: ...
def run(self) -> None: ...
thread: Any = ...
def start(self) -> None: ...
def stop(self) -> None: ...
class CommonServer:
app: Any = ...
interface: Any = ...
port: Any = ...
pid: Any = ...
def __init__(self, app: Any) -> None: ...
def close_socket(self, sock: Any) -> None: ...
class ThreadedServer(CommonServer):
main_thread_id: Any = ...
quit_signals_received: int = ...
httpd: Any = ...
limits_reached_threads: Any = ...
limit_reached_time: Any = ...
def __init__(self, app: Any) -> None: ...
def signal_handler(self, sig: Any, frame: Any) -> None: ...
def process_limit(self) -> None: ...
def cron_thread(self, number: Any) -> None: ...
def cron_spawn(self) -> None: ...
def http_thread(self): ...
def http_spawn(self) -> None: ...
def start(self, stop: bool = ...): ...
def stop(self) -> None: ...
def run(self, preload: Optional[Any] = ..., stop: bool = ...): ...
def reload(self) -> None: ...
class GeventServer(CommonServer):
port: Any = ...
httpd: Any = ...
def __init__(self, app: Any) -> None: ...
def process_limits(self) -> None: ...
ppid: Any = ...
def watchdog(self, beat: int = ...) -> None: ...
client_address: Any = ...
def start(self): ...
def stop(self) -> None: ...
def run(self, preload: Any, stop: Any) -> None: ...
class PreforkServer(CommonServer):
address: Any = ...
population: Any = ...
timeout: Any = ...
limit_request: Any = ...
cron_timeout: Any = ...
beat: int = ...
app: Any = ...
pid: Any = ...
socket: Any = ...
workers_http: Any = ...
workers_cron: Any = ...
workers: Any = ...
generation: int = ...
queue: Any = ...
long_polling_pid: Any = ...
def __init__(self, app: Any) -> None: ...
def pipe_new(self): ...
def pipe_ping(self, pipe: Any) -> None: ...
def signal_handler(self, sig: Any, frame: Any) -> None: ...
def worker_spawn(self, klass: Any, workers_registry: Any): ...
def long_polling_spawn(self) -> None: ...
def worker_pop(self, pid: Any) -> None: ...
def worker_kill(self, pid: Any, sig: Any) -> None: ...
def process_signals(self) -> None: ...
def process_zombie(self) -> None: ...
def process_timeout(self) -> None: ...
def process_spawn(self) -> None: ...
def sleep(self) -> None: ...
pipe: Any = ...
def start(self) -> None: ...
def stop(self, graceful: bool = ...) -> None: ...
def run(self, preload: Any, stop: Any): ...
class Worker:
multi: Any = ...
watchdog_time: Any = ...
watchdog_pipe: Any = ...
eintr_pipe: Any = ...
watchdog_timeout: Any = ...
ppid: Any = ...
pid: Any = ...
alive: bool = ...
request_max: Any = ...
request_count: int = ...
def __init__(self, multi: Any) -> None: ...
def setproctitle(self, title: str = ...) -> None: ...
def close(self) -> None: ...
def signal_handler(self, sig: Any, frame: Any) -> None: ...
def signal_time_expired_handler(self, n: Any, stack: Any) -> None: ...
def sleep(self) -> None: ...
def check_limits(self) -> None: ...
def process_work(self) -> None: ...
def start(self) -> None: ...
def stop(self) -> None: ...
def run(self) -> None: ...
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 = ...
def start(self) -> None: ...
class WorkerCron(Worker):
db_index: int = ...
watchdog_timeout: Any = ...
def __init__(self, multi: Any) -> None: ...
def sleep(self) -> None: ...
def _db_list(self): ...
def process_work(self) -> None: ...
def start(self) -> None: ...
server: Any
def load_server_wide_modules() -> None: ...
def _reexec(updated_modules: Optional[Any] = ...) -> None: ...
def load_test_file_py(registry: Any, test_file: Any) -> None: ...
def preload_registries(dbnames: Any): ...
def start(preload: Optional[Any] = ..., stop: bool = ...): ...
def restart() -> None: ...

View File

@@ -0,0 +1,17 @@
from typing import Any
_logger: Any
RPC_FAULT_CODE_CLIENT_ERROR: int
RPC_FAULT_CODE_APPLICATION_ERROR: int
RPC_FAULT_CODE_WARNING: int
RPC_FAULT_CODE_ACCESS_DENIED: int
RPC_FAULT_CODE_ACCESS_ERROR: int
def xmlrpc_handle_exception_int(e: Any): ...
def xmlrpc_handle_exception_string(e: Any): ...
def _patch_xmlrpc_marshaller() -> None: ...
def application_unproxied(environ: Any, start_response: Any): ...
ProxyFix: Any
def application(environ: Any, start_response: Any): ...

105
odoo-stubs/sql_db.pyi Normal file
View File

@@ -0,0 +1,105 @@
import psycopg2.extensions
from typing import Any, Optional
_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 clear_env(cr: Any) -> None: ...
re_from: Any
re_into: Any
sql_counter: int
def check(f: Any, self: Any, *args: Any, **kwargs: Any): ...
class BaseCursor:
precommit: Any = ...
postcommit: Any = ...
prerollback: Any = ...
postrollback: Any = ...
def __init__(self) -> None: ...
def savepoint(self, flush: bool = ...) -> None: ...
def __enter__(self): ...
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ...
class Cursor(BaseCursor):
IN_MAX: int = ...
sql_from_log: Any = ...
sql_into_log: Any = ...
sql_log: Any = ...
sql_log_count: int = ...
_closed: bool = ...
__pool: Any = ...
dbname: Any = ...
_serialized: Any = ...
_cnx: Any = ...
_obj: Any = ...
__caller: Any = ...
_default_log_exceptions: bool = ...
cache: Any = ...
def __init__(self, pool: Any, dbname: Any, dsn: Any, serialized: bool = ...) -> None: ...
def __build_dict(self, row: Any): ...
def dictfetchone(self): ...
def dictfetchmany(self, size: Any): ...
def dictfetchall(self): ...
def __del__(self) -> None: ...
def execute(self, query: Any, params: Optional[Any] = ..., log_exceptions: Optional[Any] = ...): ...
def split_for_in_conditions(self, ids: Any, size: Optional[Any] = ...): ...
def print_log(self): ...
def close(self): ...
def _close(self, leak: bool = ...) -> None: ...
def autocommit(self, on: Any) -> None: ...
def after(self, event: Any, func: Any) -> None: ...
def commit(self): ...
def rollback(self): ...
def __getattr__(self, name: Any): ...
@property
def closed(self): ...
class TestCursor(BaseCursor):
_savepoint_seq: Any = ...
_closed: bool = ...
_cursor: Any = ...
_lock: Any = ...
_savepoint: Any = ...
def __init__(self, cursor: Any, lock: Any) -> None: ...
def close(self) -> None: ...
def autocommit(self, on: Any) -> None: ...
def commit(self) -> None: ...
def rollback(self) -> None: ...
def __getattr__(self, name: Any): ...
class PsycoConnection(psycopg2.extensions.connection): ...
class ConnectionPool:
def locked(fun: Any): ...
_connections: Any = ...
_maxconn: Any = ...
_lock: Any = ...
def __init__(self, maxconn: int = ...) -> None: ...
def __repr__(self): ...
def _debug(self, msg: Any, *args: Any) -> None: ...
def borrow(self, connection_info: Any): ...
def give_back(self, connection: Any, keep_in_pool: bool = ...) -> None: ...
def close_all(self, dsn: Optional[Any] = ...) -> None: ...
class Connection:
dbname: Any = ...
dsn: Any = ...
__pool: Any = ...
def __init__(self, pool: Any, dbname: Any, dsn: Any) -> None: ...
def cursor(self, serialized: bool = ...): ...
serialized_cursor: Any = ...
def __bool__(self) -> None: ...
__nonzero__: Any = ...
def connection_info_for(db_or_uri: Any): ...
_Pool: Any
def db_connect(to: Any, allow_uri: bool = ...): ...
def close_db(db_name: Any) -> None: ...
def close_all() -> None: ...

View File

@@ -1,2 +1,2 @@
from . import common
from .common import *
from .common import *
from . import common as common

View File

@@ -2,24 +2,37 @@ import collections
import unittest
from typing import Any, Optional
from ..api import Environment
from ..modules.registry import Registry
from ..sql_db import Cursor
from odoo.api import Environment
from odoo.modules.registry import Registry
from odoo.sql_db import Cursor
_logger: Any
ADDONS_PATH: Any
HOST: str
PORT: Any
ADMIN_USER_ID: Any
def get_db_name(): ...
standalone_tests: Any
def standalone(*tags: Any): ...
DB: Any
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): ...
class OdooSuite(unittest.suite.TestSuite):
def _handleClassSetUp(self, test: Any, result: Any) -> None: ...
def _createClassOrModuleLevelException(self, result: Any, exc: Any, method_name: Any, parent: Any, info: Optional[Any] = ...) -> None: ...
def _addClassOrModuleLevelException(self, result: Any, exception: Any, errorName: Any, info: Optional[Any] = ...) -> None: ...
def _tearDownPreviousClass(self, test: Any, result: Any) -> None: ...
class TreeCase(unittest.TestCase):
_class_cleanups: Any = ...
@classmethod
def addClassCleanup(cls, function: Any, *args: Any, **kwargs: Any) -> None: ...
@classmethod
def doClassCleanups(cls) -> None: ...
def __init__(self, methodName: str = ...) -> None: ...
def assertTreesEqual(self, n1: Any, n2: Any, msg: Optional[Any] = ...) -> None: ...
@@ -39,12 +52,14 @@ class BaseCase(TreeCase):
def uid(self, user: Any) -> None: ...
def ref(self, xid: Any): ...
def browse_ref(self, xid: Any): ...
def with_user(self, login: Any) -> None: ...
def _assertRaises(self, exception: Any, *, msg: Optional[Any] = ...) -> None: ...
def assertRaises(self, exception: Any, func: Optional[Any] = ..., *args: Any, **kwargs: Any): ...
def assertQueries(self, expected: Any): ...
def assertQueryCount(self, default: int = ..., flush: bool = ..., **counters: Any): ...
def assertRecordValues(self, records: Any, expected_values: Any): ...
def shortDescription(self) -> None: ...
def assertItemsEqual(self, a: Any, b: Any, msg: Optional[Any] = ...) -> None: ...
def __getattr__(self, item): ...
class TransactionCase(BaseCase):
def setUp(self): ...
@@ -55,18 +70,17 @@ class SingleTransactionCase(BaseCase):
@classmethod
def setUpClass(cls) -> None: ...
def setUp(self) -> None: ...
@classmethod
def tearDownClass(cls) -> None: ...
savepoint_seq: Any
class SavepointCase(SingleTransactionCase):
_savepoint_id: Any = ...
def setUp(self) -> None: ...
def tearDown(self) -> None: ...
class ChromeBrowserException(Exception): ...
class ChromeBrowser:
_logger: Any = ...
test_class: Any = ...
devtools_port: Any = ...
ws_url: str = ...
@@ -84,14 +98,29 @@ class ChromeBrowser:
def stop(self) -> None: ...
@property
def executable(self): ...
def _spawn_chrome(self, cmd: Any): ...
def _chrome_start(self) -> None: ...
def _find_websocket(self) -> None: ...
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 = ...): ...
_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 _save_screencast(self, prefix: str = ...) -> None: ...
screencasts_frames_dir: Any = ...
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 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): ...
class HttpCase(TransactionCase):
@@ -107,17 +136,15 @@ class HttpCase(TransactionCase):
def start_browser(cls) -> None: ...
@classmethod
def terminate_browser(cls) -> None: ...
@classmethod
def tearDownClass(cls) -> None: ...
session: Any = ...
session_id: Any = ...
opener: Any = ...
def setUp(self) -> None: ...
def url_open(self, url: Any, data: Optional[Any] = ..., files: Optional[Any] = ..., timeout: int = ..., headers: Optional[Any] = ...): ...
def url_open(self, url: Any, data: Optional[Any] = ..., files: Optional[Any] = ..., timeout: int = ..., headers: Optional[Any] = ..., allow_redirects: bool = ...): ...
def _wait_remaining_requests(self, timeout: int = ...): ...
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 users(*logins: Any): ...
def warmup(func: Any, *args: Any, **kwargs: Any) -> None: ...
@@ -127,41 +154,75 @@ ref_re: Any
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): ...
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):
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): ...
def save(self) -> None: ...
def _values_to_save(self, all_fields: bool = ...): ...
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: ...
class X2MProxy: ...
class X2MProxy:
_parent: Any = ...
_field: Any = ...
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): ...
@property
def _model(self): ...
@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: ...
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 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): ...
class TagsSelector:

View File

@@ -0,0 +1,13 @@
from typing import Any
_logger: Any
BLACKLIST: Any
IGNORE: Any
def install(db_name: Any, module_id: Any, module_name: Any) -> None: ...
def uninstall(db_name: Any, module_id: Any, module_name: Any) -> None: ...
def cycle(db_name: Any, module_id: Any, module_name: Any) -> None: ...
def parse_args(): ...
def test_full(args: Any): ...
def test_uninstall(args: Any) -> None: ...
def test_scripts(args: Any) -> None: ...

View File

@@ -0,0 +1,14 @@
from .misc import *
from .translate import *
from .image import *
from .sql import *
from .float_utils import *
from .mail import *
from .func import *
from .debugger import *
from .xml_utils import *
from .date_utils import *
from .convert import *
from .template_inheritance import *
from . import appdirs as appdirs, osutil as osutil, pdf as pdf, pycompat as pycompat, win32 as win32
from .config import config as config

View File

@@ -0,0 +1,38 @@
from typing import Any, Optional
__version_info__: Any
__version__: Any
def user_data_dir(appname: Optional[Any] = ..., appauthor: Optional[Any] = ..., version: Optional[Any] = ..., roaming: bool = ...): ...
def site_data_dir(appname: Optional[Any] = ..., appauthor: Optional[Any] = ..., version: Optional[Any] = ..., multipath: bool = ...): ...
def user_config_dir(appname: Optional[Any] = ..., appauthor: Optional[Any] = ..., version: Optional[Any] = ..., roaming: bool = ...): ...
def site_config_dir(appname: Optional[Any] = ..., appauthor: Optional[Any] = ..., version: Optional[Any] = ..., multipath: bool = ...): ...
def user_cache_dir(appname: Optional[Any] = ..., appauthor: Optional[Any] = ..., version: Optional[Any] = ..., opinion: bool = ...): ...
def user_log_dir(appname: Optional[Any] = ..., appauthor: Optional[Any] = ..., version: Optional[Any] = ..., opinion: bool = ...): ...
class AppDirs:
appname: Any = ...
appauthor: Any = ...
version: Any = ...
roaming: Any = ...
multipath: Any = ...
def __init__(self, appname: Any, appauthor: Optional[Any] = ..., version: Optional[Any] = ..., roaming: bool = ..., multipath: bool = ...) -> None: ...
@property
def user_data_dir(self): ...
@property
def site_data_dir(self): ...
@property
def user_config_dir(self): ...
@property
def site_config_dir(self): ...
@property
def user_cache_dir(self): ...
@property
def user_log_dir(self): ...
def _get_win_folder_from_registry(csidl_name: Any): ...
def _get_win_folder_with_pywin32(csidl_name: Any): ...
def _get_win_folder_with_ctypes(csidl_name: Any): ...
_get_win_folder = _get_win_folder_with_pywin32
_get_win_folder = _get_win_folder_with_ctypes
_get_win_folder = _get_win_folder_from_registry

View File

@@ -0,0 +1,10 @@
from typing import Any
class assertion_report:
successes: int = ...
failures: int = ...
def __init__(self) -> None: ...
def record_success(self) -> None: ...
def record_failure(self) -> None: ...
def record_result(self, result: Any) -> None: ...
def __str__(self): ...

View File

@@ -0,0 +1,50 @@
from typing import Any, Optional
unsafe_eval = eval
_logger: Any
class ormcache_counter:
__slots__: Any = ...
hit: int = ...
miss: int = ...
err: int = ...
def __init__(self) -> None: ...
@property
def ratio(self): ...
STAT: Any
class ormcache:
args: Any = ...
skiparg: Any = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
method: Any = ...
def __call__(self, method: Any): ...
key: Any = ...
def determine_key(self): ...
def lru(self, model: Any): ...
def lookup(self, method: Any, *args: Any, **kwargs: Any): ...
def clear(self, model: Any, *args: Any) -> None: ...
class ormcache_context(ormcache):
keys: Any = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
key: Any = ...
def determine_key(self) -> None: ...
class ormcache_multi(ormcache):
multi: Any = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
key_multi: Any = ...
multi_pos: Any = ...
def determine_key(self) -> None: ...
def lookup(self, method: Any, *args: Any, **kwargs: Any): ...
class dummy_cache:
def __init__(self, *l: Any, **kw: Any) -> None: ...
def __call__(self, fn: Any): ...
def clear(self, *l: Any, **kw: Any) -> None: ...
def log_ormcache_stats(sig: Optional[Any] = ..., frame: Optional[Any] = ...): ...
def get_cache_key_counter(bound_method: Any, *args: Any, **kwargs: Any): ...
cache = ormcache

View File

@@ -0,0 +1,49 @@
import optparse
from typing import Any, Optional
crypt_context: Any
class MyOption(optparse.Option):
my_default: Any = ...
def __init__(self, *opts: Any, **attrs: Any) -> None: ...
DEFAULT_LOG_HANDLER: str
def _get_default_datadir(): ...
def _deduplicate_loggers(loggers: Any): ...
class configmanager:
options: Any = ...
blacklist_for_save: Any = ...
casts: Any = ...
misc: Any = ...
config_file: Any = ...
_LOGLEVELS: Any = ...
parser: Any = ...
def __init__(self, fname: Optional[Any] = ...) -> None: ...
def parse_config(self, args: Optional[Any] = ...): ...
rcfile: Any = ...
def _parse_config(self, args: Optional[Any] = ...): ...
def _warn_deprecated_options(self) -> None: ...
def _is_addons_path(self, path: Any): ...
def _check_addons_path(self, option: Any, opt: Any, value: Any, parser: Any) -> None: ...
def _check_upgrade_path(self, option: Any, opt: Any, value: Any, parser: Any) -> None: ...
def _is_upgrades_path(self, res: Any): ...
def _test_enable_callback(self, option: Any, opt: Any, value: Any, parser: Any) -> None: ...
def load(self) -> None: ...
def save(self) -> None: ...
def get(self, key: Any, default: Optional[Any] = ...): ...
def pop(self, key: Any, default: Optional[Any] = ...): ...
def get_misc(self, sect: Any, key: Any, default: Optional[Any] = ...): ...
def __setitem__(self, key: Any, value: Any) -> None: ...
def __getitem__(self, key: Any): ...
@property
def addons_data_dir(self): ...
@property
def session_dir(self): ...
def filestore(self, dbname: Any): ...
def set_admin_password(self, new_password: Any) -> None: ...
def verify_admin_password(self, password: Any): ...
def _normalize(self, path: Any): ...
config: Any

View File

@@ -0,0 +1,54 @@
from .misc import ustr as ustr
from odoo import api as api
from typing import Any, Optional
_logger: Any
safe_eval: Any
class ParseError(Exception): ...
class RecordDictWrapper(dict):
record: Any = ...
def __init__(self, record: Any) -> None: ...
def __getitem__(self, key: Any): ...
def _get_idref(self, env: Any, model_str: Any, idref: Any): ...
def _fix_multiple_roots(node: Any) -> None: ...
def _eval_xml(self, node: Any, env: Any): ...
def str2bool(value: Any): ...
def nodeattr2bool(node: Any, attr: Any, default: bool = ...): ...
class xml_import:
def get_env(self, node: Any, eval_context: Optional[Any] = ...): ...
def make_xml_id(self, xml_id: Any): ...
def _test_xml_id(self, xml_id: Any) -> None: ...
def _tag_delete(self, rec: Any) -> None: ...
def _tag_report(self, rec: Any): ...
def _tag_function(self, rec: Any) -> None: ...
def _tag_act_window(self, rec: Any) -> None: ...
def _tag_menuitem(self, rec: Any) -> None: ...
def _tag_record(self, rec: Any): ...
def _tag_template(self, el: Any): ...
def id_get(self, id_str: Any, raise_if_not_found: bool = ...): ...
def model_id_get(self, id_str: Any, raise_if_not_found: bool = ...): ...
def _tag_root(self, el: Any) -> None: ...
@property
def env(self): ...
@property
def noupdate(self): ...
mode: Any = ...
module: Any = ...
envs: Any = ...
idref: Any = ...
assertion_report: Any = ...
_noupdate: Any = ...
xml_filename: Any = ...
_tags: Any = ...
def __init__(self, cr: Any, module: Any, idref: Any, mode: Any, report: Optional[Any] = ..., noupdate: bool = ..., xml_filename: Optional[Any] = ...) -> None: ...
def parse(self, de: Any) -> None: ...
DATA_ROOTS: Any = ...
def convert_file(cr: Any, module: Any, filename: Any, idref: Any, mode: str = ..., noupdate: bool = ..., kind: Optional[Any] = ..., report: Optional[Any] = ..., pathname: Optional[Any] = ...) -> None: ...
def convert_sql_import(cr: Any, fp: Any) -> None: ...
def convert_csv_import(cr: Any, module: Any, fname: Any, csvcontent: Any, idref: Optional[Any] = ..., mode: str = ..., noupdate: bool = ...) -> None: ...
def convert_xml_import(cr: Any, module: Any, xmlfile: Any, idref: Optional[Any] = ..., mode: str = ..., noupdate: bool = ..., report: Optional[Any] = ...) -> None: ...

View File

@@ -0,0 +1,13 @@
from typing import Any
def get_month(date: Any): ...
def get_quarter_number(date: Any): ...
def get_quarter(date: Any): ...
def get_fiscal_year(date: Any, day: int = ..., month: int = ...): ...
def get_timedelta(qty: Any, granularity: Any): ...
def start_of(value: Any, granularity: Any): ...
def end_of(value: Any, granularity: Any): ...
def add(value: Any, *args: Any, **kwargs: Any): ...
def subtract(value: Any, *args: Any, **kwargs: Any): ...
def json_default(obj: Any): ...
def date_range(start: Any, end: Any, step: Any = ...): ...

View File

@@ -0,0 +1,6 @@
from typing import Any
_logger: Any
SUPPORTED_DEBUGGER: Any
def post_mortem(config: Any, info: Any) -> None: ...

View File

@@ -0,0 +1,12 @@
from typing import Any, Optional
def round(f: Any): ...
def _float_check_precision(precision_digits: Optional[Any] = ..., precision_rounding: Optional[Any] = ...): ...
def float_round(value: Any, precision_digits: Optional[Any] = ..., precision_rounding: Optional[Any] = ..., rounding_method: str = ...): ...
def float_is_zero(value: Any, precision_digits: Optional[Any] = ..., precision_rounding: Optional[Any] = ...): ...
def float_compare(value1: Any, value2: Any, precision_digits: Optional[Any] = ..., precision_rounding: Optional[Any] = ...): ...
def float_repr(value: Any, precision_digits: Any): ...
_float_repr = float_repr
def float_split_str(value: Any, precision_digits: Any): ...
def float_split(value: Any, precision_digits: Any): ...

116
odoo-stubs/tools/func.pyi Normal file
View File

@@ -0,0 +1,116 @@
from json import JSONEncoder as JSONEncoder
from typing import Any
__all__: Any
class lazy_property:
fget: Any = ...
def __init__(self, fget: Any) -> None: ...
def __get__(self, obj: Any, cls: Any): ...
@property
def __doc__(self): ...
@staticmethod
def reset_all(obj: Any) -> None: ...
class lazy_classproperty(lazy_property):
def __get__(self, obj: Any, cls: Any): ...
def conditional(condition: Any, decorator: Any): ...
def synchronized(lock_attr: str = ...): ...
def frame_codeinfo(fframe: Any, back: int = ...): ...
def compose(a: Any, b: Any): ...
class _ClassProperty(property):
def __get__(self, cls: Any, owner: Any): ...
def classproperty(func: Any): ...
class lazy:
__slots__: Any = ...
def __init__(self, func: Any, *args: Any, **kwargs: Any) -> None: ...
@property
def _value(self): ...
def __getattr__(self, name: Any): ...
def __setattr__(self, name: Any, value: Any): ...
def __delattr__(self, name: Any): ...
def __repr__(self): ...
def __str__(self): ...
def __bytes__(self): ...
def __format__(self, format_spec: Any): ...
def __lt__(self, other: Any) -> Any: ...
def __le__(self, other: Any) -> Any: ...
def __eq__(self, other: Any) -> Any: ...
def __ne__(self, other: Any) -> Any: ...
def __gt__(self, other: Any) -> Any: ...
def __ge__(self, other: Any) -> Any: ...
def __hash__(self) -> Any: ...
def __bool__(self): ...
def __call__(self, *args: Any, **kwargs: Any): ...
def __len__(self): ...
def __getitem__(self, key: Any): ...
def __missing__(self, key: Any): ...
def __setitem__(self, key: Any, value: Any) -> None: ...
def __delitem__(self, key: Any) -> None: ...
def __iter__(self) -> Any: ...
def __reversed__(self): ...
def __contains__(self, key: Any): ...
def __add__(self, other: Any): ...
def __sub__(self, other: Any): ...
def __mul__(self, other: Any): ...
def __matmul__(self, other: Any): ...
def __truediv__(self, other: Any): ...
def __floordiv__(self, other: Any): ...
def __mod__(self, other: Any): ...
def __divmod__(self, other: Any): ...
def __pow__(self, other: Any): ...
def __lshift__(self, other: Any): ...
def __rshift__(self, other: Any): ...
def __and__(self, other: Any): ...
def __xor__(self, other: Any): ...
def __or__(self, other: Any): ...
def __radd__(self, other: Any): ...
def __rsub__(self, other: Any): ...
def __rmul__(self, other: Any): ...
def __rmatmul__(self, other: Any): ...
def __rtruediv__(self, other: Any): ...
def __rfloordiv__(self, other: Any): ...
def __rmod__(self, other: Any): ...
def __rdivmod__(self, other: Any): ...
def __rpow__(self, other: Any): ...
def __rlshift__(self, other: Any): ...
def __rrshift__(self, other: Any): ...
def __rand__(self, other: Any): ...
def __rxor__(self, other: Any): ...
def __ror__(self, other: Any): ...
def __iadd__(self, other: Any): ...
def __isub__(self, other: Any): ...
def __imul__(self, other: Any): ...
def __imatmul__(self, other: Any): ...
def __itruediv__(self, other: Any): ...
def __ifloordiv__(self, other: Any): ...
def __imod__(self, other: Any): ...
def __ipow__(self, other: Any): ...
def __ilshift__(self, other: Any): ...
def __irshift__(self, other: Any): ...
def __iand__(self, other: Any): ...
def __ixor__(self, other: Any): ...
def __ior__(self, other: Any): ...
def __neg__(self): ...
def __pos__(self): ...
def __abs__(self): ...
def __invert__(self): ...
def __complex__(self): ...
def __int__(self): ...
def __float__(self): ...
def __index__(self): ...
def __round__(self): ...
def __trunc__(self): ...
def __floor__(self): ...
def __ceil__(self): ...
def __enter__(self): ...
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any): ...
def __await__(self): ...
def __aiter__(self): ...
def __anext__(self): ...
def __aenter__(self): ...
def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any): ...

View File

@@ -0,0 +1,31 @@
from PIL import IcoImagePlugin as IcoImagePlugin
from typing import Any, Optional
FILETYPE_BASE64_MAGICWORD: Any
EXIF_TAG_ORIENTATION: int
EXIF_TAG_ORIENTATION_TO_TRANSPOSE_METHODS: Any
IMAGE_MAX_RESOLUTION: float
class ImageProcess:
base64_source: Any = ...
operationsCount: int = ...
image: bool = ...
original_format: Any = ...
def __init__(self, base64_source: Any, verify_resolution: bool = ...) -> None: ...
def image_base64(self, quality: int = ..., output_format: str = ...): ...
def resize(self, max_width: int = ..., max_height: int = ...): ...
def crop_resize(self, max_width: Any, max_height: Any, center_x: float = ..., center_y: float = ...): ...
def colorize(self): ...
def image_process(base64_source: Any, size: Any = ..., verify_resolution: bool = ..., quality: int = ..., crop: Optional[Any] = ..., colorize: bool = ..., output_format: str = ...): ...
def average_dominant_color(colors: Any, mitigate: int = ..., max_margin: int = ...): ...
def image_fix_orientation(image: Any): ...
def base64_to_image(base64_source: Any): ...
def image_to_base64(image: Any, format: Any, **params: Any): ...
def is_image_size_above(base64_source_1: Any, base64_source_2: Any): ...
def image_guess_size_from_field_name(field_name: Any): ...
def image_data_uri(base64_source: Any): ...
def get_saturation(rgb: Any): ...
def get_lightness(rgb: Any): ...
def hex_to_rgb(hx: Any): ...
def rgb_to_hex(rgb: Any): ...

View File

View File

@@ -0,0 +1,7 @@
from json import *
from typing import Any
__all__: Any
JSON_SCRIPTSAFE_MAPPER: Any
def dumps(*args: Any, **kwargs: Any): ...

17
odoo-stubs/tools/lru.pyi Normal file
View File

@@ -0,0 +1,17 @@
from typing import Any, Optional
__all__: Any
class LRU:
_lock: Any = ...
count: Any = ...
d: Any = ...
def __init__(self, count: Any, pairs: Any = ...) -> None: ...
def __contains__(self, obj: Any): ...
def get(self, obj: Any, val: Optional[Any] = ...): ...
def __getitem__(self, obj: Any): ...
def __setitem__(self, obj: Any, val: Any) -> None: ...
def __delitem__(self, obj: Any) -> None: ...
def __len__(self): ...
def pop(self, key: Any): ...
def clear(self) -> None: ...

45
odoo-stubs/tools/mail.pyi Normal file
View File

@@ -0,0 +1,45 @@
from lxml.html import clean
from typing import Any, Optional
_logger: Any
tags_to_kill: Any
tags_to_remove: Any
allowed_tags: Any
safe_attrs: Any
class _Cleaner(clean.Cleaner):
_style_re: Any = ...
_style_whitelist: Any = ...
strip_classes: bool = ...
sanitize_style: bool = ...
def __call__(self, doc: Any) -> None: ...
def tag_quote(self, el: Any): ...
def strip_class(self, el: Any) -> None: ...
def parse_style(self, el: Any) -> None: ...
def html_sanitize(src: Any, silent: bool = ..., sanitize_tags: bool = ..., sanitize_attributes: bool = ..., sanitize_style: bool = ..., sanitize_form: bool = ..., strip_style: bool = ..., strip_classes: bool = ...): ...
URL_REGEX: str
TEXT_URL_REGEX: str
def validate_url(url: Any): ...
def is_html_empty(html_content: Any): ...
def html_keep_url(text: Any): ...
def html2plaintext(html: Any, body_id: Optional[Any] = ..., encoding: str = ...): ...
def plaintext2html(text: Any, container_tag: bool = ...): ...
def append_content_to_html(html: Any, content: Any, plaintext: bool = ..., preserve: bool = ..., container_tag: bool = ...): ...
email_re: Any
single_email_re: Any
mail_header_msgid_re: Any
email_addr_escapes_re: Any
def generate_tracking_message_id(res_id: Any): ...
def email_send(email_from: Any, email_to: Any, subject: Any, body: Any, email_cc: Optional[Any] = ..., email_bcc: Optional[Any] = ..., reply_to: bool = ..., attachments: Optional[Any] = ..., message_id: Optional[Any] = ..., references: Optional[Any] = ..., openobject_id: bool = ..., debug: bool = ..., subtype: str = ..., headers: Optional[Any] = ..., smtp_server: Optional[Any] = ..., smtp_port: Optional[Any] = ..., ssl: bool = ..., smtp_user: Optional[Any] = ..., smtp_password: Optional[Any] = ..., cr: Optional[Any] = ..., uid: Optional[Any] = ...): ...
def email_split_tuples(text: Any): ...
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_message_header(message: Any, header: Any, separator: str = ...): ...
def formataddr(pair: Any, charset: str = ...): ...

View File

@@ -0,0 +1,28 @@
from collections import namedtuple
from typing import Any
__all__: Any
_logger: Any
_ooxml_dirs: Any
def _check_ooxml(data: Any): ...
_mime_validator: Any
def _check_open_container_format(data: Any): ...
_xls_pattern: Any
_ppt_pattern: Any
def _check_olecf(data: Any): ...
def _check_svg(data: Any): ...
_Entry = namedtuple('_Entry', ['mimetype', 'signatures', 'discriminants'])
_mime_mappings: Any
def guess_mimetype(bin_data: Any, default: str = ...): ...
guess_mimetype: Any
ms: Any
def neuter_mimetype(mimetype: Any, user: Any): ...

207
odoo-stubs/tools/misc.pyi Normal file
View File

@@ -0,0 +1,207 @@
from .cache import *
import pickle as pickle_
import xlsxwriter
import xlwt
from collections import defaultdict
from collections.abc import Mapping, MutableMapping, MutableSet
from odoo.loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings
from typing import Any, Optional
_logger: Any
SKIPPED_ELEMENT_TYPES: Any
def find_in_path(name: Any): ...
def _exec_pipe(prog: Any, args: Any, env: Optional[Any] = ...): ...
def exec_command_pipe(name: Any, *args: Any): ...
def find_pg_tool(name: Any): ...
def exec_pg_environ(): ...
def exec_pg_command(name: Any, *args: Any) -> None: ...
def exec_pg_command_pipe(name: Any, *args: Any): ...
def file_open(name: Any, mode: str = ..., subdir: str = ..., pathinfo: bool = ...): ...
def _fileopen(path: Any, mode: Any, basedir: Any, pathinfo: Any, basename: Optional[Any] = ...): ...
def flatten(list: Any): ...
def reverse_enumerate(l: Any): ...
def partition(pred: Any, elems: Any): ...
def topological_sort(elems: Any): ...
def merge_sequences(*iterables: Any): ...
class PatchedWorkbook(xlwt.Workbook):
def add_sheet(self, name: Any, cell_overwrite_ok: bool = ...): ...
class PatchedXlsxWorkbook(xlsxwriter.Workbook):
def add_worksheet(self, name: Optional[Any] = ..., **kw: Any): ...
def to_xml(s: Any): ...
def get_iso_codes(lang: Any): ...
def scan_languages(): ...
def mod10r(number: Any): ...
def str2bool(s: Any, default: Optional[Any] = ...): ...
def human_size(sz: Any): ...
def logged(f: Any): ...
class profile:
fname: Any = ...
def __init__(self, fname: Optional[Any] = ...) -> None: ...
def __call__(self, f: Any): ...
def detect_ip_addr(): ...
DEFAULT_SERVER_DATE_FORMAT: str
DEFAULT_SERVER_TIME_FORMAT: str
DEFAULT_SERVER_DATETIME_FORMAT: Any
DATE_LENGTH: Any
DATETIME_FORMATS_MAP: Any
POSIX_TO_LDML: Any
def posix_to_ldml(fmt: Any, locale: Any): ...
def split_every(n: Any, iterable: Any, piece_maker: Any = ...) -> None: ...
def get_and_group_by_field(cr: Any, uid: Any, obj: Any, ids: Any, field: Any, context: Optional[Any] = ...): ...
def get_and_group_by_company(cr: Any, uid: Any, obj: Any, ids: Any, context: Optional[Any] = ...): ...
def resolve_attr(obj: Any, attr: Any): ...
def attrgetter(*items: Any): ...
def remove_accents(input_str: Any): ...
class unquote(str):
def __repr__(self): ...
class UnquoteEvalContext(defaultdict):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __missing__(self, key: Any): ...
class mute_logger:
loggers: Any = ...
def __init__(self, *loggers: Any) -> None: ...
def filter(self, record: Any): ...
def __enter__(self) -> None: ...
def __exit__(self, exc_type: Optional[Any] = ..., exc_val: Optional[Any] = ..., exc_tb: Optional[Any] = ...) -> None: ...
def __call__(self, func: Any): ...
_ph: Any
class CountingStream:
stream: Any = ...
index: Any = ...
stopped: bool = ...
def __init__(self, stream: Any, start: int = ...) -> None: ...
def __iter__(self) -> Any: ...
def next(self): ...
__next__: Any = ...
def stripped_sys_argv(*strip_args: Any): ...
class ConstantMapping(Mapping):
__slots__: Any = ...
_value: Any = ...
def __init__(self, val: Any) -> None: ...
def __len__(self): ...
def __iter__(self) -> Any: ...
def __getitem__(self, item: Any): ...
def dumpstacks(sig: Optional[Any] = ..., frame: Optional[Any] = ..., thread_idents: Optional[Any] = ...) -> None: ...
def freehash(arg: Any): ...
def clean_context(context: Any): ...
class frozendict(dict):
def __delitem__(self, key: Any) -> None: ...
def __setitem__(self, key: Any, val: Any) -> None: ...
def clear(self) -> None: ...
def pop(self, key: Any, default: Optional[Any] = ...) -> None: ...
def popitem(self) -> None: ...
def setdefault(self, key: Any, default: Optional[Any] = ...) -> None: ...
def update(self, *args: Any, **kwargs: Any) -> None: ...
def __hash__(self) -> Any: ...
class Collector(Mapping):
__slots__: Any = ...
_map: Any = ...
def __init__(self) -> None: ...
def add(self, key: Any, val: Any) -> None: ...
def __getitem__(self, key: Any): ...
def __iter__(self) -> Any: ...
def __len__(self): ...
class StackMap(MutableMapping):
__slots__: Any = ...
_maps: Any = ...
def __init__(self, m: Optional[Any] = ...) -> None: ...
def __getitem__(self, key: Any): ...
def __setitem__(self, key: Any, val: Any) -> None: ...
def __delitem__(self, key: Any) -> None: ...
def __iter__(self) -> Any: ...
def __len__(self): ...
def __str__(self): ...
def pushmap(self, m: Optional[Any] = ...) -> None: ...
def popmap(self): ...
class OrderedSet(MutableSet):
__slots__: Any = ...
_map: Any = ...
def __init__(self, elems: Any = ...) -> None: ...
def __contains__(self, elem: Any): ...
def __iter__(self) -> Any: ...
def __len__(self): ...
def add(self, elem: Any) -> None: ...
def discard(self, elem: Any) -> None: ...
class LastOrderedSet(OrderedSet):
def add(self, elem: Any) -> None: ...
class GroupCalls:
_func_args: Any = ...
def __init__(self) -> None: ...
def __call__(self) -> None: ...
def add(self, func: Any, *types: Any): ...
def clear(self) -> None: ...
class IterableGenerator:
__slots__: Any = ...
func: Any = ...
args: Any = ...
def __init__(self, func: Any, *args: Any) -> None: ...
def __iter__(self) -> Any: ...
def groupby(iterable: Any, key: Optional[Any] = ...): ...
def unique(it: Any) -> None: ...
class Reverse:
__slots__: Any = ...
val: Any = ...
def __init__(self, val: Any) -> None: ...
def __eq__(self, other: Any) -> Any: ...
def __ne__(self, other: Any) -> Any: ...
def __ge__(self, other: Any) -> Any: ...
def __gt__(self, other: Any) -> Any: ...
def __le__(self, other: Any) -> Any: ...
def __lt__(self, other: Any) -> Any: ...
def ignore(*exc: Any) -> None: ...
def html_escape(text: Any): ...
def get_lang(env: Any, lang_code: bool = ...): ...
def formatLang(env: Any, value: Any, digits: Optional[Any] = ..., grouping: bool = ..., monetary: bool = ..., dp: bool = ..., currency_obj: bool = ...): ...
def format_date(env: Any, value: Any, lang_code: bool = ..., date_format: bool = ...): ...
def parse_date(env: Any, value: Any, lang_code: bool = ...): ...
def format_datetime(env: Any, value: Any, tz: bool = ..., dt_format: str = ..., lang_code: bool = ...): ...
def format_time(env: Any, value: Any, tz: bool = ..., time_format: str = ..., lang_code: bool = ...): ...
def _format_time_ago(env: Any, time_delta: Any, lang_code: bool = ..., add_direction: bool = ...): ...
def format_amount(env: Any, amount: Any, currency: Any, lang_code: bool = ...): ...
def format_duration(value: Any): ...
def _consteq(str1: Any, str2: Any): ...
consteq: Any
class Unpickler(pickle_.Unpickler):
find_global: Any = ...
find_class: Any = ...
def _pickle_load(stream: Any, encoding: str = ..., errors: bool = ...): ...
pickle: Any
def wrap_module(module: Any, attr_list: Any): ...
class DotDict(dict):
def __getattr__(self, attrib: Any): ...
def get_diff(data_from: Any, data_to: Any, custom_style: bool = ...): ...
def traverse_containers(val: Any, type_: Any) -> None: ...
def hmac(env: Any, scope: Any, message: Any, hash_function: Any = ...): ...

View File

@@ -0,0 +1,16 @@
import ctypes
from typing import Any, Optional
_logger: Any
def listdir(dir: Any, recursive: bool = ...): ...
def walksymlinks(top: Any, topdown: bool = ..., onerror: Optional[Any] = ...): ...
def tempdir() -> None: ...
def zip_dir(path: Any, stream: Any, include_dir: bool = ..., fnct_sort: Optional[Any] = ...) -> None: ...
getppid: Any
is_running_as_nt_service: Any
_TH32CS_SNAPPROCESS: int
class _PROCESSENTRY32(ctypes.Structure):
_fields_: Any = ...

View File

@@ -0,0 +1,7 @@
from typing import Any
component_re: Any
replace: Any
def _parse_version_parts(s: Any) -> None: ...
def parse_version(s: Any): ...

20
odoo-stubs/tools/pdf.pyi Normal file
View File

@@ -0,0 +1,20 @@
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import ArrayObject as ArrayObject
from PyPDF2.utils import b_ as b_
from typing import Any
DEFAULT_PDF_DATETIME_FORMAT: str
class BrandedFileWriter(PdfFileWriter):
def __init__(self) -> None: ...
PdfFileWriter = BrandedFileWriter
def merge_pdf(pdf_data: Any): ...
def rotate_pdf(pdf: Any): ...
class OdooPdfFileReader(PdfFileReader):
def getAttachments(self): ...
class OdooPdfFileWriter(PdfFileWriter):
def _create_attachment_object(self, attachment: Any): ...
def addAttachment(self, fname: Any, fdata: Any) -> None: ...

View File

@@ -0,0 +1,14 @@
from datetime import datetime as datetime, timedelta as timedelta
from odoo.tools import pycompat as pycompat
from typing import Any, Optional
def Random(seed: Any): ...
def format_str(val: Any, counter: Any, values: Any): ...
def chain_factories(field_factories: Any, model_name: Any): ...
def root_factory() -> None: ...
def randomize(vals: Any, weights: Optional[Any] = ..., seed: bool = ..., formatter: Any = ..., counter_offset: int = ...): ...
def cartesian(vals: Any, weights: Optional[Any] = ..., seed: bool = ..., formatter: Any = ..., then: Optional[Any] = ...): ...
def iterate(vals: Any, weights: Optional[Any] = ..., seed: bool = ..., formatter: Any = ..., then: Optional[Any] = ...): ...
def constant(val: Any, formatter: Any = ...): ...
def compute(function: Any, seed: Optional[Any] = ...): ...
def randint(a: Any, b: Any, seed: Optional[Any] = ...): ...

View File

@@ -0,0 +1,15 @@
from typing import Any, Optional
_logger: Any
class _LogTracer:
profiles: Any = ...
whitelist: Any = ...
blacklist: Any = ...
files: Any = ...
deep: Any = ...
first_frame: Any = ...
def __init__(self, whitelist: Optional[Any] = ..., blacklist: Optional[Any] = ..., files: Optional[Any] = ..., deep: bool = ...) -> None: ...
def tracer(self, frame: Any, event: Any, arg: Any): ...
def profile(method: Optional[Any] = ..., whitelist: Optional[Any] = ..., blacklist: Any = ..., files: Optional[Any] = ..., minimum_time: int = ..., minimum_queries: int = ...): ...

View File

@@ -0,0 +1,8 @@
from typing import Any
_reader: Any
_writer: Any
def csv_reader(stream: Any, **params: Any): ...
def csv_writer(stream: Any, **params: Any): ...
def to_text(source: Any): ...

View File

@@ -0,0 +1,28 @@
from opcode import HAVE_ARGUMENT as HAVE_ARGUMENT
from typing import Any, Optional
unsafe_eval = eval
__all__: Any
_ALLOWED_MODULES: Any
_UNSAFE_ATTRIBUTES: Any
def to_opcodes(opnames: Any, _opmap: Any = ...) -> None: ...
_BLACKLIST: Any
_CONST_OPCODES: Any
_operations: Any
_EXPR_OPCODES: Any
_SAFE_OPCODES: Any
_logger: Any
def assert_no_dunder_name(code_obj: Any, expr: Any) -> None: ...
def assert_valid_codeobj(allowed_codes: Any, code_obj: Any, expr: Any) -> None: ...
def test_expr(expr: Any, allowed_codes: Any, mode: str = ...): ...
def const_eval(expr: Any): ...
def expr_eval(expr: Any): ...
def _import(name: Any, globals: Optional[Any] = ..., locals: Optional[Any] = ..., fromlist: Optional[Any] = ..., level: int = ...): ...
_BUILTINS: Any
def safe_eval(expr: Any, globals_dict: Optional[Any] = ..., locals_dict: Optional[Any] = ..., mode: str = ..., nocopy: bool = ..., locals_builtins: bool = ...): ...
def test_python_expr(expr: Any, mode: str = ...): ...

29
odoo-stubs/tools/sql.pyi Normal file
View File

@@ -0,0 +1,29 @@
from typing import Any, Optional
_schema: Any
_CONFDELTYPES: Any
def existing_tables(cr: Any, tablenames: Any): ...
def table_exists(cr: Any, tablename: Any): ...
def table_kind(cr: Any, tablename: Any): ...
def create_model_table(cr: Any, tablename: Any, comment: Optional[Any] = ..., columns: Any = ...) -> None: ...
def table_columns(cr: Any, tablename: Any): ...
def column_exists(cr: Any, tablename: Any, columnname: Any): ...
def create_column(cr: Any, tablename: Any, columnname: Any, columntype: Any, comment: Optional[Any] = ...) -> None: ...
def rename_column(cr: Any, tablename: Any, columnname1: Any, columnname2: Any) -> None: ...
def convert_column(cr: Any, tablename: Any, columnname: Any, columntype: Any) -> None: ...
def set_not_null(cr: Any, tablename: Any, columnname: Any) -> None: ...
def drop_not_null(cr: Any, tablename: Any, columnname: Any) -> None: ...
def constraint_definition(cr: Any, tablename: Any, constraintname: Any): ...
def add_constraint(cr: Any, tablename: Any, constraintname: Any, definition: Any) -> None: ...
def drop_constraint(cr: Any, tablename: Any, constraintname: Any) -> None: ...
def add_foreign_key(cr: Any, tablename1: Any, columnname1: Any, tablename2: Any, columnname2: Any, ondelete: Any): ...
def fix_foreign_key(cr: Any, tablename1: Any, columnname1: Any, tablename2: Any, columnname2: Any, ondelete: Any): ...
def index_exists(cr: Any, indexname: Any): ...
def create_index(cr: Any, indexname: Any, tablename: Any, expressions: Any) -> None: ...
def create_unique_index(cr: Any, indexname: Any, tablename: Any, expressions: Any) -> None: ...
def drop_index(cr: Any, indexname: Any, tablename: Any) -> None: ...
def drop_view_if_exists(cr: Any, viewname: Any) -> None: ...
def escape_psql(to_escape: Any): ...
def pg_varchar(size: int = ...): ...
def reverse_order(order: Any): ...

View File

@@ -0,0 +1,9 @@
from typing import Any
_logger: Any
def add_text_before(node: Any, text: Any) -> None: ...
def add_text_inside(node: Any, text: Any) -> None: ...
def remove_element(node: Any) -> None: ...
def locate_node(arch: Any, spec: Any): ...
def apply_inheritance_specs(source: Any, specs_tree: Any, inherit_branding: bool = ..., pre_locate: Any = ...): ...

View File

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

View File

@@ -0,0 +1,8 @@
from . import config as config
from typing import Any, Optional
_logger: Any
_test_logger: Any
def try_report(cr: Any, uid: Any, rname: Any, ids: Any, data: Optional[Any] = ..., context: Optional[Any] = ..., our_module: Optional[Any] = ..., report_type: Optional[Any] = ...): ...
def try_report_action(cr: Any, uid: Any, action_id: Any, active_model: Optional[Any] = ..., active_ids: Optional[Any] = ..., wiz_data: Optional[Any] = ..., wiz_buttons: Optional[Any] = ..., context: Optional[Any] = ..., our_module: Optional[Any] = ...): ...

View File

@@ -0,0 +1,124 @@
import csv
from collections import namedtuple
from typing import Any, Optional
_logger: Any
WEB_TRANSLATION_COMMENT: str
SKIPPED_ELEMENTS: Any
_LOCALE2WIN32: Any
ENGLISH_SMALL_WORDS: Any
class UNIX_LINE_TERMINATOR(csv.excel):
lineterminator: str = ...
def encode(s: Any): ...
TRANSLATED_ELEMENTS: Any
TRANSLATED_ATTRS: Any
avoid_pattern: Any
node_pattern: Any
def translate_xml_node(node: Any, callback: Any, parse: Any, serialize: Any): ...
def parse_xml(text: Any): ...
def serialize_xml(node: Any): ...
_HTML_PARSER: Any
def parse_html(text: Any): ...
def serialize_html(node: Any): ...
def xml_translate(callback: Any, value: Any): ...
def html_translate(callback: Any, value: Any): ...
def translate(cr: Any, name: Any, source_type: Any, lang: Any, source: Optional[Any] = ...): ...
def translate_sql_constraint(cr: Any, key: Any, lang: Any): ...
class GettextAlias:
def _get_db(self): ...
def _get_cr(self, frame: Any, allow_create: bool = ...): ...
def _get_uid(self, frame: Any): ...
def _get_lang(self, frame: Any): ...
def __call__(self, source: Any): ...
def _get_translation(self, source: Any): ...
class _lt:
__slots__: Any = ...
_source: Any = ...
def __init__(self, source: Any) -> None: ...
def __str__(self): ...
def __eq__(self, other: Any) -> Any: ...
def __lt__(self, other: Any) -> Any: ...
_: Any
def quote(s: Any): ...
re_escaped_char: Any
re_escaped_replacements: Any
def _sub_replacement(match_obj: Any): ...
def unquote(str: Any): ...
def TranslationFileReader(source: Any, fileformat: str = ...): ...
class CSVFileReader:
source: Any = ...
prev_code_src: str = ...
def __init__(self, source: Any) -> None: ...
def __iter__(self) -> Any: ...
class PoFileReader:
pofile: Any = ...
def __init__(self, source: Any): ...
def __iter__(self) -> Any: ...
def TranslationFileWriter(target: Any, fileformat: str = ..., lang: Optional[Any] = ...): ...
class CSVFileWriter:
writer: Any = ...
def __init__(self, target: Any) -> None: ...
def write_rows(self, rows: Any) -> None: ...
class PoFileWriter:
buffer: Any = ...
lang: Any = ...
po: Any = ...
def __init__(self, target: Any, lang: Any) -> None: ...
def write_rows(self, rows: Any) -> None: ...
def add_entry(self, modules: Any, tnrs: Any, source: Any, trad: Any, comments: Optional[Any] = ...) -> None: ...
class TarFileWriter:
tar: Any = ...
lang: Any = ...
def __init__(self, target: Any, lang: Any) -> None: ...
def write_rows(self, rows: Any) -> None: ...
def trans_export(lang: Any, modules: Any, buffer: Any, format: Any, cr: Any) -> None: ...
def trans_parse_rml(de: Any): ...
def _push(callback: Any, term: Any, source_line: Any) -> None: ...
def in_modules(object_name: Any, modules: Any): ...
def _extract_translatable_qweb_terms(element: Any, callback: Any) -> None: ...
def babel_extract_qweb(fileobj: Any, keywords: Any, comment_tags: Any, options: Any): ...
ImdInfo = namedtuple('ExternalId', ['name', 'model', 'res_id', 'module'])
class TranslationModuleReader:
_cr: Any = ...
_modules: Any = ...
_lang: Any = ...
env: Any = ...
_to_translate: Any = ...
_path_list: Any = ...
_installed_modules: Any = ...
def __init__(self, cr: Any, modules: Optional[Any] = ..., lang: Optional[Any] = ...) -> None: ...
def __iter__(self) -> Any: ...
def _push_translation(self, module: Any, ttype: Any, name: Any, res_id: Any, source: Any, comments: Optional[Any] = ..., record_id: Optional[Any] = ...) -> None: ...
def _get_translatable_records(self, records: Any): ...
def _export_translatable_records(self) -> None: ...
def _get_module_from_path(self, path: Any): ...
def _verified_module_filepaths(self, fname: Any, path: Any, root: Any): ...
def _babel_extract_terms(self, fname: Any, path: Any, root: Any, extract_method: str = ..., trans_type: str = ..., extra_comments: Optional[Any] = ..., extract_keywords: Any = ...) -> None: ...
def _export_translatable_resources(self) -> None: ...
def trans_load(cr: Any, filename: Any, lang: Any, verbose: bool = ..., create_empty_translation: bool = ..., overwrite: bool = ...): ...
def trans_load_data(cr: Any, fileobj: Any, fileformat: Any, lang: Any, verbose: bool = ..., create_empty_translation: bool = ..., overwrite: bool = ...) -> None: ...
def get_locales(lang: Optional[Any] = ...) -> None: ...
def resetlocale(): ...
def load_language(cr: Any, lang: Any) -> None: ...

View File

@@ -0,0 +1,16 @@
from typing import Any
_logger: Any
_validators: Any
_relaxng_cache: Any
READONLY: Any
def _get_attrs_symbols(): ...
def get_variable_names(expr: Any): ...
def get_dict_asts(expr: Any): ...
def _check(condition: Any, explanation: Any) -> None: ...
def get_domain_identifiers(expr: Any): ...
def valid_view(arch: Any, **kwargs: Any): ...
def validate(*view_types: Any): ...
def relaxng(view_type: Any): ...
def schema_valid(arch: Any, **kwargs: Any): ...

View File

@@ -0,0 +1,13 @@
from os import R_OK as R_OK, W_OK as W_OK
from os.path import dirname as dirname
from typing import Any, Optional
__docformat__: str
__all__: Any
ENOENT: int
windows: Any
seen: Any
defpathext: Any
def which_files(file: Any, mode: Any = ..., path: Optional[Any] = ..., pathext: Optional[Any] = ...) -> None: ...
def which(file: Any, mode: Any = ..., path: Optional[Any] = ..., pathext: Optional[Any] = ...): ...

View File

@@ -0,0 +1,3 @@
from typing import Any
def nl_langinfo(param: Any): ...

View File

@@ -0,0 +1,7 @@
from odoo.tools.misc import file_open as file_open
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: ...
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] = ...): ...

View File

@@ -0,0 +1,3 @@
from typing import Any
__path__: Any