-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Add shopfloor_location_package_restriction
- Loading branch information
Showing
4 changed files
with
23 additions
and
42 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
from . import single_pack_transfer | ||
from . import zone_picking | ||
from . import service |
16 changes: 7 additions & 9 deletions
16
...kage_restriction/services/zone_picking.py → ...n_package_restriction/services/service.py
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 |
---|---|---|
@@ -1,26 +1,24 @@ | ||
# Copyright 2023 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
|
||
from odoo.exceptions import ValidationError | ||
|
||
from odoo.addons.component.core import Component | ||
from odoo.addons.component.core import AbstractComponent | ||
|
||
|
||
class BaseShopfloorProcess(AbstractComponent): | ||
|
||
class ShopfloorZonePicking(Component): | ||
_inherit = "shopfloor.zone.picking" | ||
_inherit = "base.shopfloor.process" | ||
|
||
def _validate_destination(self, location, moves): | ||
message = super()._validate_destination(location, moves) | ||
def validate_dest_location(self, moves, location): | ||
message = super().validate_dest_location(moves, location) | ||
if message: | ||
return message | ||
if location.package_restriction != "norestriction": | ||
if location.package_restriction: | ||
try: | ||
moves._check_location_package_restriction(only_qty_done=False) | ||
except ValidationError as ex: | ||
# __import__("pdb").set_trace() | ||
return { | ||
"message_type": "error", | ||
"body": ex.name, | ||
} | ||
# return self.msg_store.location_has_restrictions() |
26 changes: 0 additions & 26 deletions
26
shopfloor_location_package_restriction/services/single_pack_transfer.py
This file was deleted.
Oops, something went wrong.
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