diff --git a/setup/stock_release_channel_shipment_advice_process_end_time/odoo/addons/stock_release_channel_shipment_advice_process_end_time b/setup/stock_release_channel_shipment_advice_process_end_time/odoo/addons/stock_release_channel_shipment_advice_process_end_time new file mode 120000 index 0000000000..2ec4e16d88 --- /dev/null +++ b/setup/stock_release_channel_shipment_advice_process_end_time/odoo/addons/stock_release_channel_shipment_advice_process_end_time @@ -0,0 +1 @@ +../../../../stock_release_channel_shipment_advice_process_end_time \ No newline at end of file diff --git a/setup/stock_release_channel_shipment_advice_process_end_time/setup.py b/setup/stock_release_channel_shipment_advice_process_end_time/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/stock_release_channel_shipment_advice_process_end_time/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_release_channel_shipment_advice_process_end_time/README.rst b/stock_release_channel_shipment_advice_process_end_time/README.rst new file mode 100644 index 0000000000..a7490b3d35 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/README.rst @@ -0,0 +1,89 @@ +====================================================== +Stock Release Channel Shipment Advice Process End Time +====================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:78895955a1921691e97975a1f79d5dfa0ecf28a12296331a1c8c42f6dc9612b2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwms-lightgray.png?logo=github + :target: https://github.com/OCA/wms/tree/16.0/stock_release_channel_shipment_advice_process_end_time + :alt: OCA/wms +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-stock_release_channel_shipment_advice_process_end_time + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/wms&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to set a delay time (in minutes) between the release channel +process end time and the shipment advice arrival to the dock time. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To set the delay time you have three options: + +1. Set a specific delay by warehouse. +2. Set the delay at the release channel. + +At shipment advices creation by the release channel, odoo will consider the channel +delay time first. If isn't set, it will take the warehouse delay configuration. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Souheil Bejaoui +* Laurent Mignon + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/wms `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_release_channel_shipment_advice_process_end_time/__init__.py b/stock_release_channel_shipment_advice_process_end_time/__init__.py new file mode 100644 index 0000000000..aee8895e7a --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/stock_release_channel_shipment_advice_process_end_time/__manifest__.py b/stock_release_channel_shipment_advice_process_end_time/__manifest__.py new file mode 100644 index 0000000000..43d35f6d47 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Stock Release Channel Shipment Advice Process End Time", + "summary": """This module allows to set a delay time (in minutes) between the + release channel process end time and the shipment advice arrival to the dock time. + """, + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/wms", + "depends": [ + "stock_release_channel_shipment_advice", + "stock_release_channel_process_end_time", + ], + "data": [ + "views/stock_release_channel.xml", + "views/stock_warehouse.xml", + ], + "demo": [], +} diff --git a/stock_release_channel_shipment_advice_process_end_time/i18n/fr_BE.po b/stock_release_channel_shipment_advice_process_end_time/i18n/fr_BE.po new file mode 100644 index 0000000000..9dcf95bbca --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/i18n/fr_BE.po @@ -0,0 +1,102 @@ +# Traduction du serveur Odoo. +# Ce fichier contient la traduction des modules suivants : +# * stock_release_channel_shipment_advice_process_end_time +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-04 16:02+0000\n" +"PO-Revision-Date: 2023-08-04 16:02+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model_terms:ir.ui.view,arch_db:stock_release_channel_shipment_advice_process_end_time.stock_release_channel_form_view +#: model_terms:ir.ui.view,arch_db:stock_release_channel_shipment_advice_process_end_time.stock_warehouse_form_view +msgid "minutes" +msgstr "minutes" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,field_description:stock_release_channel_shipment_advice_process_end_time.field_stock_release_channel__shipment_advice_arrival_time +msgid "Arrival to dock at" +msgstr "Arrivée au quai à" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,help:stock_release_channel_shipment_advice_process_end_time.field_stock_warehouse__release_channel_shipment_advice_arrival_delay +msgid "Default value for the delay between the release channel process end time and the arrival of shipments to docks of this warehouse." +msgstr "Valeur par défaut du délai entre l'heure de fin du processus du canal de livraison et l'arrivée des expéditions au quai de cet entrepôt." + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,help:stock_release_channel_shipment_advice_process_end_time.field_stock_warehouse__release_channel_shipment_advice_departure_delay +msgid "Default value for the delay between the release channel process end time and the departure of shipments from the dock." +msgstr "Valeur par défaut du délai entre l'heure de fin du processus du canal de livraison et le départ des expéditions du quai." + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,field_description:stock_release_channel_shipment_advice_process_end_time.field_stock_release_channel__shipment_advice_departure_time +msgid "Departure from dock at" +msgstr "Départ du quai à" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,field_description:stock_release_channel_shipment_advice_process_end_time.field_stock_warehouse__release_channel_shipment_advice_arrival_delay +msgid "Release Channel Shipment Advice Arrival Delay" +msgstr "Délai d'arrivée d'avis d'expédition du canal de livraison" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,field_description:stock_release_channel_shipment_advice_process_end_time.field_stock_warehouse__release_channel_shipment_advice_departure_delay +msgid "Release Channel Shipment Advice Departure Delay" +msgstr "Délai de départ d'avis d'expédition du canal de livraison" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,field_description:stock_release_channel_shipment_advice_process_end_time.field_stock_release_channel__shipment_advice_arrival_delay +msgid "Shipment Advice Arrival Delay" +msgstr "Délai d'arrivée de l'avis d'expédition" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,field_description:stock_release_channel_shipment_advice_process_end_time.field_stock_release_channel__shipment_advice_departure_delay +msgid "Shipment Advice Departure Delay" +msgstr "Délai de départ de l'avis d'expédition" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model,name:stock_release_channel_shipment_advice_process_end_time.model_shipment_advice_planner +msgid "Shipment Advice Planner" +msgstr "Planificateur d'avis d'expédition" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model_terms:ir.ui.view,arch_db:stock_release_channel_shipment_advice_process_end_time.stock_release_channel_form_view +msgid "Shipment loading and departure Settings" +msgstr "Paramètres de chargement et de départ des expéditions" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model,name:stock_release_channel_shipment_advice_process_end_time.model_stock_release_channel +msgid "Stock Release Channels" +msgstr "Canaux de livraison" + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model_terms:ir.ui.view,arch_db:stock_release_channel_shipment_advice_process_end_time.stock_release_channel_form_view +msgid "The delay between the process end time and the arrival of shipments to the dock." +msgstr "Le délai entre l'heure de fin du processus et l'arrivée des expéditions au quai." + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model_terms:ir.ui.view,arch_db:stock_release_channel_shipment_advice_process_end_time.stock_release_channel_form_view +msgid "The delay between the process end time and the departure of shipments to the dock." +msgstr "Le délai entre l'heure de fin du processus et le départ des expéditions du quai." + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,help:stock_release_channel_shipment_advice_process_end_time.field_stock_release_channel__shipment_advice_arrival_delay +msgid "The delay between the release channel process end time and the arrival of shipments to the dock." +msgstr "Le délai entre l'heure de fin du processus du canal de livraison et l'arrivée des expéditions au quai." + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model.fields,help:stock_release_channel_shipment_advice_process_end_time.field_stock_release_channel__shipment_advice_departure_delay +msgid "The delay between the release channel process end time and the departure of shipments to the dock." +msgstr "Le délai entre l'heure de fin du processus du canal de livraison et le départ des expéditions du quai." + +#. module: stock_release_channel_shipment_advice_process_end_time +#: model:ir.model,name:stock_release_channel_shipment_advice_process_end_time.model_stock_warehouse +msgid "Warehouse" +msgstr "Entrepôt" diff --git a/stock_release_channel_shipment_advice_process_end_time/models/__init__.py b/stock_release_channel_shipment_advice_process_end_time/models/__init__.py new file mode 100644 index 0000000000..628b5b3675 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/models/__init__.py @@ -0,0 +1,2 @@ +from . import stock_warehouse +from . import stock_release_channel diff --git a/stock_release_channel_shipment_advice_process_end_time/models/stock_release_channel.py b/stock_release_channel_shipment_advice_process_end_time/models/stock_release_channel.py new file mode 100644 index 0000000000..e6514fbcb4 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/models/stock_release_channel.py @@ -0,0 +1,95 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from datetime import timedelta + +from odoo import api, fields, models + + +class StockReleaseChannel(models.Model): + + _inherit = "stock.release.channel" + shipment_advice_arrival_delay = fields.Integer( + compute="_compute_shipment_advice_arrival_delay", + store=True, + readonly=False, + help="The delay between the release channel process end time and the arrival " + "of shipments to the dock.", + ) + shipment_advice_arrival_time = fields.Float( + "Arrival to dock at", + compute="_compute_shipment_advice_arrival_time", + inverse="_inverse_shipment_advice_arrival_time", + ) + shipment_advice_departure_delay = fields.Integer( + compute="_compute_shipment_advice_departure_delay", + store=True, + readonly=False, + help="The delay between the release channel process end time and the departure " + "of shipments to the dock.", + ) + shipment_advice_departure_time = fields.Float( + "Departure from dock at", + compute="_compute_shipment_advice_departure_time", + inverse="_inverse_shipment_advice_departure_time", + ) + + @api.depends("process_end_time", "shipment_advice_departure_delay") + def _compute_shipment_advice_departure_time(self): + for rec in self: + rec.shipment_advice_departure_time = rec.process_end_time + ( + rec.shipment_advice_departure_delay / 60 + ) + + def _inverse_shipment_advice_departure_time(self): + for rec in self: + rec.shipment_advice_departure_delay = ( + rec.shipment_advice_departure_time - rec.process_end_time + ) * 60 + + @api.depends("process_end_time", "shipment_advice_arrival_delay") + def _compute_shipment_advice_arrival_time(self): + for rec in self: + rec.shipment_advice_arrival_time = rec.process_end_time + ( + rec.shipment_advice_arrival_delay / 60 + ) + + def _inverse_shipment_advice_arrival_time(self): + for rec in self: + rec.shipment_advice_arrival_delay = ( + rec.shipment_advice_arrival_time - rec.process_end_time + ) * 60 + + @api.depends("warehouse_id") + def _compute_shipment_advice_arrival_delay(self): + for rec in self: + if not rec.shipment_advice_arrival_delay: + rec.shipment_advice_arrival_delay = ( + rec.warehouse_id.release_channel_shipment_advice_arrival_delay + ) + + @api.depends("warehouse_id") + def _compute_shipment_advice_departure_delay(self): + for rec in self: + if not rec.shipment_advice_departure_delay: + rec.shipment_advice_departure_delay = ( + rec.warehouse_id.release_channel_shipment_advice_departure_delay + ) + + def _get_shipment_advice_arrival_date(self): + self.ensure_one() + return ( + self.process_end_date + + timedelta(minutes=self.shipment_advice_arrival_delay) + if self.process_end_date + else self.process_end_date + ) + + def _get_shipment_advice_departure_date(self): + self.ensure_one() + return ( + self.process_end_date + + timedelta(minutes=self.shipment_advice_departure_delay) + if self.process_end_date + else self.process_end_date + ) diff --git a/stock_release_channel_shipment_advice_process_end_time/models/stock_warehouse.py b/stock_release_channel_shipment_advice_process_end_time/models/stock_warehouse.py new file mode 100644 index 0000000000..8fcc4ee3e9 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/models/stock_warehouse.py @@ -0,0 +1,18 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockWarehouse(models.Model): + + _inherit = "stock.warehouse" + + release_channel_shipment_advice_arrival_delay = fields.Integer( + help="Default value for the delay between the release channel process " + "end time and the arrival of shipments to docks of this warehouse.", + ) + release_channel_shipment_advice_departure_delay = fields.Integer( + help="Default value for the delay between the release channel process " + "end time and the departure of shipments from the dock.", + ) diff --git a/stock_release_channel_shipment_advice_process_end_time/readme/CONTRIBUTORS.rst b/stock_release_channel_shipment_advice_process_end_time/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..7bb0d5b1d1 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Souheil Bejaoui +* Laurent Mignon diff --git a/stock_release_channel_shipment_advice_process_end_time/readme/DESCRIPTION.rst b/stock_release_channel_shipment_advice_process_end_time/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..743a84e653 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows to set a delay time (in minutes) between the release channel +process end time and the shipment advice arrival to the dock time. diff --git a/stock_release_channel_shipment_advice_process_end_time/readme/USAGE.rst b/stock_release_channel_shipment_advice_process_end_time/readme/USAGE.rst new file mode 100644 index 0000000000..80d49ad0b3 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/readme/USAGE.rst @@ -0,0 +1,7 @@ +To set the delay time you have three options: + +1. Set a specific delay by warehouse. +2. Set the delay at the release channel. + +At shipment advices creation by the release channel, odoo will consider the channel +delay time first. If isn't set, it will take the warehouse delay configuration. diff --git a/stock_release_channel_shipment_advice_process_end_time/static/description/icon.png b/stock_release_channel_shipment_advice_process_end_time/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/stock_release_channel_shipment_advice_process_end_time/static/description/icon.png differ diff --git a/stock_release_channel_shipment_advice_process_end_time/static/description/index.html b/stock_release_channel_shipment_advice_process_end_time/static/description/index.html new file mode 100644 index 0000000000..dcdfa864cc --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/static/description/index.html @@ -0,0 +1,434 @@ + + + + + + +Stock Release Channel Shipment Advice Process End Time + + + +
+

