mirror of
https://github.com/odoo-ide/odoo-stubs.git
synced 2025-05-08 16:52:26 +03:00
Update
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
# Stubs for odoo.api (Python 3)
|
|
||||||
#
|
|
||||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
|
||||||
|
|
||||||
from collections import Mapping
|
from collections import Mapping
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
|
|||||||
264
odoo-stubs/fields.pyi
Normal file
264
odoo-stubs/fields.pyi
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
from typing import Any, Optional
|
||||||
|
|
||||||
|
DATE_LENGTH: Any
|
||||||
|
DATETIME_LENGTH: Any
|
||||||
|
EMPTY_DICT: Any
|
||||||
|
RENAMED_ATTRS: Any
|
||||||
|
Default: Any
|
||||||
|
|
||||||
|
def copy_cache(records: Any, env: Any) -> None: ...
|
||||||
|
def first(records: Any): ...
|
||||||
|
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: ...
|
||||||
|
|
||||||
|
class Field:
|
||||||
|
type: Any = ...
|
||||||
|
relational: bool = ...
|
||||||
|
translate: bool = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
column_format: str = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
args: Any = ...
|
||||||
|
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 setup_base(self, model: Any, name: Any) -> None: ...
|
||||||
|
def setup_full(self, model: Any) -> None: ...
|
||||||
|
def traverse_related(self, record: Any): ...
|
||||||
|
@property
|
||||||
|
def base_field(self): ...
|
||||||
|
def resolve_deps(self, model: Any, path0: Any = ..., seen: Any = ...): ...
|
||||||
|
recursive: bool = ...
|
||||||
|
def setup_triggers(self, model: Any) -> None: ...
|
||||||
|
def get_description(self, env: Any): ...
|
||||||
|
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_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): ...
|
||||||
|
def convert_to_export(self, value: Any, record: Any): ...
|
||||||
|
def convert_to_display_name(self, value: Any, record: Any): ...
|
||||||
|
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 create(self, record_values: Any) -> None: ...
|
||||||
|
def write(self, records: Any, value: Any): ...
|
||||||
|
def __get__(self, record: Any, owner: Any): ...
|
||||||
|
def __set__(self, record: Any, value: Any) -> None: ...
|
||||||
|
def compute_value(self, records: Any) -> None: ...
|
||||||
|
def determine_value(self, record: Any) -> None: ...
|
||||||
|
def determine_draft_value(self, record: Any): ...
|
||||||
|
def determine_inverse(self, records: Any) -> None: ...
|
||||||
|
def determine_domain(self, records: Any, operator: Any, value: Any): ...
|
||||||
|
def modified_draft(self, records: Any): ...
|
||||||
|
|
||||||
|
class Boolean(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_type: 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_export(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class Integer(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_type: 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_read(self, value: Any, record: Any, use_name_get: bool = ...): ...
|
||||||
|
def convert_to_export(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class Float(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
def __init__(self, string: Any = ..., digits: Any = ..., **kwargs: Any) -> None: ...
|
||||||
|
@property
|
||||||
|
def column_type(self): ...
|
||||||
|
@property
|
||||||
|
def digits(self): ...
|
||||||
|
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_export(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class Monetary(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
def __init__(self, string: Any = ..., currency_field: Any = ..., **kwargs: 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_read(self, value: Any, record: Any, use_name_get: bool = ...): ...
|
||||||
|
def convert_to_write(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class _String(Field):
|
||||||
|
def __init__(self, string: Any = ..., **kwargs: Any) -> None: ...
|
||||||
|
def get_trans_terms(self, value: Any): ...
|
||||||
|
def get_trans_func(self, records: Any): ...
|
||||||
|
def check_trans_value(self, value: Any): ...
|
||||||
|
|
||||||
|
class Char(_String):
|
||||||
|
type: str = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
@property
|
||||||
|
def column_type(self): ...
|
||||||
|
def update_db_column(self, model: Any, column: 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 = ...): ...
|
||||||
|
|
||||||
|
class Text(_String):
|
||||||
|
type: str = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
def convert_to_cache(self, value: Any, record: Any, validate: bool = ...): ...
|
||||||
|
|
||||||
|
class Html(_String):
|
||||||
|
type: str = ...
|
||||||
|
column_type: 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 = ...): ...
|
||||||
|
|
||||||
|
class Date(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
start_of: Any = ...
|
||||||
|
end_of: Any = ...
|
||||||
|
add: Any = ...
|
||||||
|
subtract: Any = ...
|
||||||
|
@staticmethod
|
||||||
|
def today(*args: Any): ...
|
||||||
|
@staticmethod
|
||||||
|
def context_today(record: Any, timestamp: Optional[Any] = ...): ...
|
||||||
|
@staticmethod
|
||||||
|
def to_date(value: Any): ...
|
||||||
|
from_string: Any = ...
|
||||||
|
@staticmethod
|
||||||
|
def to_string(value: Any): ...
|
||||||
|
def convert_to_cache(self, value: Any, record: Any, validate: bool = ...): ...
|
||||||
|
def convert_to_export(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class Datetime(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
column_cast_from: Any = ...
|
||||||
|
start_of: Any = ...
|
||||||
|
end_of: Any = ...
|
||||||
|
add: Any = ...
|
||||||
|
subtract: Any = ...
|
||||||
|
@staticmethod
|
||||||
|
def now(*args: Any): ...
|
||||||
|
@staticmethod
|
||||||
|
def today(*args: Any): ...
|
||||||
|
@staticmethod
|
||||||
|
def context_timestamp(record: Any, timestamp: Any): ...
|
||||||
|
@staticmethod
|
||||||
|
def to_datetime(value: Any): ...
|
||||||
|
from_string: Any = ...
|
||||||
|
@staticmethod
|
||||||
|
def to_string(value: Any): ...
|
||||||
|
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): ...
|
||||||
|
|
||||||
|
class Binary(Field):
|
||||||
|
type: str = ...
|
||||||
|
@property
|
||||||
|
def column_type(self): ...
|
||||||
|
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 read(self, records: Any) -> None: ...
|
||||||
|
def create(self, record_values: Any) -> None: ...
|
||||||
|
def write(self, records: Any, value: Any) -> None: ...
|
||||||
|
|
||||||
|
class Selection(Field):
|
||||||
|
type: str = ...
|
||||||
|
def __init__(self, selection: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
|
||||||
|
@property
|
||||||
|
def column_type(self): ...
|
||||||
|
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 = ...): ...
|
||||||
|
def convert_to_export(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class Reference(Selection):
|
||||||
|
type: str = ...
|
||||||
|
@property
|
||||||
|
def column_type(self): ...
|
||||||
|
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 convert_to_export(self, value: Any, record: Any): ...
|
||||||
|
def convert_to_display_name(self, value: Any, record: Any): ...
|
||||||
|
|
||||||
|
class _Relational(Field):
|
||||||
|
relational: bool = ...
|
||||||
|
def null(self, record: Any): ...
|
||||||
|
|
||||||
|
class Many2one(_Relational):
|
||||||
|
type: str = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
def __init__(self, comodel_name: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
|
||||||
|
ondelete: Any = ...
|
||||||
|
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 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 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): ...
|
||||||
|
|
||||||
|
class _RelationalMultiUpdate:
|
||||||
|
record: Any = ...
|
||||||
|
field: Any = ...
|
||||||
|
value: Any = ...
|
||||||
|
def __init__(self, record: Any, field: Any, value: Any) -> None: ...
|
||||||
|
def __call__(self): ...
|
||||||
|
|
||||||
|
class _RelationalMulti(_Relational):
|
||||||
|
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 convert_to_write(self, value: Any, record: Any): ...
|
||||||
|
def convert_to_onchange(self, value: Any, record: Any, names: Any): ...
|
||||||
|
def convert_to_export(self, value: Any, record: Any): ...
|
||||||
|
def convert_to_display_name(self, value: Any, record: Any) -> None: ...
|
||||||
|
|
||||||
|
class One2many(_RelationalMulti):
|
||||||
|
type: str = ...
|
||||||
|
def __init__(self, comodel_name: Any = ..., inverse_name: Any = ..., string: Any = ..., **kwargs: Any) -> None: ...
|
||||||
|
def convert_to_onchange(self, value: Any, record: Any, names: Any): ...
|
||||||
|
def update_db(self, model: Any, columns: Any) -> None: ...
|
||||||
|
def read(self, records: Any): ...
|
||||||
|
def create(self, record_values: Any) -> None: ...
|
||||||
|
def write(self, records: Any, value: Any) -> None: ...
|
||||||
|
|
||||||
|
class Many2many(_RelationalMulti):
|
||||||
|
type: str = ...
|
||||||
|
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 update_db_foreign_keys(self, model: Any) -> None: ...
|
||||||
|
def read(self, records: Any) -> None: ...
|
||||||
|
def create(self, record_values: Any) -> None: ...
|
||||||
|
def write(self, records: Any, value: Any) -> None: ...
|
||||||
|
|
||||||
|
class Id(Field):
|
||||||
|
type: str = ...
|
||||||
|
column_type: Any = ...
|
||||||
|
def update_db(self, model: Any, columns: Any) -> None: ...
|
||||||
|
def __get__(self, record: Any, owner: Any): ...
|
||||||
|
def __set__(self, record: Any, value: Any) -> None: ...
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Any
|
from typing import *
|
||||||
|
|
||||||
from . import api
|
from . import api, fields
|
||||||
|
from .modules.registry import Registry
|
||||||
|
|
||||||
|
|
||||||
class MetaModel(api.Meta):
|
class MetaModel(api.Meta):
|
||||||
@@ -10,9 +11,18 @@ class MetaModel(api.Meta):
|
|||||||
|
|
||||||
|
|
||||||
class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
|
class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
|
||||||
_ids: list
|
_id: int
|
||||||
|
_ids: List[int]
|
||||||
|
_fields: Dict[str, fields.Field]
|
||||||
|
_inherit_children: Set[str]
|
||||||
|
pool: Registry
|
||||||
|
env: api.Environment
|
||||||
|
|
||||||
|
__bases__: Tuple[BaseModel, ...]
|
||||||
def __iter__(self) -> BaseModel: ...
|
def __iter__(self) -> BaseModel: ...
|
||||||
def _browse(self) -> BaseModel: ...
|
|
||||||
|
def browse(self, ids: Optional[Union[Iterable[int], int]]) -> BaseModel: ...
|
||||||
|
def search(self, args: List, offset: Optional[int] = 0, limit=Optional[int], order=Optional[str], count=Optional[int]) -> BaseModel: ...
|
||||||
|
|
||||||
|
|
||||||
AbstractModel = BaseModel
|
AbstractModel = BaseModel
|
||||||
|
|||||||
60
odoo-stubs/modules/registry.pyi
Normal file
60
odoo-stubs/modules/registry.pyi
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# Stubs for odoo.modules.registry (Python 3)
|
||||||
|
#
|
||||||
|
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||||
|
|
||||||
|
from collections import Mapping
|
||||||
|
from typing import Any, Optional
|
||||||
|
|
||||||
|
class Registry(Mapping):
|
||||||
|
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 = ...
|
||||||
|
updated_modules: Any = ...
|
||||||
|
loaded_xmlids: Any = ...
|
||||||
|
db_name: 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): ...
|
||||||
|
def __getitem__(self, model_name: Any): ...
|
||||||
|
def __call__(self, model_name: Any): ...
|
||||||
|
def __setitem__(self, model_name: Any, model: Any) -> None: ...
|
||||||
|
def field_sequence(self): ...
|
||||||
|
def descendants(self, model_names: Any, *kinds: Any): ...
|
||||||
|
def load(self, cr: Any, module: Any): ...
|
||||||
|
def setup_models(self, cr: Any) -> None: ...
|
||||||
|
def post_init(self, func: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||||
|
def init_models(self, cr: Any, model_names: Any, context: Any) -> None: ...
|
||||||
|
def check_tables_exist(self, cr: Any) -> None: ...
|
||||||
|
def cache(self): ...
|
||||||
|
def clear_caches(self) -> None: ...
|
||||||
|
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: ...
|
||||||
Reference in New Issue
Block a user