From 0a590d60d746b12a94fdd6e0af694d00a9fee70b Mon Sep 17 00:00:00 2001 From: Trinh Anh Ngoc Date: Tue, 10 Dec 2019 10:46:10 +0700 Subject: [PATCH] Update --- odoo-stubs/api.pyi | 2 +- odoo-stubs/models.pyi | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/odoo-stubs/api.pyi b/odoo-stubs/api.pyi index 34ce3a8..1a2ca10 100644 --- a/odoo-stubs/api.pyi +++ b/odoo-stubs/api.pyi @@ -53,7 +53,7 @@ class Environment(Mapping): cache: Any = ... dirty: Any = ... all: Any = ... - def __new__(cls, cr: Any, uid: Any, context: Any): ... + def __new__(cls, cr: Any, uid: Any, context: Any) -> Environment: ... def __contains__(self, model_name: Any): ... def __getitem__(self, model_name: Any): ... def __iter__(self): ... diff --git a/odoo-stubs/models.pyi b/odoo-stubs/models.pyi index cb28ff2..1954a50 100644 --- a/odoo-stubs/models.pyi +++ b/odoo-stubs/models.pyi @@ -1,13 +1,14 @@ # Stubs for odoo.models (Python 3) # # NOTE: This dynamically typed stub was automatically generated by stubgen. - +import datetime from collections import MutableMapping from typing import Any, Optional, List, Union, Sequence, Tuple, Dict, Generator from . import api, fields from .api import Environment from .modules.registry import Registry +from .sql_db import Cursor SearchDomain = List[Union[str, Sequence[str]]] RecordValue = Dict[str, Any] @@ -53,16 +54,23 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): _inherits: Dict[str, str] _rec_name: str _order: str - _context: Dict _fields: Dict[str, fields.Field] + _context: Dict + _cr: Cursor + _uid: int id: int env: Environment pool: Registry + display_name: str + create_uid = env['res.users'] + create_date: datetime.datetime + write_uid = env['res.users'] + write_date = datetime.datetime CONCURRENCY_CHECK_FIELD: str = ... def view_init(self, fields_list: Any) -> None: ... def compute_concurrency_field(self) -> None: ... def compute_concurrency_field_with_access(self) -> None: ... - def __new__(cls) -> None: ... + def __new__(cls) -> BaseModel: ... def __init__(self, pool: Any, cr: Any) -> None: ... def export_data(self, fields_to_export: Any, raw_data: bool = ...): ... def load(self, fields: Any, data: Any): ...