Stock Release Channel Shipment Advice Process End Time

+ + +

Beta License: AGPL-3 OCA/wms Translate me on Weblate Try me on Runboat

+

This module allows to set a delay time (in minutes) between the release channel +process end time and the shipment advice arrival to the dock time.

+

Table of contents

+ +
+

Usage

+

To set the delay time you have three options:

+
    +
  1. Set a specific delay by warehouse.
  2. +
  3. Set the delay at the release channel.
  4. +
+

At shipment advices creation by the release channel, odoo will consider the channel +delay time first. If isn’t set, it will take the warehouse delay configuration.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/wms project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_release_channel_shipment_advice_process_end_time/tests/__init__.py b/stock_release_channel_shipment_advice_process_end_time/tests/__init__.py new file mode 100644 index 0000000000..78b023b107 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_release_channel_shipment_advice_process_end_time diff --git a/stock_release_channel_shipment_advice_process_end_time/tests/test_stock_release_channel_shipment_advice_process_end_time.py b/stock_release_channel_shipment_advice_process_end_time/tests/test_stock_release_channel_shipment_advice_process_end_time.py new file mode 100644 index 0000000000..346cfbdf63 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/tests/test_stock_release_channel_shipment_advice_process_end_time.py @@ -0,0 +1,53 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from datetime import datetime + +from freezegun import freeze_time + +from odoo.addons.stock_release_channel.tests.common import ChannelReleaseCase + + +class TestStockReleaseChannelShipmentAdviceProcessEndTime(ChannelReleaseCase): + @classmethod + @freeze_time("2023-02-15 10:30:00") + def setUpClass(cls): + super().setUpClass() + output_loc = cls.channel.picking_ids.move_ids.location_id + cls._update_qty_in_location(output_loc, cls.product1, 100) + cls._update_qty_in_location(output_loc, cls.product2, 100) + cls.channel.picking_ids.move_ids.write({"procure_method": "make_to_stock"}) + cls.channel.picking_ids.action_assign() + cls.date_ref = datetime.now() + cls.channel.process_end_date = cls.date_ref + cls.channel.process_end_time = 10.5 + cls.channel.shipment_planning_method = "simple" + + def test_plan_shipment_simple_delay_on_warehouse_arrival_date(self): + """ + delay: + - warehouse: 20mn + - channel: 0mn + """ + self.wh.release_channel_shipment_advice_arrival_delay = 20 + self.channel.warehouse_id = self.wh + self.channel.button_plan_shipments() + shipment_advice = self.channel.shipment_advice_ids + self.assertEqual( + shipment_advice.arrival_date, self.date_ref.replace(hour=10, minute=50) + ) + + def test_plan_shipment_simple_delay_on_channel_arrival_date(self): + """ + delay: + - warehouse: 20mn + - channel: 30mn + """ + self.wh.release_channel_shipment_advice_arrival_delay = 20 + self.channel.warehouse_id = self.wh + self.channel.shipment_advice_arrival_delay = 30 + + self.channel.button_plan_shipments() + shipment_advice = self.channel.shipment_advice_ids + self.assertEqual( + shipment_advice.arrival_date, self.date_ref.replace(hour=11, minute=0) + ) diff --git a/stock_release_channel_shipment_advice_process_end_time/views/stock_release_channel.xml b/stock_release_channel_shipment_advice_process_end_time/views/stock_release_channel.xml new file mode 100644 index 0000000000..cffd8b1f63 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/views/stock_release_channel.xml @@ -0,0 +1,77 @@ + + + + + + stock.release.channel + + + + + + + +

