-
-
Notifications
You must be signed in to change notification settings - Fork 671
/
Copy pathexceptions.py
33 lines (26 loc) · 889 Bytes
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _
from odoo.exceptions import UserError
class SplitPickNotAllowedInStateError(UserError):
"""
Exception class to represent stock picking split error for picking wrong state
"""
def __init__(self, env, picking):
self.env = env
super().__init__(
_(
"Cannot split picking %(name)s in state %(state)s",
name=picking.name,
state=picking.state,
)
)
class NotPossibleToSplitPickError(UserError):
"""
Exception class to represent stock picking split error for picking
"""
def __init__(self, env, picking):
self.env = env
super().__init__(
_("Cannot split off all moves from picking %(name)s", name=picking.name)
)