mirror of
https://github.com/odoo-ide/odoo-stubs.git
synced 2025-05-08 16:52:26 +03:00
Init
This commit is contained in:
0
odoo-stubs/__init__.pyi
Normal file
0
odoo-stubs/__init__.pyi
Normal file
115
odoo-stubs/api.pyi
Normal file
115
odoo-stubs/api.pyi
Normal file
@@ -0,0 +1,115 @@
|
||||
# Stubs for odoo.api (Python 3)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from collections import Mapping
|
||||
from typing import Any, Optional
|
||||
|
||||
class Params:
|
||||
args: Any = ...
|
||||
kwargs: Any = ...
|
||||
def __init__(self, args: Any, kwargs: Any) -> None: ...
|
||||
|
||||
class Meta(type):
|
||||
def __new__(meta: Any, name: Any, bases: Any, attrs: Any): ...
|
||||
|
||||
def constrains(*args: Any): ...
|
||||
def onchange(*args: Any): ...
|
||||
def depends(*args: Any): ...
|
||||
def returns(model: Any, downgrade: Optional[Any] = ..., upgrade: Optional[Any] = ...): ...
|
||||
def model(method: Any): ...
|
||||
def multi(method: Any): ...
|
||||
def one(method: Any): ...
|
||||
def model_cr(method: Any): ...
|
||||
def model_cr_context(method: Any): ...
|
||||
def cr(method: Any): ...
|
||||
def cr_context(method: Any): ...
|
||||
def cr_uid(method: Any): ...
|
||||
def cr_uid_context(method: Any): ...
|
||||
def cr_uid_id(method: Any): ...
|
||||
def cr_uid_id_context(method: Any): ...
|
||||
def cr_uid_ids(method: Any): ...
|
||||
def cr_uid_ids_context(method: Any): ...
|
||||
def cr_uid_records(method: Any): ...
|
||||
def cr_uid_records_context(method: Any): ...
|
||||
def noguess(method: Any): ...
|
||||
def guess(method: Any): ...
|
||||
def call_kw(model: Any, name: Any, args: Any, kwargs: Any): ...
|
||||
|
||||
class Environment(Mapping):
|
||||
def envs(cls): ...
|
||||
@classmethod
|
||||
def manage(cls) -> None: ...
|
||||
@classmethod
|
||||
def reset(cls) -> None: ...
|
||||
registry: Any = ...
|
||||
cache: Any = ...
|
||||
dirty: Any = ...
|
||||
all: Any = ...
|
||||
def __new__(cls, cr: Any, uid: Any, context: Any): ...
|
||||
def __contains__(self, model_name: Any): ...
|
||||
def __getitem__(self, model_name: Any): ...
|
||||
def __iter__(self): ...
|
||||
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] = ...): ...
|
||||
def ref(self, xml_id: Any, raise_if_not_found: bool = ...): ...
|
||||
@property
|
||||
def user(self): ...
|
||||
@property
|
||||
def lang(self): ...
|
||||
def do_in_draft(self): ...
|
||||
@property
|
||||
def in_draft(self): ...
|
||||
def do_in_onchange(self): ...
|
||||
@property
|
||||
def in_onchange(self): ...
|
||||
def clear(self) -> None: ...
|
||||
def clear_upon_failure(self) -> None: ...
|
||||
def protected(self, field: Any): ...
|
||||
def protecting(self, what: Any, records: Optional[Any] = ...) -> None: ...
|
||||
def field_todo(self, field: Any): ...
|
||||
def check_todo(self, field: Any, record: Any): ...
|
||||
def add_todo(self, field: Any, records: Any) -> None: ...
|
||||
def remove_todo(self, field: Any, records: Any) -> None: ...
|
||||
def has_todo(self): ...
|
||||
def get_todo(self): ...
|
||||
@property
|
||||
def recompute(self): ...
|
||||
def norecompute(self) -> None: ...
|
||||
def cache_key(self, field: Any): ...
|
||||
|
||||
class Environments:
|
||||
envs: Any = ...
|
||||
cache: Any = ...
|
||||
todo: Any = ...
|
||||
mode: bool = ...
|
||||
recompute: bool = ...
|
||||
def __init__(self) -> None: ...
|
||||
def add(self, env: Any) -> None: ...
|
||||
def __iter__(self): ...
|
||||
|
||||
class Cache:
|
||||
def __init__(self) -> None: ...
|
||||
def contains(self, record: Any, field: Any): ...
|
||||
def get(self, record: Any, field: Any): ...
|
||||
def set(self, record: Any, field: Any, value: Any) -> None: ...
|
||||
def update(self, records: Any, field: Any, values: Any) -> None: ...
|
||||
def remove(self, record: Any, field: Any) -> None: ...
|
||||
def contains_value(self, record: Any, field: Any): ...
|
||||
def get_value(self, record: Any, field: Any, default: Optional[Any] = ...): ...
|
||||
def get_special(self, record: Any, field: Any, default: Optional[Any] = ...): ...
|
||||
def set_special(self, record: Any, field: Any, getter: Any) -> None: ...
|
||||
def set_failed(self, records: Any, fields: Any, exception: Any) -> None: ...
|
||||
def get_fields(self, record: Any) -> None: ...
|
||||
def get_records(self, model: Any, field: Any): ...
|
||||
def get_missing_ids(self, records: Any, field: Any) -> None: ...
|
||||
def copy(self, records: Any, env: Any) -> None: ...
|
||||
def invalidate(self, spec: Optional[Any] = ...) -> None: ...
|
||||
def check(self, env: Any) -> None: ...
|
||||
|
||||
class SpecialValue:
|
||||
get: Any = ...
|
||||
def __init__(self, getter: Any) -> None: ...
|
||||
24
odoo-stubs/models.pyi
Normal file
24
odoo-stubs/models.pyi
Normal file
@@ -0,0 +1,24 @@
|
||||
from typing import Any
|
||||
|
||||
from . import api
|
||||
|
||||
|
||||
class MetaModel(api.Meta):
|
||||
module_to_models: Any = ...
|
||||
|
||||
def __init__(self, name: Any, bases: Any, attrs: Any) -> None: ...
|
||||
|
||||
|
||||
class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
|
||||
_ids: list
|
||||
def __iter__(self) -> BaseModel: ...
|
||||
def _browse(self) -> BaseModel: ...
|
||||
|
||||
|
||||
AbstractModel = BaseModel
|
||||
|
||||
|
||||
class Model(AbstractModel): ...
|
||||
|
||||
|
||||
class TransientModel(Model): ...
|
||||
21
setup.py
Normal file
21
setup.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
def find_stubs(package):
|
||||
stubs = []
|
||||
for root, dirs, files in os.walk(package):
|
||||
for f in files:
|
||||
stubs.append(os.path.relpath(os.path.join(root, f), package))
|
||||
return {package: stubs}
|
||||
|
||||
|
||||
setup(
|
||||
name="Odoo12-stubs",
|
||||
url="https://github.com/trinhanhngoc/odoo12-stubs",
|
||||
author="Trinh Anh Ngoc",
|
||||
author_email="atw1990@gmail.com",
|
||||
version="0.0.1",
|
||||
package_data=find_stubs("odoo-stubs"),
|
||||
packages=["odoo-stubs"]
|
||||
)
|
||||
Reference in New Issue
Block a user