-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stock_release_channel_process_end_time: process_end_date as dat…
…e_deadline Add a new option on the route definition to allow the use of the release channel's process end date as date deadline on stock moves created when releasing deliveries. This is required to allow the merge of generated moves. By default pulled moves keep the date deadline of their destination moves. If different moves for the same product from different sale orders are grouped into the same delivery, you expect that the system will generate only one pick operation. It's only possible if the generated pulled moves have the same date deadline.
- Loading branch information
Showing
7 changed files
with
124 additions
and
9 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import stock_picking | ||
from . import stock_release_channel | ||
from . import res_config_settings | ||
from . import stock_move |
26 changes: 26 additions & 0 deletions
26
stock_release_channel_process_end_time/models/stock_move.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,26 @@ | ||
# Copyright 2024 ACSONE SA/NV (https://acsone.eu) | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from odoo import models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move" | ||
|
||
def _prepare_procurement_values(self): | ||
values = super()._prepare_procurement_values() | ||
if ( | ||
self.picking_id.picking_type_code == "outgoing" | ||
and self.picking_id.release_channel_id.process_end_date | ||
and bool( | ||
self.env["ir.config_parameter"] | ||
.sudo() | ||
.get_param( | ||
"stock_release_channel_process_end_time.stock_release_use_channel_end_date" | ||
) | ||
) | ||
): | ||
values[ | ||
"date_deadline" | ||
] = self.picking_id.release_channel_id.process_end_date | ||
return values |
18 changes: 15 additions & 3 deletions
18
stock_release_channel_process_end_time/readme/DESCRIPTION.rst
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,4 +1,16 @@ | ||
This module allows to set an end time on a release channel that will be transmitted on | ||
related stock pickings (on scheduled date) when the channel awakes. | ||
This module allows to configure an end time on a release channel that will become the channel end date when the channel awakes. This process end date specify when all the work in the channel should be finalized. | ||
Note: ensure to configure the timezone on the address of the warehouse to have the right time to datetime conversion. | ||
|
||
The channel process end date can be propagated to the generated pickings in order to solve two challenges: | ||
|
||
- You expect to view the stock pickings in the same order as the the one you | ||
have set as process end date on the release channel. This way you can easily | ||
manage the deliveries in the same order as the one expected by the planned | ||
release channels. | ||
|
||
- You expect to set as deadline of your released move operations the process | ||
end date of the release channel. This is useful to ensure that move created | ||
when releasing deliveries get the same deadline as the one set on the | ||
release channel. This is also required to allow the merge of move operations | ||
generated for the same product, location in the same stock picking. | ||
|
||
That allows to use Odoo core sorting feature on stock pickings level. |
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