-
-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stock_split_picking: Use specific exceptions
- Loading branch information
1 parent
07d0694
commit d7f5754
Showing
3 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
from . import models | ||
from . import wizards | ||
from . import exceptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 StockSplitPickingStateError(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 StockSplitPickingError(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) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters