forked from OCA/wms
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'refs/pull/770/head' of github.com:OCA/wms into merge-br…
…anch-2477-BSCOS-4099-99ea5643
- Loading branch information
Showing
26 changed files
with
301 additions
and
20 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
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
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
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
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
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
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
54 changes: 54 additions & 0 deletions
54
stock_available_to_promise_release/tests/test_unrelease_merged_moves.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,54 @@ | ||
# Copyright 2023 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from datetime import datetime | ||
|
||
from .common import PromiseReleaseCommonCase | ||
|
||
|
||
class TestAvailableToPromiseRelease(PromiseReleaseCommonCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
delivery_pick_rule = cls.wh.delivery_route_id.rule_ids.filtered( | ||
lambda r: r.location_src_id == cls.loc_stock | ||
) | ||
delivery_pick_rule.group_propagation_option = "fixed" | ||
cls.pc1 = cls._create_picking_chain( | ||
cls.wh, [(cls.product1, 2)], date=datetime(2019, 9, 2, 16, 0) | ||
) | ||
cls.shipping1 = cls._out_picking(cls.pc1) | ||
cls.pc2 = cls._create_picking_chain( | ||
cls.wh, [(cls.product1, 3)], date=datetime(2019, 9, 2, 16, 0) | ||
) | ||
cls.shipping2 = cls._out_picking(cls.pc2) | ||
cls._update_qty_in_location(cls.loc_bin1, cls.product1, 15.0) | ||
cls.wh.delivery_route_id.write( | ||
{ | ||
"available_to_promise_defer_pull": True, | ||
} | ||
) | ||
shippings = cls.shipping1 | cls.shipping2 | ||
shippings.release_available_to_promise() | ||
cls.picking1 = cls._prev_picking(cls.shipping1) | ||
cls.picking1.action_assign() | ||
cls.picking2 = cls._prev_picking(cls.shipping2) | ||
cls.picking2.action_assign() | ||
|
||
@classmethod | ||
def _out_picking(cls, pickings): | ||
return pickings.filtered(lambda r: r.picking_type_code == "outgoing") | ||
|
||
@classmethod | ||
def _prev_picking(cls, picking): | ||
return picking.move_lines.move_orig_ids.picking_id | ||
|
||
def test_unrelease_merged_move(self): | ||
self.assertEqual(self.picking1, self.picking2) | ||
moves = self.picking1.move_lines.filtered(lambda m: m.state == "assigned") | ||
self.assertEqual(sum(moves.mapped("product_uom_qty")), 5.0) | ||
self.shipping2.unrelease() | ||
move = self.picking1.move_lines.filtered(lambda m: m.state == "assigned") | ||
line = move.move_line_ids | ||
self.assertEqual(move.product_uom_qty, 2.0) | ||
self.assertEqual(line.product_uom_qty, 2.0) |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ Available to Promise Release - Dynamic Routing | |
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:6acf3b31d72d9fb1a24f1bf47f79e5bafc6ec4e41f7590ad28e35096ae1e85aa | ||
!! source digest: sha256:aead33fabdb3ae0f3970ffc2be1cfc29fccd1926d059460081fff13eccac24d7 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
|
@@ -61,10 +61,12 @@ Authors | |
~~~~~~~ | ||
|
||
* Camptocamp | ||
* BCIM | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
* Guewen Baconnier <[email protected]> | ||
* `Trobz <https://trobz.com>`_: | ||
* Dung Tran <[email protected]> | ||
|
@@ -88,6 +90,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose | |
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
.. |maintainer-jbaudoux| image:: https://github.com/jbaudoux.png?size=40px | ||
:target: https://github.com/jbaudoux | ||
:alt: jbaudoux | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-jbaudoux| | ||
|
||
This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/14.0/stock_available_to_promise_release_dynamic_routing>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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 models |
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,19 @@ | ||
#. module: stock_available_to_promise_release_dynamic_routing | ||
#: model:ir.model.fields,field_description:stock_available_to_promise_release_dynamic_routing.field_stock_move__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: stock_available_to_promise_release_dynamic_routing | ||
#: model:ir.model.fields,field_description:stock_available_to_promise_release_dynamic_routing.field_stock_move__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: stock_available_to_promise_release_dynamic_routing | ||
#: model:ir.model.fields,field_description:stock_available_to_promise_release_dynamic_routing.field_stock_move____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: stock_available_to_promise_release_dynamic_routing | ||
#: model:ir.model,name:stock_available_to_promise_release_dynamic_routing.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "" |
Oops, something went wrong.