@waron97/prbot 2.8.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,99 @@
1
+ from typing import (
2
+ Any,
3
+ Dict,
4
+ List,
5
+ Literal,
6
+ Optional,
7
+ Tuple,
8
+ Type,
9
+ TypeVar,
10
+ Union,
11
+ )
12
+ import logging
13
+ import datetime as _dt
14
+
15
+ from recordset import Recordset
16
+ from odoo_environment import OdooEnvironment
17
+ from odoo_records import _HelpdeskTicket
18
+ from b2w_entities import Asset, Contract, Order, OrderItem, Task
19
+
20
+ class Cursor:
21
+ def execute(self, query: str, params: Any = None) -> None: ...
22
+ def fetchone(self) -> Optional[Tuple[Any, ...]]: ...
23
+ def fetchall(self) -> List[Tuple[Any, ...]]: ...
24
+ def rollback(self) -> None: ...
25
+ def commit(self) -> None: ...
26
+
27
+ class Response:
28
+ status_code: int
29
+ text: str
30
+ content: bytes
31
+ headers: Dict[str, str]
32
+ ok: bool
33
+ def json(self) -> Any: ...
34
+ def raise_for_status(self) -> None: ...
35
+
36
+ # --- Globals ---
37
+
38
+ case_id: _HelpdeskTicket
39
+ env: OdooEnvironment
40
+ body: Dict[str, Any]
41
+ args: List[Any]
42
+ model: Recordset
43
+ logger: logging.Logger
44
+
45
+ # --- Functions ---
46
+
47
+ def log(
48
+ message: Any, level: Literal["debug", "info", "warning", "error"] = ...
49
+ ) -> None: ...
50
+ def json_dumps(
51
+ obj: Any,
52
+ *,
53
+ indent: Optional[int] = None,
54
+ sort_keys: bool = False,
55
+ default: Any = None,
56
+ ensure_ascii: bool = True,
57
+ ) -> str: ...
58
+ def json_loads(s: str) -> Any: ...
59
+ def make_response(
60
+ status: Tuple[int, int],
61
+ message: Union[str, Dict[str, Any]],
62
+ ) -> Any: ...
63
+ def request(
64
+ method: str,
65
+ url: str,
66
+ *,
67
+ headers: Optional[Dict[str, str]] = None,
68
+ data: Optional[Union[str, bytes]] = None,
69
+ json: Optional[Any] = None,
70
+ params: Optional[Dict[str, Any]] = None,
71
+ timeout: Optional[float] = None,
72
+ ) -> Response: ...
73
+
74
+ FirstArg = TypeVar("FirstArg")
75
+
76
+ def first(recordset: FirstArg) -> FirstArg: ...
77
+ def format_exc() -> str: ...
78
+
79
+ # --- Exceptions ---
80
+
81
+ class ValidationError(Exception): ...
82
+
83
+ # --- Datetime types (injected as the datetime module, not bare classes) ---
84
+
85
+ class _DatetimeModule:
86
+ datetime: Type[_dt.datetime]
87
+ date: Type[_dt.date]
88
+ time: Type[_dt.time]
89
+ timezone: Type[_dt.timezone]
90
+ timedelta: Type[_dt.timedelta]
91
+ MINYEAR: int
92
+ MAXYEAR: int
93
+
94
+ datetime: _DatetimeModule
95
+ date: Type[_dt.date]
96
+ time: Type[_dt.time]
97
+ timezone: Type[_dt.timezone]
98
+ pytz: Any
99
+ dateutil: Any
@@ -0,0 +1,68 @@
1
+ from typing import Any, Dict, List, Optional
2
+ from odoo_environment import OdooEnvironment
3
+
4
+
5
+ class Bit2winEntity:
6
+ env: OdooEnvironment
7
+ _id: str
8
+ data: Dict[str, Any]
9
+
10
+ def __init__(self, env: OdooEnvironment, _id: str, data: Optional[Dict[str, Any]] = None) -> None: ...
11
+ def patch(self, new_data: Any, method: str = "PATCH") -> Any: ...
12
+ def download(self) -> Dict[str, Any]: ...
13
+
14
+
15
+ class Asset(Bit2winEntity):
16
+ def children(self) -> "List[Asset]": ...
17
+ def order(self) -> "Order": ...
18
+ def order_item(self) -> "OrderItem": ...
19
+ def contract(self) -> "Contract": ...
20
+ def offer_codes(self) -> List[Dict[str, Any]]: ...
21
+ def offer_code(self, at: Any = None) -> Optional[str]: ...
22
+ def update_b2w_statemodel(
23
+ self,
24
+ destination_state: str,
25
+ sm_reason: str = "",
26
+ expected_date: Any = False,
27
+ ) -> Any: ...
28
+
29
+
30
+ class Order(Bit2winEntity):
31
+ def order_items(self) -> "List[OrderItem]": ...
32
+ def update_b2w_statemodel(
33
+ self,
34
+ destination_state: str,
35
+ sm_reason: str = "",
36
+ expected_date: Any = False,
37
+ ) -> Any: ...
38
+
39
+
40
+ class OrderItem(Bit2winEntity):
41
+ order_id: Optional[str]
42
+
43
+ def __init__(
44
+ self,
45
+ env: OdooEnvironment,
46
+ _id: str,
47
+ order_id: Optional[str] = None,
48
+ data: Optional[Dict[str, Any]] = None,
49
+ ) -> None: ...
50
+ def task_mdp(self) -> "Optional[Task]": ...
51
+ def update_b2w_statemodel(
52
+ self,
53
+ destination_state: str,
54
+ sm_reason: str = "",
55
+ expected_date: Any = False,
56
+ ) -> Any: ...
57
+
58
+
59
+ class Contract(Bit2winEntity):
60
+ def update_b2w_statemodel(
61
+ self,
62
+ destination_state: str,
63
+ sm_reason: str = "",
64
+ expected_date: Any = False,
65
+ ) -> Any: ...
66
+
67
+
68
+ class Task(Bit2winEntity): ...