The delay between the process end time and the arrival of shipments to the dock.

+ + + + + + +
+ +

The delay between the process end time and the departure of shipments to the dock.

+ + + + + + +
+ + + + +
+
+ +
+
+ +
diff --git a/stock_release_channel_shipment_advice_process_end_time/views/stock_warehouse.xml b/stock_release_channel_shipment_advice_process_end_time/views/stock_warehouse.xml new file mode 100644 index 0000000000..efa3ee2126 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/views/stock_warehouse.xml @@ -0,0 +1,33 @@ + + + + + + stock.warehouse + + + + + + + + + + diff --git a/stock_release_channel_shipment_advice_process_end_time/wizards/__init__.py b/stock_release_channel_shipment_advice_process_end_time/wizards/__init__.py new file mode 100644 index 0000000000..f1f4bd57b3 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/wizards/__init__.py @@ -0,0 +1 @@ +from . import shipment_advice_planner diff --git a/stock_release_channel_shipment_advice_process_end_time/wizards/shipment_advice_planner.py b/stock_release_channel_shipment_advice_process_end_time/wizards/shipment_advice_planner.py new file mode 100644 index 0000000000..f62d39ba18 --- /dev/null +++ b/stock_release_channel_shipment_advice_process_end_time/wizards/shipment_advice_planner.py @@ -0,0 +1,21 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class ShipmentAdvicePlanner(models.TransientModel): + + _inherit = "shipment.advice.planner" + + def _prepare_shipment_advice_common_vals(self, picking_type): + self.ensure_one() + vals = super()._prepare_shipment_advice_common_vals(picking_type) + if self.release_channel_id: + vals[ + "arrival_date" + ] = self.release_channel_id._get_shipment_advice_arrival_date() + vals[ + "departure_date" + ] = self.release_channel_id._get_shipment_advice_departure_date() + return vals