-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] - add stock_release_channel_shipment_advice_process_end_time
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.
- Loading branch information
Showing
22 changed files
with
825 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...dvice_process_end_time/odoo/addons/stock_release_channel_shipment_advice_process_end_time
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 @@ | ||
../../../../stock_release_channel_shipment_advice_process_end_time |
6 changes: 6 additions & 0 deletions
6
setup/stock_release_channel_shipment_advice_process_end_time/setup.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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
88 changes: 88 additions & 0 deletions
88
stock_release_channel_shipment_advice_process_end_time/README.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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
====================================================== | ||
Stock Release Channel Shipment Advice Process End Time | ||
====================================================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/webui/builds.html?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. Go to inventory settings and set a global delay time for all channels. | ||
2. Set a specific delay by warehouse. | ||
3. 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. | ||
If both aren't given, the global delay is applied. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/wms/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/wms/issues/new?body=module:%20stock_release_channel_shipment_advice_process_end_time%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* ACSONE SA/NV | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu> | ||
* Laurent Mignon <laurent.mignon@acsone.eu> | ||
|
||
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 <https://github.com/OCA/wms/tree/16.0/stock_release_channel_shipment_advice_process_end_time>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
2 changes: 2 additions & 0 deletions
2
stock_release_channel_shipment_advice_process_end_time/__init__.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,2 @@ | ||
from . import models | ||
from . import wizards |
22 changes: 22 additions & 0 deletions
22
stock_release_channel_shipment_advice_process_end_time/__manifest__.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,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": """ | ||
c""", | ||
"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", | ||
"views/res_config_settings.xml", | ||
], | ||
"demo": [], | ||
} |
4 changes: 4 additions & 0 deletions
4
stock_release_channel_shipment_advice_process_end_time/models/__init__.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,4 @@ | ||
from . import res_company | ||
from . import res_config_settings | ||
from . import stock_warehouse | ||
from . import stock_release_channel |
11 changes: 11 additions & 0 deletions
11
stock_release_channel_shipment_advice_process_end_time/models/res_company.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,11 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
|
||
_inherit = "res.company" | ||
|
||
release_channel_process_end_time_delay = fields.Integer() |
13 changes: 13 additions & 0 deletions
13
stock_release_channel_shipment_advice_process_end_time/models/res_config_settings.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,13 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
|
||
_inherit = "res.config.settings" | ||
|
||
release_channel_process_end_time_delay = fields.Integer( | ||
related="company_id.release_channel_process_end_time_delay", readonly=False | ||
) |
42 changes: 42 additions & 0 deletions
42
stock_release_channel_shipment_advice_process_end_time/models/stock_release_channel.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,42 @@ | ||
# 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 | ||
|
||
from odoo.addons.stock_release_channel_process_end_time.utils import float_to_time | ||
|
||
|
||
class StockReleaseChannel(models.Model): | ||
|
||
_inherit = "stock.release.channel" | ||
process_end_time_delay = fields.Integer( | ||
compute="_compute_process_end_time_delay", store=True, readonly=False | ||
) | ||
|
||
@api.depends("warehouse_id") | ||
def _compute_process_end_time_delay(self): | ||
for rec in self: | ||
if not rec.process_end_time_delay: | ||
rec.process_end_time_delay = ( | ||
rec.warehouse_id.release_channel_process_end_time_delay | ||
) | ||
|
||
def _get_process_end_time_delay(self, warehouse): | ||
self.ensure_one() | ||
if self.process_end_time_delay: | ||
return self.process_end_time_delay | ||
if not warehouse: | ||
return 0 | ||
if warehouse.release_channel_process_end_time_delay: | ||
return warehouse.release_channel_process_end_time_delay | ||
return warehouse.company_id.release_channel_process_end_time_delay | ||
|
||
def _get_shipment_advice_arrival_date(self, warehouse): | ||
self.ensure_one() | ||
process_end_time_delay = self._get_process_end_time_delay(warehouse) | ||
hours = float_to_time(self.process_end_time) | ||
return self.process_end_date.replace( | ||
hour=hours.hour, minute=hours.minute | ||
) + timedelta(minutes=process_end_time_delay) |
21 changes: 21 additions & 0 deletions
21
stock_release_channel_shipment_advice_process_end_time/models/stock_warehouse.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,21 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class StockWarehouse(models.Model): | ||
|
||
_inherit = "stock.warehouse" | ||
|
||
release_channel_process_end_time_delay = fields.Integer( | ||
compute="_compute_release_channel_end_time_delay", store=True, readonly=False | ||
) | ||
|
||
@api.depends("company_id") | ||
def _compute_release_channel_end_time_delay(self): | ||
for rec in self: | ||
if not rec.release_channel_process_end_time_delay: | ||
rec.release_channel_process_end_time_delay = ( | ||
rec.company_id.release_channel_process_end_time_delay | ||
) |
2 changes: 2 additions & 0 deletions
2
stock_release_channel_shipment_advice_process_end_time/readme/CONTRIBUTORS.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu> | ||
* Laurent Mignon <laurent.mignon@acsone.eu> |
2 changes: 2 additions & 0 deletions
2
stock_release_channel_shipment_advice_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 |
---|---|---|
@@ -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. |
9 changes: 9 additions & 0 deletions
9
stock_release_channel_shipment_advice_process_end_time/readme/USAGE.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
To set the delay time you have three options: | ||
|
||
1. Go to inventory settings and set a global delay time for all channels. | ||
2. Set a specific delay by warehouse. | ||
3. 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. | ||
If both aren't given, the global delay is applied. |
Binary file added
BIN
+9.23 KB
stock_release_channel_shipment_advice_process_end_time/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.