diff --git a/stock_release_channel_process_end_time/README.rst b/stock_release_channel_process_end_time/README.rst index 09ea94209e..cea8f0e0cc 100644 --- a/stock_release_channel_process_end_time/README.rst +++ b/stock_release_channel_process_end_time/README.rst @@ -28,10 +28,22 @@ Stock Release Channel Process End Date |badge1| |badge2| |badge3| |badge4| |badge5| -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. **Table of contents** @@ -41,6 +53,8 @@ That allows to use Odoo core sorting feature on stock pickings level. Usage ===== +Assign the release channel's process end date to the pickings as scheduled date: + #. Assign a timezone on the Warehouse address if defined and if needed If you have a lot of warehouses in the same timezone, you can also define the timezone on the company partner. @@ -54,6 +68,9 @@ Usage #. Wake up the channel #. The assigned pickings have their scheduled date set at the next end time. (if enabled "Update Scheduled Date" config) +When the assigned pickings are released, the move date deadline is set to the scheduled date +into the pickings generated by the release process. + Known issues / Roadmap ====================== diff --git a/stock_release_channel_process_end_time/models/__init__.py b/stock_release_channel_process_end_time/models/__init__.py index b2326b5874..f158ddf090 100644 --- a/stock_release_channel_process_end_time/models/__init__.py +++ b/stock_release_channel_process_end_time/models/__init__.py @@ -1,3 +1,4 @@ from . import stock_picking from . import stock_release_channel from . import res_config_settings +from . import stock_move diff --git a/stock_release_channel_process_end_time/models/stock_move.py b/stock_release_channel_process_end_time/models/stock_move.py new file mode 100644 index 0000000000..03e87e7ac3 --- /dev/null +++ b/stock_release_channel_process_end_time/models/stock_move.py @@ -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 diff --git a/stock_release_channel_process_end_time/readme/DESCRIPTION.rst b/stock_release_channel_process_end_time/readme/DESCRIPTION.rst index b52c964d3d..ef9a3b80ce 100644 --- a/stock_release_channel_process_end_time/readme/DESCRIPTION.rst +++ b/stock_release_channel_process_end_time/readme/DESCRIPTION.rst @@ -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. diff --git a/stock_release_channel_process_end_time/readme/USAGE.rst b/stock_release_channel_process_end_time/readme/USAGE.rst index 3ddf7ed70b..2c77f9e2b6 100644 --- a/stock_release_channel_process_end_time/readme/USAGE.rst +++ b/stock_release_channel_process_end_time/readme/USAGE.rst @@ -1,3 +1,5 @@ +Assign the release channel's process end date to the pickings as scheduled date: + #. Assign a timezone on the Warehouse address if defined and if needed If you have a lot of warehouses in the same timezone, you can also define the timezone on the company partner. @@ -10,3 +12,6 @@ #. Set an end time #. Wake up the channel #. The assigned pickings have their scheduled date set at the next end time. (if enabled "Update Scheduled Date" config) + +When the assigned pickings are released, the move date deadline is set to the scheduled date +into the pickings generated by the release process. diff --git a/stock_release_channel_process_end_time/static/description/index.html b/stock_release_channel_process_end_time/static/description/index.html index caa196fe29..bcbe266eaf 100644 --- a/stock_release_channel_process_end_time/static/description/index.html +++ b/stock_release_channel_process_end_time/static/description/index.html @@ -1,3 +1,4 @@ +
@@ -369,9 +370,20 @@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.
-That allows to use Odoo core sorting feature on stock pickings level.
+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:
+Table of contents
Assign the release channel’s process end date to the pickings as scheduled date:
When the assigned pickings are released, the move date deadline is set to the scheduled date +into the pickings generated by the release process.