forked from OCA/wms
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stock_reception_screen_measuring_device: measure smaller packages
When goods are received, triggers measurements also for smaller packagings that weren't ordered or received. This behavior is not triggered when received packagings are not the same as ordered packagings.
- Loading branch information
1 parent
c114af4
commit 8c14d42
Showing
6 changed files
with
446 additions
and
14 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
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 @@ | ||
from . import test_reception_screen_measurement |
14 changes: 14 additions & 0 deletions
14
stock_reception_screen_measuring_device/tests/fake_components.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.addons.component.core import Component | ||
|
||
|
||
class FakeDevice(Component): | ||
_name = "device.component.fake" | ||
_inherit = "measuring.device.base" | ||
_usage = "fake" | ||
|
||
def post_update_packaging_measures(self, measures, packaging, wizard_line): | ||
# Unassign measuring device when measuring is done | ||
packaging._measuring_device_release() |
14 changes: 14 additions & 0 deletions
14
stock_reception_screen_measuring_device/tests/fake_models.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class FakeMeasuringDevice(models.Model): | ||
_inherit = "measuring.device" | ||
|
||
device_type = fields.Selection(selection_add=[("fake", "FAKE")]) | ||
|
||
def mocked_measure(self, measurements): | ||
self.ensure_one() | ||
self._update_packaging_measures(measurements) |
Oops, something went wrong.